# Disable AGPGART and use NVAGP

## alexcorn

I am running Gentoo AMD64 on a Tyan S2885 with a Quadro FX 500 AGP card. I want to use NVAGP in place of AGPGART. Using NVAGP in SuSE made a huge difference in performance. However, in Suse AGPGART was modularized; in Gentoo, it is compiled in statically. In menuconfig, there is no option to change the way AGPGART is included. It is compiled in statically no matter what I do. I tried running Gentoo x86, and was able to disable AGPGART. That didn't work either, though. When AGPGART was disabled entirely, the nVidia driver refused to load. How do I enable AGPGART to load as a module in 64 bit Gentoo and use NVAGP in its place?

----------

## troymc

In your xorg.conf, take a look at the NvAGP option in your Device section.

```

        Option          "NvAGP"                 "3"

```

troymc

----------

## alexcorn

I've got "NvAGP" set to 1 in xorg.conf, which tries to force nvagp instead of agpgart. I don't think that's the problem though. Agpgart is statically compiled into the kernel and I think it is keeping nvagp from loading. I want to modularize agpgart in the kernel config, but there doesn't appear to be a way for me to do so...

----------

## cnistra

If you put agp=off at the end of the kernel commandline in grub.conf agpgart will not be loaded.

----------

## alexcorn

 *cnistra wrote:*   

> If you put agp=off at the end of the kernel commandline in grub.conf agpgart will not be loaded.

 

Will this work even if agpgart is statically compiled into the kernel? If so, great. If not, I still need to be able to tell agpgart to compile as a module.

----------

## cnistra

I think I should have said "agpgart will be disabled" instead of "agpgart will not be loaded", sorry for the confusion.

 * zless /usr/share/doc/nvidia-drivers-1.0.8762-r1/README.gz wrote:*   

> To use the Linux AGPGART driver, it will need to be compiled with your kernel,
> 
> either statically linked in, or built as a module. NVIDIA AGP support cannot
> 
> be used if AGPGART is loaded in the kernel. It is recommended that you compile
> ...

 

Just try it, if it works go on with your life.   :Wink: 

----------

## alexcorn

I tried using "agp=off" but it didn't work. Now when nvagp tries to load, it fails and says it is because the kernel was compiled with iommu support. I've tried disabling iommu in the kernel config, and I've tried passing "iommu=off" to the kernel at boot. I also tried "iommu=noagp". Nothing so far works.

----------

## Drunkula

Well if you're recompiling the kernel why not just compile without agpgart - or modularize it.

----------

## cnistra

Hello alexcorn, we are making some progress at least.   :Wink:   A dmesg would be interesting to see. 

Anyway I saw on another message board that one could try to boot with iommu=memaper=2 and set agp aperture size to 64MB or 128 in bios. So maybe you could try to boot with  agp=off iommu=memaper=2. If it does not work post the output of dmesg here. Here is another  thread of the same messageboard that deals with your problem.

Also, it could be benificial to use a recent bios. Check your mobo maker web page.

----------

## cnistra

alexcorn check out this gentoo forums thread.

----------

## alexcorn

I finally got it to work. What did it was a combination of adding iommu=memaper=2 and installing nvidia-drivers instead of nvidia-glx and nvidia-kernel. nvidia-drivers is one version newer. I compiled agpgart as a module, but did not configure it to load. Thus, I am not using agp=off. I also didn't end up taking the K8 IOMMU GART out of the kernel. It is still statically compiled in. Unfortuneatly, Quake 3 is still sorta choppy and xine DVD playback gets audio and video out of sync. mplayer plays DVDs fine though, so no big deal there. I have SBA and FW both enabled, so I don't know what to do about Quake 3 just yet. I may try a different nvidia card. Thanks for all the help!

----------

## cnistra

Cool that it works, strange that q3 is choppy though. I remember q3 had fluent framerate with a gforce 1 card in 800x600. Does glxinfo look ok? Check out Appendix M in nvidia documentation (/usr/share/doc/nvidia-drivers-1.0.8762-r1/README.gz) about the proc interface, maybe the driver itself can give some clues.

----------

