Switch to Linear ModeSwitch to Hybrid ModeSwitch to Threaded Mode
Printer Friendly View | Email this page | Register Now to enjoy user benefits!
Raddy
Raddy's Avatar
Registered User
Join Date: Jun 2003
Posts: 391
Trade rep: 100%
Thanked 1 Times in 1 Post
Unlocking ur 6800 pipes on linux Raddy Oct 28th, 05, 11:37 PM #1 (permalink)
Bought a 6800LE a while ago, while there's no rivatuner for linux with some googling i managed to find the info on how to unlock the extra pipes off some forums. More reason to start gaming on linux. ;)

To get nvtuner save the following text to a file named nvtuner.cc and enter the following command:
Type: g++ -o nvtuner nvtuner.cc -lstdc++

Quote:
#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;
}

Type: lspci -v
Look for ur vid card info at the line indicated by the arrow below, eg.
Quote:
0000:01:00.0 VGA compatible controller: nVidia Corporation: Unknown device 0042 (rev a1) (prog-if 00 [VGA])
Subsystem: LeadTek Research Inc.: Unknown device 299b
Flags: bus master, 66MHz, medium devsel, latency 248, IRQ 16
-> Memory at fd000000 (32-bit, non-prefetchable) [size=16M]
Memory at e0000000 (32-bit, prefetchable) [size=128M]
Memory at fc000000 (32-bit, non-prefetchable) [size=16M]
Using fd000000,
Type: ./nvtuner 0xfd000000
will return u ur current pixel mask, eg. 0x3f0b

Steps
1. Press: CTRL-ALT-BACKSPACE to end ur current X session
2. Press: CTRL-ALT-F1 to use another screen
3. Either login as root or use sudo for the following commands
4. Type: /etc/init.d/xdm stop (or kdm, to kill ur login manager session)
5. Type: rmmod nvidia
6. Type: /path/to/nvtuner 0x3f0b 0xfd000000
change 0x3f0b to ur desired pixel mask (FYI 0x3f0b is 12x1,6vp)
change fd000000 to the value u found with lspci
7. Type: modprobe nvidia
8. Type: /etc/init.d/xdm start

To get the pixel mask values, it's fastest to use rivatuner in windows and jot down all the possible combinations.
eg. 0x1f0a -> 8x1, 5vp
0x1f0b -> 12x1, 5vp
0x3f0b -> 12x1, 6vp, etcetc
With the values, u can go back to linux and do the 8 steps above which is going to be way faster than windows since u only need to restart X as compared to restarting windows.

To make it run on startup check with ur distro, (k)ubuntu or possibly most debian based distros can do the following:
1. Save the following to a script in /etc/init.d/ (eg. nvidia-unlock.sh). Change the pixel mask values to urs of course
Quote:
rmmod nvidia
/path/to/nvtuner 0x3f0b 0xfd000000
modprobe nvidia
2. Type: update-rc.d nvidia-unlock.sh defaults

Works for me but use at ur own risk of course.
 
Last edited by Raddy; Oct 29th, 05 at 01:29 PM..
maxdy
maxdy's Avatar
AMD/Intel Mobile Doggy
Join Date: Sep 2003
Location: Woodlands
Posts: 19,202
Trade rep: 89%
maxdy Oct 28th, 05, 11:44 PM #2 (permalink)
damn good info for linux. thanks for ur feed. very very good info.
Gaming Rig:

Intel Core 2 Duo E6550 | DFI LanParty UT P35-T2R | G-Skill DDR2-1000 2GB x 2 | XFX 9600GT | Acbel 550W LCD | LG DVD+RW 20X | Hitachi 80GB SATA2 x2 | Hitachi 160Gb SATA2 | Hitachi 320Gb SATA2 | WD 500GB SATA2 |

Laptop:

Compaq Presario V2421AU | Self-added to include: AMD Turion64 MT-34 | HP BroadCom Mini-PCI Wireless Card | Hitachi 80GB 5400rpm 2.5" IDE | Another piece of DDR333 512MB

Thermaltake LANbox
If you want one, please PM me for quotations

DeviantArt: http://maxdy.deviantart.com
 
proyb2 Veni, vidi, vici
Join Date: Jun 2005
Posts: 11,612
Trade rep: 50%
proyb2 Oct 29th, 05, 01:14 AM #3 (permalink)
it an amazing to discover what Linux can unlock too! Great job man...

if only i could sell 9800Pro 256bit agp and get the same as yours too!

so how many did u manage to unlock?
Veni, vidi, vici "I came, I saw, I conquered."

A lot of people are afraid of heights. Not me. I'm afraid of widths.
 
Last edited by proyb2; Oct 29th, 05 at 01:18 AM..
Raddy
Raddy's Avatar
Registered User
Join Date: Jun 2003
Posts: 391
Trade rep: 100%
Thanked 1 Times in 1 Post
Raddy Oct 29th, 05, 01:28 PM #4 (permalink)
Yea man, dunno who wrote that source code but he's amazing. I only managed to unlock 12x1, 6vp.. the other 4 pipes are crapped.. i think if u get a 6800NU the chances of getting 16x1 is higher. Anyway i've been playing UT2k4 and Quake 4, fps just as good as windows, but better cos loading times for apps in linux seems a little faster.. if only more game developers make linux clients for their games like them..
 
catacomb
catacomb's Avatar
Registered User
Join Date: Sep 2004
Posts: 17,768
Trade rep: 100%
catacomb Nov 1st, 05, 03:42 AM #5 (permalink)
benches?
 
Thread Tools Display Modes
Linear Mode Linear Mode
Find the best hotel rates here:
Destination:

City:

Check in Date:


Nights:
Rooms:
Adult(s):
Children:
travel.vr-zone.com
OCZ Fan Club!
OCZ Fan Club 21 OCZ Fans!
Win Visa GiftCard
Win Visa Gift Card