Nvidia does not compile "conftest failed"

I’ve got one of those ****ed nvidia-optimus thinkpads (never again buy nvidia). I need the display port, which is connected directly to this card and for a large screen I’d like to have the nvidia driver. In BIOS, I can and I did switch to use the discrete graphic card only. Then I boot kernel 3.11 from openSuse (on openSuse 13.1) and try to install the nvidia driver (repository ftp://download.nvidia.com/opensuse/13.1/ ). Result from history:


# 2014-01-22 14:04:27 nvidia-gfxG03-kmp-desktop-331.38_k3.11.6_4-23.1.x86_64.rpm installed ok
# Additional rpm output:
# make: Entering directory `/usr/src/linux-3.11.6-4-obj/x86_64/desktop'
#   CC [M]  /usr/src/kernel-modules/nvidia-331.38-desktop/nv.o
# In file included from /usr/src/kernel-modules/nvidia-331.38-desktop/conftest.h:1:0,
#                  from /usr/src/kernel-modules/nvidia-331.38-desktop/nv-linux.h:15,
#                  from /usr/src/kernel-modules/nvidia-331.38-desktop/nv.c:13:
# /usr/src/kernel-modules/nvidia-331.38-desktop/conftest/macros.h:1:2: error: #error INIT_WORK() conftest failed!
#  #error INIT_WORK() conftest failed!
#   ^
# In file included from /usr/src/kernel-modules/nvidia-331.38-desktop/conftest.h:2:0,
#                  from /usr/src/kernel-modules/nvidia-331.38-desktop/nv-linux.h:15,
#                  from /usr/src/kernel-modules/nvidia-331.38-desktop/nv.c:13:
# /usr/src/kernel-modules/nvidia-331.38-desktop/conftest/functions.h:1:2: error: #error remap_page_range() conftest failed!
#  #error remap_page_range() conftest failed!
#   ^
# /usr/src/kernel-modules/nvidia-331.38-desktop/conftest/functions.h:3:2: error: #error vmap() conftest failed!
#  #error vmap() conftest failed!
#   ^
# /usr/src/kernel-modules/nvidia-331.38-desktop/conftest/functions.h:12:2: error: #error kmem_cache_create() conftest failed!
#  #error kmem_cache_create() conftest failed!
#   ^
# /usr/src/kernel-modules/nvidia-331.38-desktop/conftest/functions.h:13:2: error: #error on_each_cpu() conftest failed!
#  #error on_each_cpu() conftest failed!
#   ^
# /usr/src/kernel-modules/nvidia-331.38-desktop/conftest/functions.h:14:2: error: #error smp_call_function() conftest failed!
#  #error smp_call_function() conftest failed!

And so on. In the end the building of nvidia.ko fails, the error messages closes:

# In file included from /usr/src/kernel-modules/nvidia-331.38-desktop/nv-linux.h:108:0,
#                  from /usr/src/kernel-modules/nvidia-331.38-desktop/nv.c:13:
# /usr/src/linux-3.11.6-4/include/linux/interrupt.h:130:1: note: expected ‘irq_handler_t’ but argument is of type ‘enum irqreturn_t (*)(int,  void *, struct pt_regs *)’
#  request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags,
#  ^
# cc1: some warnings being treated as errors
# make[3]: *** [/usr/src/kernel-modules/nvidia-331.38-desktop/nv.o] Fehler 1
# make[2]: *** [_module_/usr/src/kernel-modules/nvidia-331.38-desktop] Fehler 2
# make[1]: *** [sub-make] Error 2
# make[1]: Leaving directory `/usr/src/linux-3.11.6-4'
# NVIDIA: left KBUILD.
#  nvidia.ko failed to build!
# make: *** [nvidia.ko] Error 1
# /
# install: cannot stat '/usr/src/kernel-modules/nvidia-331.38-desktop/nvidia.ko': No such file or directory
# WARNING: Can't read module /lib/modules/3.11.6-4-desktop/weak-updates/updates/nvidia.ko: No such file or directory
# 
# Modprobe blacklist files have been created at /etc/modprobe.d to prevent Nouveau from loading. This can be reverted by deleting /etc/modprobe.d/nvidia-*.conf.
# 
# *** Reboot your computer and verify that the NVIDIA graphics driver can be loaded. ***
# 
# WARNING: Can't read module /lib/modules/3.11.6-4-desktop/weak-updates/updates/nvidia.ko: No such file or directory
# WARNING: Can't read module /lib/modules/3.13.0-rc8-2.g7ce0a21-desktop/weak-updates/updates/nvidia.ko: No such file or directory

Any idea why the building of the module failes? Is there anything else I have to do besides installing the rpm’s? Something with KMS or alike?

Which kernel do you have installed?
The nvidia driver does not work yet with kernel 3.13 I guess.

Uninstall that and installing the driver should work.

Yes, you are right. Nvidia does not compile, if another kernel exists! Of course I tried to install nvidia while using the kernel 3.11, but an existing other kernel prohibited this! Incredible.

For the record: I removed the other kernel, then I had to uninstall nvidia completely, booted into bootlevel 3, installed, rebooted and it works.

Thank you!

JFYI: When installing the nvidia driver rpms from the repo you don’t have to boot to runlevel3. Installing it in runlevel 5 works just as well.

GLX fails:


less /var/log/Xorg.0.log | grep gl
    13.585] (II) "glx" will be loaded by default.
    13.585] (II) LoadModule: "glamoregl"
    13.592] (II) Loading /usr/lib64/xorg/modules/libglamoregl.so
    13.594] (II) Module glamoregl: vendor="X.Org Foundation"
    13.594] (II) LoadModule: "glx"
    13.594] (II) Loading /usr/lib64/xorg/modules/updates/extensions/libglx.so
    13.594] (EE) Failed to load /usr/lib64/xorg/modules/updates/extensions/libglx.so: /usr/lib64/xorg/modules/updates/extensions/libglx.so: cannot open shared object file: No such file or directory
    13.594] (II) UnloadModule: "glx"
    13.594] (II) Unloading glx
    13.594] (EE) Failed to load module "glx" (loader failed, 7)

As I mentioned, this is a thinkpad with optimus: nvidia and integrated intel graphics card. But usually I ony use the intel GPU, only if use a big screen, I need the nvidia and the display port.

So my /etc/init.d/boot.local comprises this code (thanks to hank_se):


#! /bin/sh
#
# Copyright (c) 2002 SuSE Linux AG Nuernberg, Germany.  All rights reserved.
#
# Author: Werner Fink, 1996
#         Burchard Steinbild, 1996
#
# /etc/init.d/boot.local
#
# script with local commands to be executed from init on system startup
#
# Here you should add things, that should happen directly after booting
# before we're going to the first run level.
#

mode=$(/sbin/lspci | grep VGA);#Make shure we are in command of /usr/X11R6/lib
if  -e /etc/ld.so.conf.d/nvidia-gfxGO3.conf ]; then
    /bin/rm /etc/ld.so.conf.d/nvidia-gfxGO3.conf
fi  
#Check graphics mode and take apropriate action
if  `echo $mode | grep -c "Intel" ` -gt 0 ]; then
if  -e /usr/lib64/xorg/modules/updates/extensions/libglx.so ]; then
    /bin/rm /usr/lib64/xorg/modules/updates/extensions/libglx.so
fi 
if  -e /usr/X11R6/lib/libGL.so.1 ]; then
    /bin/rm /usr/X11R6/lib/libGL.so.1
    /bin/rm /usr/X11R6/lib64/libGL.so.1
fi


#Else we must be in Nvidia mode
else
    /bin/ln -s /usr/lib64/xorg/modules/updates/extensions/libglx.so.* /usr/lib64/xorg/modules/updates/extensions/libglx.so
    /sbin/ldconfig /usr/X11R6/lib
    /sbin/ldconfig /usr/X11R6/lib64    
fi

And now glamoregl complains the missing file. What did I wreck? I’m using the nvidia card right now.

But if you switched to the Nvidia card in the BIOS you shouldn’t have to do anything else AFAIK, the nvidia driver should just work then.
So you do want to switch between them? I thought you wanted to stick to the NVidia card completely…

And now glamoregl complains the missing file. What did I wreck? I’m using the nvidia card right now.

No, it’s not glamoregl that’s complaining.
The module “glx” cannot be loaded because /usr/lib64/xorg/modules/updates/extensions/libglx.so (from the nvidia driver) does not exist.

Apparently the script doesn’t work as intended and the link is set wrong or similar.
What does “ls -l /usr/lib64/xorg/modules/updates/extensions/libglx.so” say (when booted with nvidia of course)?

Another thing:
libglx has been split out to a separate package in December (I think), nvidia-glG03.
Did you install that? If not, it’s of course obvious why libglx cannot be found… :wink:

How did you install the nvidia driver, repo or the generic .run installer? The switching script will only work with the repo method. If you have used the .run installer at any stage you’ll also have to reinstall xorg-x11-server to restore mesa for the intel card.

Uuups. Aha. Missing dependency. I installed via Yast, but this one was missing. Thank you, now it works with nvidia. Gonna reboot later with intel and see.

I installed via the repo, to avoid any damage to the intel-gpu installation. It seems, I’m close to a fully working notebook. Thanks again for that script!

You know, bumblebee is not really useful to me. The intel-GPU has enough power for Emacs, LaTeX, Firefox, kmail and the like. Only once in a while I need a large screen or give a speech and need the display port. The DP is connected to the nvidia-GPU and even bumblebee cannot make it work. Fortunately I can switch in BIOS between the two cards and disable optimus completely. For some hours I can tolerate the noise of the fast running fan, which comes with using nvidia.

The advantage of switching in BIOS between the two GPUs is that I can switch off nvidia completely and afterwards the notebook runs really quietly. And if necessary, I reboot with nvidia.

No, the dependency is not missing. But it is only “recommended”, not “required”.
This was done on purpose, see the package’s changelog:

Mon Dec 16 13:45:48 UTC 2013 - sndirsch@suse.com

- no longer hardrequire nvidia-glG03 (by x11-video-nvidiaG03), just
  recommend it when installing the KMP, since there are users who
  want the driver stack except for the GL components


-------------------------------------------------------------------
Thu Dec  5 15:09:36 UTC 2013 - sndirsch@suse.com


- adjusted rpmlintrc to new subpackage 


-------------------------------------------------------------------
Thu Dec  5 14:11:34 UTC 2013 - sndirsch@suse.com


- introduced nvidia-glG03 subpackage
  * One of the problems our users face is installing the driver
    on an iGPU+dGPU system (ex. a system that would be labeled
    Optimus capable).  Specifically, users lose access to the
    mesa GL libraries when the Nvidia driver is installed, causing
    issues if they want to run X on their iGPU. Giving users the
    ability to opt-out of the GL components of the Nvidia driver
    would allow them to continue to drive the visual components
    of their system on the iGPU, and still run CUDA on their dGPU.
    (Andy Dick <adick@nvidia.com>)



Because you explicitely uninstalled it, you told YaST to not install it anymore.
Therefore YaST didn’t install it, when you installed the driver a second time.

If you uninstall a package, it will get added to the “SoftLocks” file. Packages in there will not be installed again automatically, only if they are required. That’s part of libzypp’s behaviour. I think this is done to not get recommended packages installed again on every update (or when you install something else) after you uninstalled them.

This is interesting. If I delete a package, the recommendation to get it installed it with another package will be, well, disregarded. I’ve never heard of it. OK, sounds ingenious for people in the know. I’ll have a look into the SoftLocks file. However, thank you again.

It’s in /var/lib/zypp/ … :wink: