| View previous topic :: View next topic |
| Author |
Message |
crazycat l33t


Joined: 26 Aug 2003 Posts: 838 Location: Hamburg, Germany
|
Posted: Sat Mar 19, 2005 11:31 am Post subject: unlocking 6800 |
|
|
I found some program to unlock gf6800 pipes on guru3d forums:
| Code: |
#include <stdio.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <iostream>
using namespace std;
// for future programming adventures i made an class that deals
// with the memory access. just scroll over if you are not
// interessted
class MemAccess
{
int mem_desc,mem_size;
unsigned char *mapped_ptr;
public:
struct Exception:public exception,public string
{
Exception(const char *text=0):exception(),string(text) {}
Exception(const Exception &e):exception(e),string(e) {}
virtual ~Exception() throw() {}
};
MemAccess(unsigned long address,unsigned int size):
mem_size((size/0x1000+(size%0x1000?1:0))*0x1000)
{ //increases mem_size to a multiple of 4KB
if(size>0x01000000) throw Exception("invalid size parameter.\n");
mem_desc=open("/dev/mem",O_RDWR);
if(mem_desc==-1)
throw Exception("cannot open /dev/mem (are you logged in as root?).\n");
mapped_ptr=(unsigned char *)mmap(0,mem_size,
PROT_READ|PROT_WRITE,MAP_SHARED,
mem_desc,address);
if(mapped_ptr==MAP_FAILED) {
close(mem_desc);
throw Exception("cannot map specified Address.\n");
}
}
unsigned long& operator[](unsigned long offset) throw() {
if(offset>mem_size-4) throw Exception("out of range.\n");
return *((unsigned long *)(mapped_ptr+offset));
}
const unsigned long& operator[](unsigned long offset) const throw() {
if(offset>mem_size-4) throw Exception("out of range.\n");
return *((unsigned long *)(mapped_ptr+offset));
}
void sync(void) {
msync(mapped_ptr,mem_size,MS_SYNC);
}
virtual ~MemAccess()
{
msync(mapped_ptr,mem_size,MS_SYNC);
munmap(mapped_ptr,mem_size);
close(mem_desc);
}
};
// the implemention of the above described idea of unlocking
class NVTuner
{
MemAccess NVMem;
public:
NVTuner(unsigned long NVAddress):NVMem(NVAddress,0x10000) {}
unsigned short GetPixelMask(void) const {
return (unsigned short)(NVMem[0x1540]);
}
void SetPixelMask(unsigned short mask) {
NVMem[0xc020]=NVMem[0xc024]=NVMem[0xc028]=NVMem[0xc02c]=0;
NVMem[0x1540]=0x00010000|mask;
NVMem.sync();
}
};
//the rest of the program concerns about parsing the command
//line and telling the user what's wrong or what to do.
void useage(void) {
cout<<"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!USE AT YOUR OWN RISK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\nUseage: \t\tnvtuner <memory address>\t :returns current pixel mask\n\t\tnvtuner <mask> <memory address> :sets pixel mask\nWhere <memory address> specifies the primary memory address of the graphic card.\nThis address can be obtained through 'cat /proc/pci'.\n\nExample:\tnvtuner 0x3f0f 0xfd000000\nEnables all pixel pipelines and vertex shaders on a graphic card using\n0xfd000000 as memory address.\n\n";
}
int main(int argc,char *argv[])
{
try {
switch(argc) {
case 2:
{
if(!strcmp(argv[1],"-h") || !strcmp(argv[1],"--help")) {
useage();
return 0;
}
unsigned long addr=strtoul(argv[1],0,0);
if(addr&0x00ffffff || addr==0) {
cout<<"I do not trust this memory address\n";
return 0;
}
NVTuner nt(addr);
printf("The current pixel mask is: 0x%.4x\n",nt.GetPixelMask());
}
break;
case 3:
{
if(!strcmp(argv[1],"-h") || !strcmp(argv[1],"--help")) {
useage();
return 0;
}
unsigned short mask=strtoul(argv[1],0,0);
unsigned long addr=strtoul(argv[2],0,0);
if(addr&0x00ffffff || addr==0) {
cout<<"I do not trust this memory address\n";
return 0;
}
NVTuner nt(addr);
printf("Setting pixel mask 0x%.4x\n",mask);
nt.SetPixelMask(mask);
printf("New pixel mask is: 0x%.4x\n",nt.GetPixelMask());
}
break;
default:
useage();
break;
}
}catch(MemAccess::Exception& e) {cout<<e;}
return 0;
}
|
Use at ur own risk. |
|
| Back to top |
|
 |
PZoned Guru


Joined: 27 May 2004 Posts: 360 Location: Toronto, Canada
|
Posted: Sat Mar 19, 2005 1:02 pm Post subject: |
|
|
How do you use that code? and have you had any success in improving fps? (if so, how much?) _________________ Check out my awesome blog! (The Best Blog Ever)
http://derrickbathory.blogspot.com/ |
|
| Back to top |
|
 |
crazycat l33t


Joined: 26 Aug 2003 Posts: 838 Location: Hamburg, Germany
|
Posted: Sat Mar 19, 2005 2:13 pm Post subject: |
|
|
Go here:
http://forums.guru3d.com/forumdisplay.php?s=&forumid=18
Use search formular below (u have to register for that and im too lazy for that ) and look for topic with name "unlocking gt6800 under linux". Original post from some gentoo user:
| Quote: |
Hi,
i made a program for unlocking the pixelpipelines and vertexshader on my gt6800nu in linux. The idea of the program is to port the "RivaTuner.exe /wrc020,0 /wrc024,0 /wrc028,0 /wrc02c,0 /wr1540,13f0f /rr1540" method of unlocking, as seen in the "Softmod doesn't stick" thread.
So here's the source code (The formatation is likely getting corrupted through posting it. I would provide an attachment, but forum rules do not permit.):
#include <stdio.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <iostream>
using namespace std;
// for future programming adventures i made an class that deals
// with the memory access. just scroll over if you are not
// interessted
class MemAccess
{
int mem_desc,mem_size;
unsigned char *mapped_ptr;
public:
struct Exception:public exception,public string
{
Exception(const char *text=0):exception(),string(text) {}
Exception(const Exception &e):exception(e),string(e) {}
virtual ~Exception() throw() {}
};
MemAccess(unsigned long address,unsigned int size):
mem_size((size/0x1000+(size%0x1000?1:0))*0x1000)
{ //increases mem_size to a multiple of 4KB
if(size>0x01000000) throw Exception("invalid size parameter.\n");
mem_desc=open("/dev/mem",O_RDWR);
if(mem_desc==-1)
throw Exception("cannot open /dev/mem (are you logged in as root?).\n");
mapped_ptr=(unsigned char *)mmap(0,mem_size,
PROT_READ|PROT_WRITE,MAP_SHARED,
mem_desc,address);
if(mapped_ptr==MAP_FAILED) {
close(mem_desc);
throw Exception("cannot map specified Address.\n");
}
}
unsigned long& operator[](unsigned long offset) throw() {
if(offset>mem_size-4) throw Exception("out of range.\n");
return *((unsigned long *)(mapped_ptr+offset));
}
const unsigned long& operator[](unsigned long offset) const throw() {
if(offset>mem_size-4) throw Exception("out of range.\n");
return *((unsigned long *)(mapped_ptr+offset));
}
void sync(void) {
msync(mapped_ptr,mem_size,MS_SYNC);
}
virtual ~MemAccess()
{
msync(mapped_ptr,mem_size,MS_SYNC);
munmap(mapped_ptr,mem_size);
close(mem_desc);
}
};
// the implemention of the above described idea of unlocking
class NVTuner
{
MemAccess NVMem;
public:
NVTuner(unsigned long NVAddress):NVMem(NVAddress,0x10000) {}
unsigned short GetPixelMask(void) const {
return (unsigned short)(NVMem[0x1540]);
}
void SetPixelMask(unsigned short mask) {
NVMem[0xc020]=NVMem[0xc024]=NVMem[0xc028]=NVMem[0x
c02c]=0;
NVMem[0x1540]=0x00010000|mask;
NVMem.sync();
}
};
//the rest of the program concerns about parsing the command
//line and telling the user what's wrong or what to do.
void useage(void) {
cout<<"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!USE AT YOUR OWN RISK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\nUseage: \t\tnvtuner <memory address>\t :returns current pixel mask\n\t\tnvtuner <mask> <memory address> :sets pixel mask\nWhere <memory address> specifies the primary memory address of the graphic card.\nThis address can be obtained through 'cat /proc/pci'.\n\nExample:\tnvtuner 0x3f0f 0xfd000000\nEnables all pixel pipelines and vertex shaders on a graphic card using\n0xfd000000 as memory address.\n\n";
}
int main(int argc,char *argv[])
{
try {
switch(argc) {
case 2:
{
if(!strcmp(argv[1],"-h") || !strcmp(argv[1],"--help")) {
useage();
return 0;
}
unsigned long addr=strtoul(argv[1],0,0);
if(addr&0x00ffffff || addr==0) {
cout<<"I do not trust this memory address\n";
return 0;
}
NVTuner nt(addr);
printf("The current pixel mask is: 0x%.4x\n",nt.GetPixelMask());
}
break;
case 3:
{
if(!strcmp(argv[1],"-h") || !strcmp(argv[1],"--help")) {
useage();
return 0;
}
unsigned short mask=strtoul(argv[1],0,0);
unsigned long addr=strtoul(argv[2],0,0);
if(addr&0x00ffffff || addr==0) {
cout<<"I do not trust this memory address\n";
return 0;
}
NVTuner nt(addr);
printf("Setting pixel mask 0x%.4x\n",mask);
nt.SetPixelMask(mask);
printf("New pixel mask is: 0x%.4x\n",nt.GetPixelMask());
}
break;
default:
useage();
break;
}
}catch(MemAccess::Exception& e) {cout<<e;}
return 0;
}
you can compile it with: "g++ -O -o nvtuner nvtuner.cpp" (if you've put the source code in a file named nvtuner.cpp).
For execution, you first determine the required primary memory address via "cat /proc/pci". Example:
# cat /proc/pci
...
Bus 1, device 0, function 0:
VGA compatible controller: nVidia Corporation NV40 OS1RT00B30 (rev 161).
IRQ 16.
Master Capable. Latency=248. Min Gnt=5.Max Lat=1.
Non-prefetchable 32 bit memory at 0xfd000000 [0xfdffffff].
Prefetchable 32 bit memory at 0xe0000000 [0xe7ffffff].
Non-prefetchable 32 bit memory at 0xfc000000 [0xfcffffff].
...
so you would take 0xfd000000.
Now, as 'root', type:
"./nvtuner 0xfd000000" which would return on my card:
"The current pixel mask is: 0x370b"
Setting a new pixel mask while still in X can result in the same occasional crashes like using 'RivaTuner.exe /wrc020,0 /wrc024,0 /wrc028,0 /wrc02c,0 /wr1540,13f0f /rr1540' in windows. To avoid this:
1) close your X-Session
2) hit CTRL-ALT-F1 (changes to the first console)
3) log in as 'root'
4) type: /etc/init.d/xdm stop
5) type: rmmod nvidia
6) type: /path/to/nvtuner 0x3f0f 0xfd000000
where you have to adjust "/path/to", "0x3f0f" and "0xfd000000"
nvtuner will print out the new pixel mask of the graphic card
7) type: modprobe nvidia
type: /etc/init.d/xdm start
your X-Session should be restarted
In doom3 timedemo demo1 using 1280x1024 high detail 8xAF, i get 57.5 fps instead of 53.3 fps before unlocking (running the timedemo twice and taking the second value), which is an increase of ~8%. Of course this is not a very well suited testcase, for testing if unlocking was sucessful, because it's likely getting influenced by the memory bandwidth, but there's no 3DMark under Linux.
I hope I was understandable and that the source code might still be used. If someone has webspace to put the files in, i could mail them.
Also have in mind: USE AT YOUR OWN RISK!!!!
Processor:
P4 2.4@2.8
Operating System:
Linux Gentoo
Mobo:
P4P800
RAM:
4x256 MB
Video:
Asus 9999 TD
Storage:
Raptor 37GB, Deskstar 120GB
Audio:
Audigy
|
I think i modified something to make it compile, but i dont remember what. Just use g++ <cpp-filename>. U can then run a.out. I just had this piece of code on my harddrive and though than someone will find it usefull, before i loose it. If u dont know how to use it , better leave it, cause i cannot guarantee that this code wont blow up ur computer . It just for people who think they can make something usefull of it, like the guy who wrote nvclock. |
|
| Back to top |
|
 |
Need4Speed Guru


Joined: 06 Jun 2004 Posts: 497
|
Posted: Sat Mar 19, 2005 3:45 pm Post subject: |
|
|
Wow this is awsome! I know know a few people who have been waiting for something like this.
Now I just need to get me a 6800...  |
|
| Back to top |
|
 |
John5788 Advocate


Joined: 06 Apr 2004 Posts: 2083 Location: 127.0.0.1
|
Posted: Sat Mar 19, 2005 4:39 pm Post subject: |
|
|
| Need4Speed wrote: | Wow this is awsome! I know know a few people who have been waiting for something like this.
Now I just need to get me a 6800...  |
get me one too _________________ John5788 |
|
| Back to top |
|
 |
PZoned Guru


Joined: 27 May 2004 Posts: 360 Location: Toronto, Canada
|
Posted: Sat Mar 19, 2005 8:39 pm Post subject: |
|
|
| Need4Speed wrote: | Wow this is awsome! I know know a few people who have been waiting for something like this.
Now I just need to get me a 6800...  |
heh, i already got one, but i am somewhat hesitant to use it just for slightly more fps. (would rather wait to hear a couple success stories first) _________________ Check out my awesome blog! (The Best Blog Ever)
http://derrickbathory.blogspot.com/ |
|
| Back to top |
|
 |
l_bratch Guru

Joined: 08 Feb 2005 Posts: 489 Location: Jersey
|
Posted: Mon Mar 21, 2005 9:03 am Post subject: |
|
|
| I've unlocked my 6800 under Windows - will that unlock my card system-wide? Or just under Windows... |
|
| Back to top |
|
 |
PZoned Guru


Joined: 27 May 2004 Posts: 360 Location: Toronto, Canada
|
Posted: Mon Mar 21, 2005 9:16 pm Post subject: |
|
|
| l_bratch wrote: | | I've unlocked my 6800 under Windows - will that unlock my card system-wide? Or just under Windows... |
just in windows... it is a software mod... _________________ Check out my awesome blog! (The Best Blog Ever)
http://derrickbathory.blogspot.com/ |
|
| Back to top |
|
 |
brian33x51 Tux's lil' helper


Joined: 16 Jun 2002 Posts: 118
|
Posted: Wed Apr 06, 2005 7:37 pm Post subject: |
|
|
I'll see what I can do to try to get this script to work with turning a 6200 into a 6600. I have a leadtek 6200AGP which runs just fine with all pipes unlocked.
I'd also really like to overclock this bad boy too. I tested it stable 450/675 (orig 300/500) |
|
| Back to top |
|
 |
l_bratch Guru

Joined: 08 Feb 2005 Posts: 489 Location: Jersey
|
Posted: Thu Apr 07, 2005 12:47 pm Post subject: |
|
|
| Has anyone tried this on a 6800 yet? |
|
| Back to top |
|
 |
brian33x51 Tux's lil' helper


Joined: 16 Jun 2002 Posts: 118
|
Posted: Thu Apr 07, 2005 8:55 pm Post subject: |
|
|
Running this against my 6200 caused the screen to go crazy and locked the machine.
The mask value that was pulled out by running it in read mode looked correct...
I guess I should have tried writing the same value it already had back into it as a test.
I am running ~amd64... |
|
| Back to top |
|
 |
crazycat l33t


Joined: 26 Aug 2003 Posts: 838 Location: Hamburg, Germany
|
Posted: Fri Apr 08, 2005 2:06 am Post subject: |
|
|
| U have to modify it before driver loads , it means befor loading the module. It's working for me but havent tested it much cause i prefer windoze for gaming. |
|
| Back to top |
|
 |
brian33x51 Tux's lil' helper


Joined: 16 Jun 2002 Posts: 118
|
Posted: Fri Apr 08, 2005 4:36 am Post subject: |
|
|
Are you running this on a 6800 or 6200?
I'll try booting without even loading the module.
Currently what i've been doing is to unload the module, run the script and bork city. |
|
| Back to top |
|
 |
makatee n00b

Joined: 10 Feb 2003 Posts: 18
|
Posted: Fri Apr 08, 2005 5:01 am Post subject: |
|
|
I've tried it and it is successful on my Chaintech 6800 I've been waiting for this to come to Linux ever since I saw rivatuner could do this in Windows |
|
| Back to top |
|
 |
l_bratch Guru

Joined: 08 Feb 2005 Posts: 489 Location: Jersey
|
Posted: Fri Apr 08, 2005 9:33 am Post subject: |
|
|
Great to hear of the success makatee. Did you have to change anything? Or just compile and run it as it was posted?
Also, does it completely reset when you reboot? |
|
| Back to top |
|
 |
makatee n00b

Joined: 10 Feb 2003 Posts: 18
|
Posted: Sat Apr 09, 2005 5:19 pm Post subject: |
|
|
| Sorry for the delayed response. In response to the last post, I didnt have to change anything really. Follow the directions and make sure you locate YOUR OWN memory address ( it is required for changing the masked hardware ) Also, it does reset upon rebooting because its not like its a permanent unlocking. I just have it automatically running before my nvidia module is loaded upon booting the system because it works so well. |
|
| Back to top |
|
 |
l_bratch Guru

Joined: 08 Feb 2005 Posts: 489 Location: Jersey
|
Posted: Sat Apr 09, 2005 10:18 pm Post subject: |
|
|
| makatee wrote: | | make sure you locate YOUR OWN memory address |
could you explain how to do this? |
|
| Back to top |
|
 |
crazycat l33t


Joined: 26 Aug 2003 Posts: 838 Location: Hamburg, Germany
|
Posted: Sun Apr 10, 2005 1:57 am Post subject: |
|
|
| When u run the program it tells u how to do it, with a bit luch and and patience u can find it in the source code. |
|
| Back to top |
|
 |
equilibrium Apprentice


Joined: 29 Jun 2003 Posts: 213 Location: UK
|
Posted: Mon Apr 11, 2005 4:09 pm Post subject: |
|
|
ah nice
I edited my BIOS to unlock the pipes on my 6800le so no need to run any programs or anything and i have full 16pipes and 5vertex running in linux  _________________ kernel 3.2.2-1 | openbox | github |
|
| Back to top |
|
 |
l_bratch Guru

Joined: 08 Feb 2005 Posts: 489 Location: Jersey
|
Posted: Mon Apr 11, 2005 8:05 pm Post subject: |
|
|
What did you use to edit the pipelines in the bios?
My bios editor only let me access clock speed and voltage. |
|
| Back to top |
|
 |
brian33x51 Tux's lil' helper


Joined: 16 Jun 2002 Posts: 118
|
Posted: Thu Apr 14, 2005 10:48 pm Post subject: |
|
|
| l_bratch wrote: | What did you use to edit the pipelines in the bios?
My bios editor only let me access clock speed and voltage. |
what is "your" bios editor?? you mean nibitor or something??
Perhaps this weekend or maybe even tonight (after I do my taxes)
I'll play around with trying to get this to work with unlocking the extra 4 pipes on my 6200.
I know it works in rivatuner, I just wish I understood the rhyme and reason for getting this program to work properly with the 6200. I hope running x86_64 instructions isn't borking this. |
|
| Back to top |
|
 |
brian33x51 Tux's lil' helper


Joined: 16 Jun 2002 Posts: 118
|
Posted: Fri Apr 15, 2005 12:21 am Post subject: |
|
|
Okay I got it.
I had to make some modifications to the above application but now it should work for unlocking pipes for both the 6200 and 6800 series.
Basically I changed it so the whole 32bit register value must be entered instead of just the lower 16 bits.
Values for insertion
The source file is here:
https://home.comcast.net/~bnolsen/nvtuner.cc
g++ -o nvtuner nvtuner.cc -lstdc++
The help has an example for opening pipes on a 6800 and for a 6200.
UT2004 numbers:
4 pipes:
6.167242 / 45.826614 / 77.194061 fps -- Score = 22.919052 rand[335137429]
6.237888 / 45.869602 / 78.992912 fps -- Score = 22.940914 rand[335137429]
8 pipes:
10.426701 / 63.173237 / 81.102638 fps -- Score = 31.590927 rand[335137429]
9.946456 / 63.274609 / 80.736824 fps -- Score = 31.641628 rand[335137429]
As always use at your own risk!! |
|
| Back to top |
|
 |
Aynjell Veteran


Joined: 28 Jun 2004 Posts: 1117
|
Posted: Fri Apr 15, 2005 6:10 am Post subject: |
|
|
This is a farely safe process. Unlock it, reload the driver and if you see artifacts turn it off. All it does is change some driver settings, and as soon as you uninstall those drivers those settings vanish.
I van unlock the extra vertex shader on mine, but the other 4 pipes are kaput. Well, at least in windows they are. Pretty much, I've only seen direct 3D apps artifact with it, and I decided to not use it anyway, because the difference in performance was negligible if not detrimental.
So, I unlock my shader and call it good. _________________ CPU: 3800+ X2 (2.5Ghz)
GPU: eVGA 7600GT (640/1700)
MOBO: DFI SLI-DR (Surprisingly good!)
RAM: 2 x OCZ Gold 1024 DDR500 3-4-3-7 (2048)
HDD: Western Digital Raptor |
|
| Back to top |
|
 |
jzono1 Tux's lil' helper

Joined: 01 Feb 2004 Posts: 128
|
Posted: Sat Apr 16, 2005 2:02 pm Post subject: |
|
|
Any point eith a 5950U?
might do it with my brothers 6600gt tho |
|
| Back to top |
|
 |
brian33x51 Tux's lil' helper


Joined: 16 Jun 2002 Posts: 118
|
Posted: Mon Apr 18, 2005 5:06 am Post subject: |
|
|
| jzono1 wrote: | Any point eith a 5950U?
might do it with my brothers 6600gt tho |
I'm confused, you cant ry to OC a 5950u, it pushes the heat a bit since it's already pretty well clocked.
Best bet would be to get a 5900xt and reflash to a 5950u (I did that with my last card).
The 6600gt can probably be overclocked a bit, but not to the amount that a 6200 or 6600 can be clocked since they all share the same core and the 6200/6600 start out much much lower.
nvclock is about all you can use on either of the above cards. |
|
| Back to top |
|
 |
|