Tumbleweed: Nvidia driver does not compile

this is the first time I’m having problem with compilation of nvidia drivers.

I am running Tumbleweed with:


and trying to install :


The nvidia installer log file /var/log/nvidia-installer.log shows several types of errors/warnings:

arch/x86/Makefile:133: stack-protector enabled but compiler support broken

/usr/src/linux-4.5.0-3/Makefile:680: Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR: -fstack-protector not supported by compiler

/tmp/selfgz2185/NVIDIA-Linux-x86_64-361.42/kernel/nvidia-modeset/nvidia-modeset-linux.c:1:0: error: code model kernel does not support PIC mode

The last error pops up a lot, probably for any object file to compile.

Can anybody help me get through this ? It is hard to believe that gcc-5.3 does not support stack-protector and PIC mode … There has to be a misconfiged config file somewhere …

I can send full nvidia-installer.log file.

I will appreciate any tips,
Thank you.

Have you follow the steps as per wiki here


After switching to multi-user mode, logging in on tty, blacklisting nouveau driver, running mkinitrd, rebooting I ran nvidia installer script (NVIDIA-xxxx.sh) which failed with the errors I described. I double checked that when running Nvidia installer nouveau driver was not loaded (lsmod | grep nouveau).

I used to install the driver manually many times. I also have openSUSE 13.2 installation, that worked with nvidia driver manually installed for several years.

As I said, having “-fstack-protector not supported by compiler” error is weird, because it was supported for a very long time already, probably since gcc-4.7 …

I also noticed that although rpm reports that gcc5-5.3.1+r233831-1.2.x86_64 is installed, I get slightly different revision version from running “gcc --version”:

humptydumpty:~ # /usr/bin/gcc --version
gcc (SUSE Linux) 5.3.1 20160301 [gcc-5-branch revision 233849]

above, /usr/bin/gcc is a link to /usr/bin/gcc-5 which in turn came from installation of gcc5-5.3.1+r233831-1.2.x86_64


Hi, I had no problems with TW and NVIDIA-Linux-x86_64-364.15.run so it seems due to your config…

I think you need kernel-default-devel and kernel-macros, check “make” too.
kernel-source must be prepared and configured to build kernel modules, it cannot be used as installed.
I’m no expert on the topic, but the above are the outstanding differences in my configuration.



kernel-default-devel and kernel-macros were installed. Sorry that I forgot to list them among installed ones. “make” is also installed. I also ran “make clean” and “make mrproper” in kernel source tree (in /usr/src/linux-4.5.0-3). Just in case, I also copied /boot/config-4.5.0-3-default to /usr/src/linux-4.5.0-3/.config .

But it all did not help to fix the problem :-/

In opensuse 13.2 there was no need to do anything with kernel source tree. The nvidia installer just ran successfully. I wonder if the source installed corresponds to the kernel installed. And if not could it be a problem. At least in case of gcc there is a minor discrepancy: “rpm -q gcc5” and “gcc --version” show different revision numbers.


That is the reading that I have too, so the problem should not be there.

After re-installing Tumblewed nvidia driver did compile and there were no issues. But after installing new kernel, an attempt to recompile the same driver failed with the exactly the same errors …

Finally got to the bottom of this problem. The offending package that changed compiler settings was gcc-PIE. After removing it Nvidia kernel driver/moduled compiled smoothly and after rebooting got graphical login screen and nvidia module is loaded.

A few comments about building external kernel modules against an openSUSE-Kernel and trying to correct some false assumptions made in this thread:

  1. The package “kernel-source” is not needed for this and hasn’t been for years.

If you want to build an externel (sic!) kernel module for a kernel obtained from an openSUSE-RPM (built with their standard procedure) you will need

  • kernel-devel (architecture/flavor independent files, mostly headers, Kconfigs and Makefiles)

  • kernel-$FLAVOR-devel (with $FLAVOR = flavor of target kernel, i.e default or pae, or …which contains the target specific headers and configuration files already configured)

and of course

  • the standard build tools (make, gcc, binutils …)

and that’s it.

Nowadays (= since kernel-devel has been split off that package), “kernel-source” only contains the sources not needed to build external modules, if you don’t want to modify and the rebuild the whole kernel (based on the standard openSUSE configuration), you will never need “kernel-source”.

  1. As said before, the respective kernel-$FLAVOR-devel package contains the actual configuration for the target kernel.

This means that running “make mrproper” or “make config” is not needed, as it already has been done when the kernel was built and the results of that process are the contents of kernel-$FLAVOR-devel.

This might even break things if it replaces/changes those configuration files in an incompatible way (although I have no idea if it really does, maybe in a best case scenario it is only a waste of time and does not change anything.)

  1. The packages “kernel-syms” and “kernel-macros” are only needed if one wants to build “kmp” packages, as they contain specific files for building those RPMs (kernel-macros) or pull in kernel-$FLAVOR-devel packages as a dependency. In OBS, you maybe want to build/distribute packages for more than one kernel flavor, so kernel-syms is only a dummy to take care of that (in “ye olden days” kernel-syms really contained kernel module symbols, but this also has been changed years ago, check yourself what is inside kernel-syms now).

In a nutshell:

  • If you have kernel-default-1.2.3 and want to build an external kernel modulefor that kernel you only need “kernel-devel-1.2.3” and “kernel-default-devel-1.2.3” as kernel specific packages.

  • Any manual change of kernel configuration (make clean, make mrproper, make config, etc.) is not needed and potentially breaks things instead of doing any good (in a best case scenario it does not anything and is only a waste of time).