I have a Dell Inspiron 7559 with an Nvidia GTX960M, running 14.04, currently on kernel 4.3. I wanted to upgrade my kernel for better Skylake support, but I have been unable to find an Nvidia driver+kernel combination that works: I tried 4.4 main, 4.5, 4.6 rc1 and rc2, with varying choices between 358, 361 and 364 (both from the website as well as graphics-drivers PPA), and I always keep getting the message “unable to build for kernel xxx” or some “DKMS apport: error building for kernel xxx”.
Can anyone shed some light on how to pick the best drivers (also is graphics-drivers the best PPA choice?), and if there are some patches required?
You probably will need to post the full error and attach the relevant logs. There’s no reason you should not be able to build 364 for newer kernels. I’m running the 364.19 drivers from the graphics-drivers PPA on Ubuntu 16.10 (kernel 4.4.0-23-generic) without issue.
Building for architecture x86_64
Building initial module for 4.5.7-040507-generic
ERROR (dkms apport): kernel package linux-headers-4.5.7-040507-generic is not supported
Error! Bad return status for module build on kernel: 4.5.7-040507-generic (x86_64)
Consult /var/lib/dkms/nvidia-361/361.45.11/build/make.log for more information.
Relevant details from inside the log:
CC [M] /var/lib/dkms/nvidia-361/361.45.11/build/nvidia/nv-frontend.o
CC [M] /var/lib/dkms/nvidia-361/361.45.11/build/nvidia/nv-instance.o
cc: error: unrecognized command line option ‘-fstack-protector-strong’
make[2]: *** [/var/lib/dkms/nvidia-361/361.45.11/build/nvidia/nv-frontend.o] Error 1
make[2]: *** Waiting for unfinished jobs....
cc: error: unrecognized command line option ‘-fstack-protector-strong’
make[2]: *** [/var/lib/dkms/nvidia-361/361.45.11/build/nvidia/nv-instance.o] Error 1
make[1]: *** [_module_/var/lib/dkms/nvidia-361/361.45.11/build] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-4.5.7-040507-generic'
make: *** [modules] Error 2
The exact same situation repeats in all kernels I’ve tried, with all driver versions such as 358, 361, 364 etc.
Later down the road, if they get gcc-5 to handle the -fstack-protector-strong flag, or nvidia updates their driver, you can restore things to their original state: