Hardware OpenGL with TNT2

Hardware OpenGL with TNT2

Post by David Findla » Wed, 02 Aug 2000 04:00:00



I am using Xfree86 4.00. I have downloaded nvidia's drivers and installed
them. However the nvidia driver seems to be much slower than the default nv
driver that comes which comes with XFree86 4. Window scrolling has become
heaps slower. Also some OpenGL tests don't work and it seems to be using
software rendering not hardware.

Has anyone had similar problems? How do I get hardware rendering to work?

David Findlay

 
 
 

Hardware OpenGL with TNT2

Post by Art Boulato » Wed, 02 Aug 2000 04:00:00



> I am using Xfree86 4.00. I have downloaded nvidia's drivers and installed
> them. However the nvidia driver seems to be much slower than the default nv
> driver that comes which comes with XFree86 4. Window scrolling has become
> heaps slower. Also some OpenGL tests don't work and it seems to be using
> software rendering not hardware.

> Has anyone had similar problems? How do I get hardware rendering to work?

Not really. I have Asus AGP-V3800 Pro/TV and XFree86-4.0.1.
Everything is fine.
Didn't see any difference in 2D with XFree default and NVIDIA provided
driver.
3D is pretty decent for now, got 7 fps less with Q3 in compare to
windows/NVIDIA.
Unfortunately can't get mouse working under Q2 (actually it just don't
want
to leave window manager and go inside the window, and it doesn't support
fullscreen
in OpenGL).

Don't know what to say. Could you check if you've configured everything
properly...

Goodluck,
Art.

P.S. I was wondering if anybody have written yet a simple prog
to overclock engine/memory on TNT2 (like PowerStrip does),
since NVIDIA driver does not support that feature (WHY NOT? XF86Config
is a good place to enter those values into).

My card is just going forward into it, so I get
a remarkable fps increase under windows.
Would be great to be able to do the same under X.

Quote:

> David Findlay


 
 
 

Hardware OpenGL with TNT2

Post by Manuel Jander Janse » Wed, 02 Aug 2000 04:00:00


Hi,



>> I am using Xfree86 4.00. I have downloaded nvidia's drivers and
>> installed them. However the nvidia driver seems to be much slower than
>> the default nv driver that comes which comes with XFree86 4. Window
>> scrolling has become heaps slower. Also some OpenGL tests don't work
>> and it seems to be using software rendering not hardware.

>> Has anyone had similar problems? How do I get hardware rendering to
>> work?

Go though the NVidia howto. Following it step by step you should not fail.

Quote:

> Not really. I have Asus AGP-V3800 Pro/TV and XFree86-4.0.1. Everything
> is fine. Didn't see any difference in 2D with XFree default and NVIDIA
> provided driver.
> 3D is pretty decent for now, got 7 fps less with Q3 in compare to
> windows/NVIDIA. Unfortunately can't get mouse working under Q2 (actually
> it just don't want to leave window manager and go inside the window, and
> it doesn't support fullscreen in OpenGL).

I did some trick with xset. You can use a special  XF86Config called
XF86Config.quake2  file that is configured for 640x480 for example
(quake2 res) and load it with a script that executes

xinit -x86config /etc/X11/XF86Config.quake2 -- runquake2
(this may be wrong. Dont remeber well, look at xinits man page)
and runquake2 does something like this:

xset --cursor nul.xbm nul.xbm
quake2

where nul.xbm is a blank bitmap, causing the ugly X cursor to disapear (transparent).

Please check xinit and xset manpages, because i dont remember well the command line.
 I hop you got the idea.

Quote:> Don't know what to say. Could you check if you've configured everything
> properly...

> Goodluck, Art.

> P.S. I was wondering if anybody have written yet a simple prog to
> overclock engine/memory on TNT2 (like PowerStrip does), since NVIDIA
> driver does not support that feature (WHY NOT? XF86Config is a good
> place to enter those values into).

> My card is just going forward into it, so I get a remarkable fps
> increase under windows. Would be great to be able to do the same under
> X.

>> David Findlay

 
 
 

Hardware OpenGL with TNT2

Post by herman dumon » Wed, 02 Aug 2000 04:00:00


Art Boulatov wrote:

> David Findlay wrote:
> P.S. I was wondering if anybody have written yet a simple prog
> to overclock engine/memory on TNT2 (like PowerStrip does),
> since NVIDIA driver does not support that feature (WHY NOT? XF86Config
> is a good place to enter those values into).

> My card is just going forward into it, so I get
> a remarkable fps increase under windows.
> Would be great to be able to do the same under X.

> > David Findlay

Hi,

here is a program from the linux-nvidia mailinglist.
It works fine for me.
I take NO - repeat NO - responsability for it.
Edit it and adjust the frequencies ( don't exagerate ! ) in the file.
Compile it.

HTH

[ nvoverclock.c 6K ]
/*  ----------------------------------------------------------------------
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TNT clock

  ----------------------------------------------------------------------

   * To: linux-nvi...@lists.surfsouth.com
   * Subject: Re: TNT clock
   * From: Matan Ziv-Av <ma...@svgalib.org>
   * Date: Tue, 29 Feb 2000 13:41:50 +0200 (IST)
   * Delivered-At-Relayer-To: <linux-nvi...@lists.surfsouth.com>
   * In-Reply-To: <Pine.LNX.4.10.10002261252520.859-100...@matan.home>
   * Reply-To: Matan Ziv-Av <ma...@svgalib.org>
   * Sender: owner-linux-nvi...@mail-overflow.surfsouth.com

  ----------------------------------------------------------------------

OK, Thanks to all who replied.

If anyone still wants to run the program, it needs to be run as root
(which I forgot to say).

First, the problem I had is related to an undocumented bit in one
register. In order to read (or write) the NVPLL, bit 10 of the COEFF
SELECT register needs to be set. It is done by X, so everyone who runs
the program from X gets the right values.
I added a line to the program to set this bit, and the program now reads
125/150MHz, as it should. There seem to be also 125/143 and 150/183
standards (the later is called ultra). The TNT seems to be run at
90/110, and a GeForce DDR, chipset at 120MHz and memory at 300MHz.

Daniel Koukola reports that overclocking the memory clock (MPLL) helps
for using higher character clocks with SVGATextMode.
In my test, I changed the memory clock from 150MHz to 163MHz, and the 3D
performance increased by the same amount (I only tested the mesa demo
gears).

If you want to try the attached program to overclock, I suggest the
following:
Run it in a text console (not xterm).
Make sure you have vga_reset (from a recent svgalib) installed, and that
you know how to run it blindly. It will save a reboot if the program
messes up too much.

The program needs to be run as root. Change the clock values in the
program before compiling. If you use kernel 2.0, or proc fs is not
mounted, or the program does not find the card for any reason, change
the if(pci... and base=... lines to base=0xab000000, where the ab value
is the first pci aperture of the nvidia card.

--
Matan Ziv-Av.                         ma...@svgalib.org*/

#include <unistd.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

static int ClockSelect(int clockIn,int *clockOut,int *mOut,
                                        int *nOut,int *pOut);
static int base_freq;

static int pci_read_config(unsigned char bus, unsigned char device,
        unsigned char fn, unsigned long *buf, int size)
{
   int f,i;
   char filename[256];

   sprintf(filename,"/proc/bus/pci/%02i/%02x.%i",bus,device,fn);
   f=open(filename,O_RDONLY);
   if(read(f,buf,4*size)<1)for(i=0;i<63;i++)buf[i]=-1;
   close(f);
   return 0;

};

int pci_find_vendor_vga(unsigned int vendor, unsigned long *conf)
{ unsigned long buf[64];
  int bus,device=0;

  for(bus=0;bus<16;bus++)
    for(device=0;device<32;device++){
      pci_read_config(bus,device,0,buf,3);
      if(((buf[0]&0xffff)==vendor)&&
        (((buf[2]>>16)&0xffff)==0x0300)) { /* VGA Class */
                pci_read_config(bus,device,0,buf,64);
                memcpy(conf,buf,256);
                return 0;
       };
    }

  return -1;

}

int main(int argc, char *argv[])
{
        int i;
        int f;
        void *c, *d, *e;
        unsigned char *p, *q;
        unsigned long *l;
        unsigned long base;
        unsigned long buf[64];
        int mm,nn,pp;
        int newNVPLL, newMPLL, newNVclock, newMEMclock;

        if(pci_find_vendor_vga(0x10de,buf))exit(1);

        base=buf[4]&0xffffff00;
/* eerst kijken of de commandolijn options goed zijn */
  if (argc < 2)
    {
      printf ("Usage %s : Verify Set\n",argv[0]  );
      exit (1);
    }

        f=open("/dev/mem",O_RDWR);

/* c is fro the clocks, d for PEXTDEV, and e for the crtc */
        c=mmap(0,4096,PROT_READ|PROT_WRITE,MAP_SHARED,f,base + 0x680000);
        p=(unsigned char *)c;

        d=mmap(0,4096,PROT_READ,MAP_SHARED,f,base + 0x101000);
        l=(unsigned long *)d;

        e=mmap(0,4096,PROT_READ|PROT_WRITE,MAP_SHARED,f,base + 0x601000);
        q=(unsigned char *)c;

 /* enable the programable NVPLL and MPLL */
        *(unsigned long *)(p+0x50c)|=0x0000500;

/* Unlock the extended vga features (I'm not sure if it is necessary) */
        *(q+0x3d4)=0x1f;
        *(q+0x3d5)=0x57;

/* find out the reference frequency */
        base_freq= (*l&0x40) ? 14318 : 13500;

       printf("old Memory clock=  %i \n",
               ((unsigned int)base_freq * *(p+0x505) / *(p+0x504))>>*(p+0x506));
       printf("old Core   clock=  %i \n",
               ((unsigned int)base_freq * *(p+0x501) / *(p+0x500))>>*(p+0x502));

/* HERE the new clocks are selected (in KHz). */

if (strstr(argv[1],"S"))
{
/* adjust here don't exagerate and have vga_reset at hand*/
       ClockSelect(166000,&newMEMclock,&mm,&nn,&pp);
        newMPLL=(pp<<16)+(nn<<8)+mm;
/*adjust here don't exagerate and have vga_reset at hand */
        ClockSelect(176000,&newNVclock,&mm,&nn,&pp);
        newNVPLL=(pp<<16)+(nn<<8)+mm;

/*printf("newMPLL=%08x newMEMclock=%i\n",newMPLL,newMEMclock);
printf("newNVPLL=%08x newNVclock=%i\n\n",newNVPLL,newNVclock);*/

         *(long *)(p+0x500)=newNVPLL;
        *(long *)(p+0x504)=newMPLL;

       printf("new Memory clock=  %i \n",
               ((unsigned int)base_freq * *(p+0x505) / *(p+0x504))>>*(p+0x506));
       printf("new Core   clock=  %i \n",
               ((unsigned int)base_freq * *(p+0x501) / *(p+0x500))>>*(p+0x502));

}
};

static int ClockSelect(int clockIn,int *clockOut,int *mOut,
                                        int *nOut,int *pOut)
{
  int m,n,p;
  int c,t,d;
  int bestn,bestm,bestdiff;

  bestn=0;
  bestdiff=clockIn;

  p=0;
  while(clockIn<128000) {
        p++;
        clockIn*=2;
  }

  for(m=8;m<=13;m++) {
      c=clockIn*m;
      t=(c+(base_freq>>1))/base_freq;
      d=c-(t*base_freq);
      if(d<0)d=-d;
      d=d/m;
      if(d<bestdiff) {
          bestn=t;
          bestm=m;
          bestdiff=d;
      }
  }

  *mOut=bestm;*nOut=bestn;*pOut=p;
  *clockOut=(base_freq*bestn/bestm)>>p;

  if (bestdiff<1000) return 1; else return 0;

}