# Nvidia-kernel

## MrIch

plinux011 tmp # cat /proc/driver/nvidia/agp/status 

Status:          Enabled        

Driver:          AGPGART        

AGP Rate:        4x             

Fast Writes:     Disabled       

SBA:             Disabled    

How do I activate Fast Writes and SBA in the nvidia-kernel ebuild?

thx...

----------

## kirill

 *MrIch wrote:*   

> plinux011 tmp # cat /proc/driver/nvidia/agp/status 
> 
> Status:          Enabled        
> 
> Driver:          AGPGART        
> ...

 

Do you even know what they stand for?  :Wink: 

Check /proc/driver/nvidia/host-bridge and /proc/driver/nvidia/card if they support such stuff

----------

## MrIch

yes I really now!  :Wink: 

When I download the drivers from nvidia and edit one .h file of the driver and then compile ist, SBA and FBA is supportet and activated!!!

My question was, is it possible to edit the .h file before emerge begin the compile process?

----------

## pdouble

 *MrIch wrote:*   

> yes I really now! 
> 
> When I download the drivers from nvidia and edit one .h file of the driver and then compile ist, SBA and FBA is supportet and activated!!!
> 
> My question was, is it possible to edit the .h file before emerge begin the compile process?

 

What file did you edit? You can create an overlayed ebuild and a patch to do this. If it works with my nvidia, I'll create an ebuild and post it. Did the /proc/driver/nvidia/agp/card show that it supported these features before you changed the driver?

----------

## kirill

 *MrIch wrote:*   

> yes I really now! 
> 
> When I download the drivers from nvidia and edit one .h file of the driver and then compile ist, SBA and FBA is supportet and activated!!!
> 
> My question was, is it possible to edit the .h file before emerge begin the compile process?

 

yeah that's covered in the Gentoo FAQ. Read under I want to perform the ./configure step myself. Can I? -topic.

----------

## MrIch

 *pdouble wrote:*   

>  Did the /proc/driver/nvidia/agp/card show that it supported these features before you changed the driver?

 

Before I modified the Driver it showed both NOT supported, when I changed it, both were supported!

----------

## pdouble

 *MrIch wrote:*   

>  *pdouble wrote:*    Did the /proc/driver/nvidia/agp/card show that it supported these features before you changed the driver? 
> 
> Before I modified the Driver it showed both NOT supported, when I changed it, both were supported!

 

So what modifications did you make? I would like to make the same and get the most out of this card  :Smile: 

----------

## MrIch

oh, sorry it was not a .h file the file is named os-registry.c

line 224:

/*

 * The default on x86 is to disable AGP side band addressing; if you want

 * to turn it on, change the registry key below.

 */

static int NVreg_EnableAGPSBA = 0;

#***** by MrIch , this value must be set to 1! ******#

line 245:

 * This is completely unsupported!

 *

 * Possible Values:

 *

 *  0 = disable Fast Writes (default)

 *  1 = enable  Fast Writes

 *

 * This option is disabled by default, see below for information on how

 * to enable it.

 */

static int NVreg_EnableAGPFW = 0;

#***** by MrIch,  this value must be set to 1 too! ******#

can someone of the gentoo team make an alternative nvdriver ebuild, for example an masekd nvidia-kernel-tuned?

thank you!

----------

## pdouble

From the code in os-registry.c, it looks like these options are module parameters, with the defaults being set to off. I'm not really fluent in kernel programming, can someone explain how to determine the module parameter name for a statement like:

```

MODULE_PARM(NVreg_EnableAGPFW, "i");

```

I will post and/or research more of the source code if requested. Possibly I will figure it out before an answer is posted too  :Smile: 

----------

## MrIch

Now I downloaded the Nvidia driver and I have modified and build them. After one reboot I could see that:

sh-2.05a$ cat /proc/driver/nvidia/agp/card

Fast Writes:     Not Supported

SBA:             Supported

AGP Rates:       4x 2x 1x

Registers:       0x1f000207:0x1f000304

sh-2.05a$ cat /proc/driver/nvidia/agp/status

Status:          Enabled

Driver:          AGPGART

AGP Rate:        4x

Fast Writes:     Disabled

SBA:             Enabled

Fast Writes is still disabled, but I think this is not a driver problem! My bios dactivate Fast Writes I think!

----------

## pdouble

 *pdouble wrote:*   

> From the code in os-registry.c, it looks like these options are module parameters, with the defaults being set to off. I'm not really fluent in kernel programming, can someone explain how to determine the module parameter name for a statement like:
> 
> ```
> 
> MODULE_PARM(NVreg_EnableAGPFW, "i");
> ...

 

Argh, posted too fast. According to the beginning of the file, the module parameter names are made from the "NVreg_NAME" variables. Just remove the "NVreg_" and that's the module parameter. I can't test right now, but will today and post my results. So, it should work like so:

```

modprobe NVdriver EnableAGPSBA=1 EnableAGPFW=1

```

----------

## pdouble

I believe I've found a way to enable the SBA and Fast Write support without changing the driver source. If you run:

```

modinfo -p /lib/modules/2.4.19-gentoo-r7/video/NVdriver

```

you'll get a list of available module parameters. To enable said options:

```

modprobe NVdriver NVreg_EnableAGPSBA=1 NVreg_EnableAGPFW=1

```

I tried this and it took it, but nothing changed for me. I have a laptop and prehaps the hardware doesn't support this. I made the change in the source code as you did and still no change, so I think my hardware doesn't support it. For the benefit of others, could some one could try this and see if it works?

----------

## kirill

 *pdouble wrote:*   

> To enable said options:
> 
> ```
> 
> modprobe NVdriver NVreg_EnableAGPSBA=1 NVreg_EnableAGPFW=1
> ...

 

Hi.

I just made some experiments with my system using the following settings:

```
1. modprobe NVdriver NVreg_EnableAGPSBA=1 NVreg_EnableAGPFW=1

2. modprobe NVdriver NVreg_EnableAGPSBA=1

3. modprobe NVdriver NVreg_EnableAGPFW=1
```

The system hanged on X-server startup with variants 1 and 2. I suspect it has something to do with my video card since it doesn't support neither SBA nor Fast Writes  :Razz:  while my motherboard's chipset (Intel 440BX) supports SBA.

All that with the AGPGART implementation. I didn't bother to test with Nvidia's own NvAgp since my hardware doesn't support SBA or FW anyways. But you may want to.

NOTE: With NVdriver you need to reboot each time you change some module parameters!

----------

## TuxFriend

 *kirill wrote:*   

> NOTE: With NVdriver you need to reboot each time you change some module parameters!

 

Why is that?, isn't unloading and reloading the module sufficient?

TuxFriend

----------

## kirill

 *TuxFriend wrote:*   

>  *kirill wrote:*   NOTE: With NVdriver you need to reboot each time you change some module parameters! 
> 
> Why is that?, isn't unloading and reloading the module sufficient?

 

Yeah one could think reloading is enough, but it's not. That is mentioned in the nVidia Linux Driver Troubleshooting Guide:

 *Quote:*   

> Bear in mind that switching AGP drivers or disabling them usually requires a system reboot before the changes really take effect. loading different AGP drivers w/o a reboot may cause lockups or general system instability.

 

I also read somewhere that you'd better to reboot after unloading and reloading the NVdriver, since it may cause some instability.

----------

## MrIch

so with this information, I think there is no need for a new "tuned" nvidia ebuild, I did not know the module options for the NVdriver!

----------

## pdouble

I tried rebooting and using the module parameters and not go. Probably my card doesn't support SBA or FW, although the chipset does. Alas, I will stick with 600 FPS (benchmark from glxgears). Not too bad though, I get 40 FPS from armagetron in 1024x768 windowed mode. I have a Dell Inspiron 8200, if someone knows something contrary to what I've found, i.e. it DOES support SBA and/or FW, please let me know and I'll try harder  :Smile: 

----------

## phlashback

Setting up the Nvidia kernel module is not realy that difficult, I spent so much time on it, that when I figured it out, I felt like a complete idiot. :Embarassed: 

First, Check to see that your card and board both support it, and that it is not already enabled

```

phishhead stash# cat/proc/driver/nvidia/agp/host-bridge

Host Bridge:   AMD 760MP

Fast Writes:   Supported

SBA:         Supported

AGP Rates:      4x 2x 1x

Registers:      0x0f000217:0x00000314

phishhead stash# cat/proc/driver/nvidia/agp/card

Fast Writes:   Supported

SBA:         Supported

AGP Rates:      4x 2x 1x

Registers:      0x1f000217:0x0f000314

phishhead stash# cat/proc/driver/nvidia/agp/status

Status:      Enabled

Driver:      NVIDIA

AGP Rate:      4x

Fast Writes:   Disabled

SBA:         Disabled

```

If the card or board does not support SBA and/or Fast Writes, do not try to enable it, it should not work.

Now we have determined that SBA and or Fast Writes are Supported (on my board and card, yours may vary). This next part is important. I had first tried setting the Nvidia driver up in

 /etc/modules.autoload

Don't bother, because the driver module is already loaded without options, and will not accecpet new options (in my experience).

To display a list of modules paramaters:

```
phishhead stash#modinfo -p /lib/modules/{your kernel version}/video/NVdriver
```

Trick:

```
phishhead stash# nano -w /etc/modules.d/nvidia
```

The edited files should look like this(in my system):

```
alias char-major-195 NVdriver

        options NVdriver NVreg_EnableAGPSBA=1 NVreg_EnableAGPFW=1
```

finaly:

```
phishhead stash# update-modules nvidia
```

After all that it is importaint to  :Exclamation: REBOOT :Exclamation: 

Upon rebooting:

 :Razz: 

```
phishhead stash# cat /proc/driver/nvidia/agp/status

Status:      Enabled

Driver:      NVIDIA

AGP Rate:      4x

Fast Writes:   Enabled

SBA:         Enabled

```

Warning...

This works on my sytem, but you may or may not have trouble, so be warned that you may need to change these options if you notice stability problems

I hope this helps.

----------

## de4d

any1 knows if gforce2MX cards should support FW or SBA?

i dont find this information on the nvidia page... and i dont get this to work...

thanx

----------

## MrIch

yes, geforce mx soulhd supports both, but it is more important that, your mainboard support these features too!

----------

## de4d

it does (if this definitely indicates that)

```

bnws04:/home/de4d# cat /proc/driver/nvidia/agp/host-bridge

Host Bridge:     Via Apollo Pro KT266

Fast Writes:     Supported

SBA:             Supported

AGP Rates:       4x 2x 1x

Registers:       0x1f000217:0x00000104

```

now its up to me to find out whats wrong *gnarf*

tnx tho

----------

## de4d

ok. gave up.

if someone happens to own an abit kr7a or kr7a-raid and gforce2mx (if this actually matters) please lemme know if it (SBA & FW) works for u, if u want to be asked some silly questions about your system configuration ^^

----------

## phlashback

Are you sure that you have the NVIDIA as your agp driver?

cat /proc/driver/nvidia/agp/host-bridge

Status should be enabled, and Driver should be NVIDIA, if either are not then the modules wont matter.

also,

cat /proc/driver/nvidia/card

Status must be Supported on the lines for Fast Writes, and SBA

also be sure that you put the "options" line from above post into the /etc/modules.d/nvidia

also

run "update-modules nvidia"

finly reboot.

I remember reading in the documentation from Nvidia that thier were issues with some via chipsets. also somewhere else in the documentation I remember reading that the driver may choose to disable some options in favor of system stability. 

Just a hunch, but you may want to investigat.

Good luck. 

Soory if above is redundent, it's my bro's birthday, and we just cashed the second keg  :Embarassed: 

----------

## de4d

 *phlashback wrote:*   

> 
> 
> cat /proc/driver/nvidia/agp/host-bridge
> 
> 

 

posted above -> "supported"

 *Quote:*   

> 
> 
> cat /proc/driver/nvidia/card
> 
> Status must be Supported on the lines for Fast Writes, and SBA
> ...

 

this is my problem ... its not supported even after modprobe with these options ...

 *Quote:*   

> 
> 
> also be sure that you put the "options" line from above post into the /etc/modules.d/nvidia
> 
> run "update-modules nvidia"
> ...

 

done - its successfully included in /etc/modules.conf

 *Quote:*   

> 
> 
> I remember reading in the documentation from Nvidia that thier were issues with some via chipsets. also somewhere else in the documentation I remember reading that the driver may choose to disable some options in favor of system stability. 
> 
> Just a hunch, but you may want to investigat.
> ...

 

the readme file from nvidia says, agp4x is disabled on some via chipsets

i dont think this is my problem, cuz i got some other via chipset and 4x works fine (even without Enable_NVagpVia4x_whatever it defaults to 4x)

to be quite sure to do nothing wrong i did this after reboot (shortened):

```

# lsmod

-> NVdriver _not_ loaded b4

# modprobe NVdriver FW=1 SBA=1

-> loads mod

# cat /pathto/host

-> everything fine

# cat /pathto/card

-> 2x "not sup"

# cat /pathto/status

-> disabled (as to expect...)

```

i hope this way i could exclude having done something wrong about those /etc/module stuff.

...and i hope anyone can prove me wrong :D

----------

## phlashback

de4d...

please post your /etc/modules.d/nvidia file.

also, after closer reading of your post I realized that /proc/{you know wher I am Going}/card states that Fast Writes and SBA are not supported.

In your bios do you have an option to enable/disable Fast Writes ... I would start there (your bios may be disabling the ability on the chipset)... That is the only thing I can think of that would change the supported status.

Chances are if your bios is configured right (currently), then your card just dows not support Fast Writes and/or SBA, and if that is the case, I do not belive that any amount of module tweaking will change that.. (you can't enable circitry that does not exist).

Just as a reference, when I started both my host-bridge and card displayed Supported. If you didn't start with that, I belive that you may be SOL.

On my Tiger 2460 w/ only 1 AMD Athlon MP 1900+

w/ Gforce-4Ti4600, my glxgears only increased 50 fps (total 4437.200 avg FPS) Translated: no noticible gain in performance.

Once again I wish you the best of luck... agh who am i kidding luck has nothin to do with it, it is either supported or not, and if supported, I am sure you'll get it working.  :Wink: 

----------

## de4d

this is my /etc/modules.d/nvidia

same as phlashback posted btw.

```

alias char-major-195 NVdriver

   options NVdriver NVreg_EnableAGPSBA=1 NVreg_EnableAGPFW=1

```

my chipset does support FW/SBA

after enabling it (which was the first thing i did), cat /path/to/host-... displayed "supported"

 *Quote:*   

> 
> 
> then your card just dows not support Fast Writes and/or SBA, and if that is the case, I do not belive that any amount of module tweaking will change that.

 

it really seems to me like it doesnt (tho its a gf2mx400...)

ill try another one when ive got the time, or put it into another m/b.

 *Quote:*   

> 
> 
> no noticible gain in performance. 
> 
> 

 

for now, i just hope so ;)

tanx anyway

----------

## phlashback

If you can, try it in a system that already works with thoes options enabled, then you know for sure.

I hope I have been some help.

good luck..

----------

