# mm sources and nvidia doesn't play together

## Morgenstjerne

Is there a way to get nvidia to work without changing from mm sources?

 And if not, can someone please point me to a howto for changing kernel sources 

( I want to keep my kernel config btw, and not do that again..) 

the install is brand new so the config should b good  :Smile: 

----------

## yoyo

Are you using nvagp ??

I've got lot of problems with it and 2.6.11_rc based kernels.

The solution is to use agpgart (included in kernel config) with appropiriate chipset support (don't forget to modify your xorg.conf and to re-emerge nvidia-kernel after the kernel compil).

Enjoy !

PS : Someone  who could make nvagp working on 2.6.11_rc with reiser4 and vesa-tng support will be really appreciate here ...   :Wink: 

----------

## Deranger

Latest mm experience:

After compiling 2.6.10-mm3 and nvidia-kernel system boots fine, but X locks up whole system  :Neutral:  ~50 lines of kernel oops in /var/log/messages  :Laughing: 

----------

## Morgenstjerne

don't know if u noticed my status and my number of posts  :Wink: 

but I'm not completely sure what to do.. did I understand u correctly in that I go into the kernel config again (as described in the handbook)

 and use agpgart instead of what I'm prolly using which is nvagp? then recompile and all is well?

 is there a way to check if I'm currently using nvagp btw? 

oh and thnx for swift response  :Very Happy: 

currently running 2.6.10-rc3-mm1

----------

## yoyo

 *Morgenstjerne wrote:*   

> don't know if u noticed my status and my number of posts  

 It's not really meaningfull cause you can be a Linux guru with few post on Gentoo forum.   :Wink: 

 *Morgenstjerne wrote:*   

> but I'm not completely sure what to do.. did I understand u correctly in that I go into the kernel config again (as described in the handbook)
> 
>  and use agpgart instead of what I'm prolly using which is nvagp? then recompile and all is well?

 Don't forget to mount your boot partition when copying kernel on it (frequently newb error) and 

change the "NvAGP" option value to "3" in your /etc/X11/xorg.conf.

 *Morgenstjerne wrote:*   

> is there a way to check if I'm currently using nvagp btw? 

 

OK, I think you can make "cat /proc/driver/nvidia/agp/status" and see if it gives you : 

```
Status:          Enabled

Driver:          NVIDIA
```

If driver is called agpgart, you've got it.

EDIT : maybe agp status is not initialized  if you're not using X (  :Embarassed:  ); post result of "grep -i AGP /usr/src/linux/.config".

EDIT1 : post result of "ls -al /usr/src/" please.

----------

## Morgenstjerne

oh if only I could copy-paste between screens on diff computers  :Razz: 

result of ls -al /usr/src (. and .. not included)

-rw-r- -r - -   1 root root       0 date  .keep

lrwxrwxrwx   1 root root     21 date  linux -> linux-2.6.10-rc3-mm1/

drwxr- xr-x 19 root root  4096 date  linux-2.6.10-rc3-mm1

drwxr- xr-x   9 root root  4096 date  linux-2.6.9-gentoo-r13

result of grep cmd

 the ones not # out

CONFIG_AGP=y

CONFIG_AGP_VIA=y

----------

## yoyo

It seems you are using agpgart (with grep cmd).

But what NvAGP option did you put in /etc/X11/xorg.conf (section Device) ??

Have you re-emerged nvidia-kernel (for your new mm kernel) ??

Which version ("emerge -p nvidia-kernel" to have it) ??

Have you "modprobe nvidia" (or put it in the "/etc/modules.autoload.d/kernel-2.6" file) ??

Could you give us (sorry) result of "lsmod" and "/sbin/lspci | grep AGP" ??

----------

## Morgenstjerne

First of all, no need to say sorry  :Wink: 

this is a fresh install so there shouldn't b a need for re-emerge should there?

trying to emerge nvidia-kernel-1.0.6111-r3

 I can't find an NvAGP option in xorg.conf under "device" section I have the standard one and one stating 

Identifier "NV36,Nvidia,Geforce^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D Corporation$

Driver "vga"

modprobe nvidia gives FATAL: Module nvidia not found

 the kernel-2.6 file has no info (only # on all points) should I put something here? man wasn't very helpful with tips  :Sad: 

lsmod is empty.. just gives 

Module         Size    Used by

I have no lspci file

That's it for now, write again soon  :Wink: 

I'm kinda thinking we're getting somewhere cause I seem to b missing some stuff, keep the suggestions coming

----------

## yoyo

 *Morgenstjerne wrote:*   

> this is a fresh install so there shouldn't b a need for re-emerge should there?

 You need to emerge nvidia-kernel for each new kernel (nvidia-kernel use the "/usr/src/linux" symlink to know for what kernel it will be installed, that's why I asked you to show us result of "ls -l /usr/src"   :Wink:  ).

This is the case for each modules compiled outside kernels (nvidia, svgalib, alsa if you use alsa-driver ebuild's etc.).

 *Morgenstjerne wrote:*   

> trying to emerge nvidia-kernel-1.0.6111-r3

 Last one is 6629-r2; try it first.

 *Morgenstjerne wrote:*   

> I can't find an NvAGP option in xorg.conf under "device" section I have the standard one and one stating 
> 
> Identifier "NV36,Nvidia,Geforce^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D Corporation$
> 
> Driver "vga"

 You are using vga modules. Replace "vga" with "nvidia" (after you've emerged nvidia-kernel and successfully modprobe it).

 *Morgenstjerne wrote:*   

> modprobe nvidia gives FATAL: Module nvidia not found

 See first point upstair.

 *Morgenstjerne wrote:*   

> the kernel-2.6 file has no info (only # on all points) should I put something here? man wasn't very helpful with tips  

 "uname -r" gives you current kernel. "man uname" gives you some info in uname ...   :Wink: 

 *Morgenstjerne wrote:*   

> I have no lspci file

 Arf, it's in sys-apps/pciutils ebuild. Emerge it, it's really helpfull.

 *Morgenstjerne wrote:*   

> I'm kinda thinking we're getting somewhere cause I seem to b missing some stuff, keep the suggestions coming

 Give us result of lspci (once you've emerged it), and try with nvidia module. We'll see if it works with it ...

----------

## Morgenstjerne

emerge nvidia-kernel-1.0.6629-r2 Not found

I might not know how to specify version  :Sad: 

to make sure please tell me if the command I wrote is correct

lspci gives: 0000:00:00.0 Host Bridge: Via Technologies, Inc. VT8377 [KT400/KT600 AGP] Host Bridge

----------

## yoyo

 *Morgenstjerne wrote:*   

> emerge nvidia-kernel-1.0.6629-r2 Not found
> 
> I might not know how to specify version  

 This version was added to portage today (so maybe you don't have it on your computer).

To emerge latest nvidia-kernel : 

```
mkdir /etc/portage

nano -w /etc/portage/package.keywords
```

 and add in this file the 2 lines :  *Quote:*   

> media-video/nvidia-kernel ~x86
> 
> media-video/nvidia-glx ~x86

 Then "emerge nvidia-kernel" in root. That's all !

 *Morgenstjerne wrote:*   

> lspci gives: 0000:00:00.0 Host Bridge: Via Technologies, Inc. VT8377 [KT400/KT600 AGP] Host Bridge

 Seems, you have selected good options in kernel config.   :Cool: 

PS : I leave you now. Maybe someone else could help you. In the other case, see you tomorrow.

----------

## Morgenstjerne

gotta run b back in 4 hours  :Smile: 

----------

## Morgenstjerne

back now  :Smile:  too bad u had too leave too

the emerge still fails with the newest nvidia  :Sad: 

so now I guess I just need a little walk-trough on how to change sources, any help would be much obliged  :Smile: 

----------

## yoyo

 *Morgenstjerne wrote:*   

> the emerge still fails with the newest nvidia  

 What's the error ???

 *Morgenstjerne wrote:*   

> so now I guess I just need a little walk-trough on how to change sources, any help would be much obliged 

 Think you can have a look at the Gentoo Linux Kernel Upgrade Guide.

----------

## Morgenstjerne

good morning  :Very Happy: 

it fails with the same error as it used to do..

*Your currenst sources uses EXPORT_SYMBOL_GPL() on some methods required by nvidia-kernel

*this probably means that you are using2.6.10_rc3-mm* (which might I add is correct  :Smile: ). 

Please change away from mm-sources until this is revised and a solution released into the mm branch, development-sources will work.

!!! ERROR: media-video/nvidia-kernel-1.0.6629-r1 failed

!!! Function src_unpack, Line 71, Exitcode 0

!!! Incompatible kernel export

----------

## fallow

 *yoyo wrote:*   

> PS : Someone  who could make nvagp working on 2.6.11_rc with reiser4 and vesa-tng support will be really appreciate here ...  

 

I`m using 2.6.11-rc1-*** kernel with AGPGART , reiser4 and vesa-tng .

```

Status:          Enabled

Driver:          AGPGART

AGP Rate:        4x

Fast Writes:     Enabled

SBA:             Enabled

```

```

0000:00:01.0 PCI bridge: VIA Technologies, Inc. VT8363/8365 [KT133/KM133 AGP]
```

my xorg.conf -> http://vivid.dat.pl/2611rc1vv_e3/xorg.conf

kernel .config -> http://vivid.dat.pl/2611rc1vv_e3/.config

 *Morgenstjerne wrote:*   

> good morning 
> 
> it fails with the same error as it used to do..
> 
> *Your currenst sources uses EXPORT_SYMBOL_GPL() on some methods required by nvidia-kernel
> ...

 

with the EXPORT_SYMBOL_GPL You must use this patch 

```

diff -Naur 2610rc3mm1_orig/drivers/base/class_simple.c linux-2.6.10-rc3-mm1/drivers/base/class_simple.c

--- 2610rc3mm1_orig/drivers/base/class_simple.c 2004-12-14 14:36:03.000000000 +0100

+++ linux-2.6.10-rc3-mm1/drivers/base/class_simple.c    2004-12-14 16:28:29.183327648 +0100

@@ -91,7 +91,7 @@

        kfree(cs);

        return ERR_PTR(retval);

 }

-EXPORT_SYMBOL_GPL(class_simple_create);

+EXPORT_SYMBOL(class_simple_create);

 

 /**

  * class_simple_destroy - destroys a struct class_simple structure

@@ -107,7 +107,7 @@

 

        class_unregister(&cs->class);

 }

-EXPORT_SYMBOL_GPL(class_simple_destroy);

+EXPORT_SYMBOL(class_simple_destroy);

 

 /**

  * class_simple_device_add - adds a class device to sysfs for a character driver

@@ -166,7 +166,7 @@

        kfree(s_dev);

        return ERR_PTR(retval);

 }

-EXPORT_SYMBOL_GPL(class_simple_device_add);

+EXPORT_SYMBOL(class_simple_device_add);

 

 /**

  * class_simple_set_hotplug - set the hotplug callback in the embedded struct class

@@ -184,7 +184,7 @@

        cs->class.hotplug = hotplug;

        return 0;

 }

-EXPORT_SYMBOL_GPL(class_simple_set_hotplug);

+EXPORT_SYMBOL(class_simple_set_hotplug);

 

 /**

  * class_simple_device_remove - removes a class device that was created with class_simple_device_add()

@@ -213,4 +213,4 @@

                spin_unlock(&simple_dev_list_lock);

        }

 }

-EXPORT_SYMBOL_GPL(class_simple_device_remove);

+EXPORT_SYMBOL(class_simple_device_remove);

```

cheers  :Smile: 

----------

## yoyo

 *fallow wrote:*   

> I`m using 2.6.11-rc1-*** kernel with AGPGART , reiser4 and vesa-tng .

 Thanks for reply but I could make my nvidia card work with agpgart too. Problem is that software suspend doesn't work with agpgart (only with nvidia agp support : nvagp).

That's why I ask for someone who can make NVAGP work with 2.6.11-rc* linux kernel ...

 *fallow wrote:*   

>  *Morgenstjerne wrote:*   it fails with the same error as it used to do..
> 
> *Your currenst sources uses EXPORT_SYMBOL_GPL() on some methods required by nvidia-kernel
> 
>  
> ...

 Yeah ! I forgot this problem with mm kernels ...

Imho, the easiest way for Morgenstjerne is to emerge a 2.6.10-r? mm kernel : no patch to apply etc. Only following the link above on the Gentoo Linux Kernel Upgrade Guide.

----------

## Morgenstjerne

thnx  :Smile: 

but I really don't know what to do with that text  :Sad: 

I gather I can copy it into a file.. but what type of file, and how do I get it into my system?

prolly very noob question, but that's what u get for answering noobs  :Smile: 

it's hard turning around after 8 years of bill-bumming   :Embarassed: 

----------

## Morgenstjerne

but I've already got a 2.6.10-r3-mm1? what am I missing?

----------

## fallow

 *yoyo wrote:*   

> Thanks for reply but I could make my nvidia card work with agpgart too. Problem is that software suspend doesn't work with agpgart (only with nvidia agp support : nvagp).
> 
> That's why I ask for someone who can make NVAGP work with 2.6.11-rc* linux kernel ...

 

ahhh  :Smile:  sorry ,  I`m not using swsup 

Yeah, mm ofter has "some issues"  :Smile:  , but imho this is something like kernel playground,  so it`s "normal"

Morgenstjerne if You want to use this patch , 

You must copy it into main kernel sources directory 

(save it to patch1.diff for ex.)

and in this kernel_src dir run :

```
# patch -p1 < patch1.diff 
```

cheers

----------

## yoyo

 *Morgenstjerne wrote:*   

> but I've already got a 2.6.10-r3-mm1? what am I missing?

 I think you want to say a 2.6.10-rc3-mm1 (cause there's no 2.6.10-r3 mm-sources in portage tree).

Try patching your kernel like fallow asks and re-emerge nvidia-kernel; this should work.

----------

## mathgeek

Hi,

I am currently updating my system a little bit and put mm-sources (2.6.11-rc1-mm1) on it. So far everything is fine, except for the nvidia-driver. It fails to compile. In particular, the functions 'KernInitAGP' and 'KernTeardownAGP' in '/var/tmp/portage/.../usr/src/os-agp.c' complain about having too few arguments.

I checked that the sym-link to my kernel-sources is set correctly. Strangely, when I typed 'emerge -u nvidia-kernel', portage emerged gentoo-dev-sources first for no apparent reason. 

Does anyone know what to do? Any known patches?

----------

## fallow

 *mathgeek wrote:*   

> Hi,
> 
> I am currently updating my system a little bit and put mm-sources (2.6.11-rc1-mm1) on it. So far everything is fine, except for the nvidia-driver. It fails to compile. In particular, the functions 'KernInitAGP' and 'KernTeardownAGP' in '/var/tmp/portage/.../usr/src/os-agp.c' complain about having too few arguments.
> 
> I checked that the sym-link to my kernel-sources is set correctly. Strangely, when I typed 'emerge -u nvidia-kernel', portage emerged gentoo-dev-sources first for no apparent reason. 
> ...

 

as i remember You must reverse this patches from mm (You can grab it from mm broken out  http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.11-rc1/2.6.11-rc1-mm1/)

```

agpgart-add-agp_find_bridge-function.patch

agpgart-add-bridge-parameter-to-driver-functions.patch

agpgart-allow-drivers-to-allocate-memory-local-to.patch

agpgart-allow-multiple-backends-to-be-initialized.patch

drm-add-support-for-new-multiple-agp-bridge-agpgart-api.patch

fb-add-support-for-new-multiple-agp-bridge-agpgart-api.patch

```

after this  ,nvidia driver is merging cleanly and working with agpgart , I`m using mm1 with genetic zaphod sometimes.

cheers  :Smile: 

----------

## Morgenstjerne

finally got home from work *sigh*

I copied the patch into my /usr/src/linux-2.6.10-rc3-mm1

and then went to that dir and wrote patch -p1 <patch1.diff 

I get 4 failed msges and an error stating the patch ended unexpectedly at line 44?

 is the wrong with me or the patch text?

----------

## Morgenstjerne

bump? please ppl, I'm sooo close now   :Sad: 

oh and the patch I'm reffering to is the big one in the first post by fallow

----------

## yoyo

Try this as root :

```
cp /usr/src/linux-2.6.10-rc3-mm1/.config /root/.config

rm -R /usr/src/linux-2.6.10-rc3-mm1

rm /usr/src/linux

emerge -C mm-sources

emerge =mm-sources-2.6.10-r2

ln -s /usr/src/linux-2.6.10-mm2 /usr/src/linux

cp /root/.config /usr/src/linux

cd /usr/src/linux

make oldconfig

make && make modules_install

emerge nvidia-kernel
```

Mount your /boot partition, copy your new kernel ("cp /usr/src/linux/arch/i386/boot/bzImage /boot/bzImage.mm" for example).

Modify your grub.conf / or lilo.conf (don't forget to run "lilo").

Unmount /boot

Reboot on this new kernel and try (as root) to "modprobe nvidia".

Come back to ask if it works or not (but it may works if your kernel config is ok).

----------

## potatoface

@ yoyo

could you help me with my problem, too?

it is described here.

----------

## Morgenstjerne

after a couple of more weeks in windoze land   :Rolling Eyes: 

I'm now back.. after last post I couldn't find the -r2, so I changed to dev-sources.. but those didn't read my root partion which is an s-ata disk on the on-board raid controller.. so after 10 more hours of forum browsing I finally gave up and returned to easy-greasy windows..

Basically I still haven't found any soultions for this so I'm hoping someone else might ( I'm kinda new to linux, just so u know )

I have now tried with the -r2 and it doesn NOT work, other than that I must say that ur way of writing the code was ace yoyo  :Very Happy: 

----------

