Thursday, April 16, 2009

Compile nvidia on kernel 2.6.30-rc2

Compiling nvidia on a 2.6.30-rc2 ends in disappointment with "Could not build module" and the log (/var/log/nvidia-installer.log) shows an error about not finding "owner" in struct "proc_dir_entry" in nv.c.

unpack the NVIDIA-Linux-x86-180.44-pkg1.run (or pkg2 if x86_64) with -x

sh NVIDIA-Linux-x86-180.44-pkg1.run -x


in NVIDIA-Linux-x86-180.44-pkg1/usr/src/nv/nv.c
just replace the lines with
    entry->owner = THIS_MODULE;

with

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
entry->owner = THIS_MODULE;
#endif


make sure to not forget the last endif closing the ifdef CONFIG_PROC_FS
so on line 718 you'll have:

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
entry->owner = THIS_MODULE;
#endif
#endif


then run the nvidia installer script in the root of the unpacked binary

./nvidia-installer