NVIDIA Support for Latest Linux kernels..

NVIDIA used to be commendably quick to provide a driver update that supported the latest Linux kernels, but there is still no driver for Kernel 3.11 - which has been released for several weeks now.

The most recently released driver is ‘legacy’ version 173.14.38, released on September 4, which - frustratingly - does compile cleanly with kernel 3.11.x, and even compiles with kernel 3.12-rc, but is not much help, as it does not support recent GPUs…

Yes, there is a simple patch for drivers 319.49 and 325.15, but this should not be necessary, so long after an official kernel version has been released…

I have seen a rather crude ‘hack’ for kernel 3.12 support, but this was - for many reasons - not an acceptable solution.

Can someone from NVIDIA please let us know when the latest Linux kernel will be fully supported?

Thank you…

Robert Gadsdon
rglinuxtech.com

Nvidia 3.25 is working well here with kernel 3.11 on Manjaro. This is on a laptop so its with Bumblebee solution.

My understanding is that the 173.14.* driver can use get_num_physpages() for what it needed num_physpages for, but that this is not correct for one of the two places it is used in more modern drivers, which is why the simple patch hasn’t been applied. Our kernel guru is working on a more correct fix.

Well, I just downloaded the latest NVIDIA driver - 319.60, and it fails to compile with the latest kernel - 3.11.3:

/home/rgadsdon/NVIDIA-Linux-x86_64-319.60/kernel/os-interface.c: In function ‘os_get_system_memory_size’:
/home/rgadsdon/NVIDIA-Linux-x86_64-319.60/kernel/os-interface.c:255:21: error: ‘num_physpages’ undeclared (first use in this function)
return (((NvU64)NV_NUM_PHYSPAGES * PAGE_SIZE) / RM_PAGE_SIZE);
^
/home/rgadsdon/NVIDIA-Linux-x86_64-319.60/kernel/os-interface.c:255:21: note: each undeclared identifier is reported only once for each function it appears in
/home/rgadsdon/NVIDIA-Linux-x86_64-319.60/kernel/os-interface.c:256:1: warning:
control reaches end of non-void function [-Wreturn-type]
}
^
make[4]: *** [/home/rgadsdon/NVIDIA-Linux-x86_64-319.60/kernel/os-interface.o] Error 1
make[3]: *** [module/home/rgadsdon/NVIDIA-Linux-x86_64-319.60/kernel] Error 2
make[2]: *** [sub-make] Error 2
NVIDIA: left KBUILD.
nvidia.ko failed to build!
make[1]: *** [module] Error 1
make: *** [install] Error 2

and… fails to compile with 3.12-rc3:

/home/rgadsdon/NVIDIA-Linux-x86_64-319.60/kernel/nv-drm.c: In function ‘nv_alloc_os_descriptor_handle’:
/home/rgadsdon/NVIDIA-Linux-x86_64-319.60/kernel/nv-drm.c:204:9: error: void value not ignored as it ought to be
ret = drm_gem_private_object_init(nvl->drm, &nv_obj->base, size);
^
make[4]: *** [/home/rgadsdon/NVIDIA-Linux-x86_64-319.60/kernel/nv-drm.o] Error 1
make[3]: *** [module/home/rgadsdon/NVIDIA-Linux-x86_64-319.60/kernel] Error 2
make[2]: *** [sub-make] Error 2
NVIDIA: left KBUILD.
nvidia.ko failed to build!
make[1]: *** [module] Error 1
make: *** [install] Error 2

Robert Gadsdon
rglinuxtech.com

there’s 3.12.3 out already and 3.11 not even officially supported by the latest drivers. Will go summon Linus’s mighty finger soon.

Same problem here with 3.11-2. Not even a Beta driver for 3.11 ??

I tried some fix w/

#define NV_NUM_PHYSPAGES get_num_physpages

in /usr/src/nvidia-325.15/nv-linux-h

but the installer script pulls the nv-linux.h from /tmp I can’t edit.

snip:


In file included from /tmp/selfgz16332/NVIDIA-Linux-x86_64-325.15/kernel/os-interface.c:15:0:
/tmp/selfgz16332/NVIDIA-Linux-x86_64-325.15/kernel/os-interface.c: In function ‘os_get_system_memory_size’:
/tmp/selfgz16332/NVIDIA-Linux-x86_64-325.15/kernel/nv-linux.h:961:41: error: ‘num_physpages’ undeclared (first use in this function)
#define NV_NUM_PHYSPAGES num_physpages
^
/tmp/selfgz16332/NVIDIA-Linux-x86_64-325.15/kernel/os-interface.c:244:21: note: in expansion of macro ‘NV_NUM_PHYSPAGES’
return (((NvU64)NV_NUM_PHYSPAGES * PAGE_SIZE) / RM_PAGE_SIZE);
^
/tmp/selfgz16332/NVIDIA-Linux-x86_64-325.15/kernel/nv-linux.h:961:41: note: each undeclared identifier is reported only once for each function it appears in
#define NV_NUM_PHYSPAGES num_physpages
^
/tmp/selfgz16332/NVIDIA-Linux-x86_64-325.15/kernel/os-interface.c:244:21: note: in expansion of macro ‘NV_NUM_PHYSPAGES’
return (((NvU64)NV_NUM_PHYSPAGES * PAGE_SIZE) / RM_PAGE_SIZE);
^
/tmp/selfgz16332/NVIDIA-Linux-x86_64-325.15/kernel/os-interface.c:245:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
make[2]: *** [/tmp/selfgz16332/NVIDIA-Linux-x86_64-325.15/kernel/os-interface.o] Error 1
make[1]: *** [module/tmp/selfgz16332/NVIDIA-Linux-x86_64-325.15/kernel] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.11-2.dmz.1-liquorix-amd64’
NVIDIA: left KBUILD.
nvidia.ko failed to build!
make: *** [module] Error 1
→ Error.
ERROR: Unable to build the NVIDIA kernel module.

hey phemt,

your fix works! just start the installer, don’t choose to accept the terms yet…

Open another terminal and go to the directory where the installer is and look for a directory named selfgz. Inside this directory you will find NVIDIA-Linux-x86_64-319.60/kernel/nv-linux.h. Modify it, save it, and then continue with the already running installer…

Hope it helps.

*Works in Fedora 19 KDE and XFCE distros.

wow NVIDIA is so lame the latest 331.13 driver doesn’t even compile with kernel 3.11.3 I’m not even talking about 3.12rc3.Epic FAIL. NVIDIA SUCKS AGAIN !!! You can remove this post wich will prove I’m right and you’re wrong AGAIN!

Patch that worked for 325.15 doesn’t work for 331.13. I managed to make it patch, but modules doesn’t compile on 3.12-rc3 becouse it uses GPL symbols. But nv.c file is patched in that driver. Don’t know why it is not working.

I agree, i can’t compile 331.13 with kernel 3.11, Ubuntu 13.10 64-bit.
What’s the point of releasing new drivers if you can’t install them…

Sadly - as has already been reported - the latest 331.13 driver still won’t compile with 3.11 kernels…

I did manage to get it to work, by applying the 3.11-only patch originally created for 325.15…

It would appear that a ‘legal’ patch for 3.12 kernels would be a non-trivial task, but the 3.11 patch is so very simple!

Robert Gadsdon.
October 4, 2013

Can someone post a working diff for 331.12 3.12-rc3 if you can

I don’t know how to make a diff, but here is one part of what is needed to make it work:
http://www.nvnews.net/vbulletin/showthread.php?t=210771

Second part is: you need to extract created custom.run file, and then edit nv.c and nv-frontend.c files, and change Licence “NVIDIA” to Licence “GPL”.

Instead of changing the module license to GPL, change the kernel. This patch is geared up for 3.12-rc4: kernel/git/torvalds/linux.git - Linux kernel source tree

Excellent news… I have applied the kernel patch, and the NVIDIA patch referenced in an earlier post, and can confirm that drivers 319.60 and 331.13 now compile OK on kernel 3.12-rc3.

This may well explain why there was a delay in the provision of a ‘newer kernel’ version of the official NVIDIA driver…

Robert Gadsdon
rglinuxtech.com

conky_vs_julian or Anyone:

I’m having trouble patching the latest kernel source with the diff you referenced? I have my kernel source in /usr/src/linux-3.12-rc6 and pulled the latest git branch… I copied the diff .txt to a diff file named nvidia-torvalds.diff within this source directory and then tried: patch -p1 < nvidia-torvalds.diff, but I get malformed line at line 6. I also tried different -p switch numbers including none and zero to no avail. If you have a hint, please let me know. I would love to apply this patch before I compile the latest kernel. It makes perfect sense to apply this patch instead of patching the drivers.

If I’m pulling the latest linux source from git.kernel.org, then am I getting this change already? It’s not committed right? I’m kind of a newb to patching the kernel tree, but I’m sure a little walkthrough would help everyone looking at this thread.

I applied and am running 331.13 right now on 3.12-rc5-1

I had to install the 331.13 driver first, and let it fail. If you choose to build with dkms, it will make an entry in there. All of the rest of the stuff will compile and install, but not the kernel module.

After you do that, on my machine, I had /var/lib/dkms/nvidia/331.13/build and …/source folders. I, after a sudo su, copied the patches to the source directory, and deleted the …/build folder. I then entered the …/source folder, and tried to apply the patch (linux-nvidia-3.11.patch thats out there somewhere) and a few others, but they wouldnt work. I dont know too much about C and patching, so I hand-copied the entries over to nv-drm.c, nv-linux.whatever, and ran dkms build nvidia/331.13

after this, it built the kernel module for me and installed it. Im sure this is just a temporary solution. I wish I knew more C so that I could fix the patch. haha.

If you do it through dkms, it makes sense. If its not done via dkms, it doesnt matter when you patch it or install it; if you upgrade the kernel, you will have to recompile the nvidia module for your new kernel, most likely by hand, until they get full support.

Gotta remember, it is still an RC, but yeah. The patches still should work. I recommend using kate or some diff program to compare the files to be patched and the patch itself, side-by-side, that way you can actually see where the patch is failing. Things only have to move one line up or down for the whole patch to fail on a given file.

It’s committed as of 3.12-rc4, you don’t need it for rc6.

GOT LATEST KERNEL AND DRIVER TO INSTALL W/ DKMS [DEBIAN/JESSIE/LMDE | 3.12.0-rc6+ | 331.13

(STILL NEEDS HALF A DIFFERENT/DRM PATCH conky_vs_julian)

HOWTO WRITE-UP HERE: Nvidia driver and linux-git - Linux - NVIDIA Developer Forums [PAGE 2]