NVIDIA Drivers installation fails due to dkms?

I made a fresh installation of Clear Linux 35390 (live gui version), and everything seemed fine using the igpu from amd, but I really make use of my NVIDIA card, so I tried to install it.
It was the second time I tried, I thought I installed something wrong, but now reading clearer the log, I don’t know much of what is happening.

First of all, I manually installed the dkms thanks to “sudo swupd bundle-add kernel-lts-dkms” (yes, I also had the lts kernel), and also manually downloaded the latest safe drivers from nvidia (470.86)
Then, I used the nvidia drivers through the awesome clear linux scripts. Everything seemed fine after the first reboot… and then, came this:

nvidia-installer log file '/var/log/nvidia-installer.log'
creation time: Thu Dec  9 17:11:55 2021
installer version: 470.86

PATH: /usr/bin/haswell:/usr/local/bin:/usr/bin:/opt/3rd-party/bin

nvidia-installer command line:
    ./nvidia-installer
    --utility-prefix=/opt/nvidia
    --opengl-prefix=/opt/nvidia
    --compat32-prefix=/opt/nvidia
    --compat32-libdir=lib32
    --x-prefix=/opt/nvidia
    --x-module-path=/opt/nvidia/lib64/xorg/modules
    --x-library-path=/opt/nvidia/lib64
    --x-sysconfig-path=/etc/X11/xorg.conf.d
    --documentation-prefix=/opt/nvidia
    --application-profile-path=/etc/nvidia/nvidia-application-profiles-rc.d
    --no-precompiled-interface
    --no-nvidia-modprobe
    --no-distro-scripts
    --force-libglx-indirect
    --glvnd-egl-config-path=/etc/glvnd/egl_vendor.d
    --egl-external-platform-config-path=/etc/egl/egl_external_platform.d
    --dkms
    --silent

Using built-in stream user interface
-> Detected 4 CPUs online; setting concurrency level to 4.
WARNING: Unable to determine the default library path. The path /opt/nvidia/lib will be used, but this path was not detected in the ldconfig(8) cache, and no directory exists at this path, so it is likely that libraries installed there will not be found by the loader.
WARNING: Unable to determine the default X library path. The path /opt/nvidia/lib will be used, but this path was not detected in the ldconfig(8) cache, and no directory exists at this path, so it is likely that libraries installed there will not be found by the loader.
-> Installing NVIDIA driver version 470.86.
-> Would you like to register the kernel module sources with DKMS? This will allow DKMS to automatically build a new module, if you install a different kernel later. (Answer: Yes)
-> Install NVIDIA's 32-bit compatibility libraries? (Answer: Yes)
Looking for install checker script at ./libglvnd_install_checker/check-libglvnd-install.sh
   executing: '/bin/sh ./libglvnd_install_checker/check-libglvnd-install.sh'...
   Found libglvnd libraries:
   Found non-libglvnd libraries: libEGL.so.1 libGL.so.1
   Missing libraries: libGLX.so.0
Will install libglvnd libraries.
Will install libEGL vendor library config file to /etc/glvnd/egl_vendor.d
-> Searching for conflicting files:
-> done.
-> Installing 'NVIDIA Accelerated Graphics Driver for Linux-x86_64' (470.86):
   executing: '/usr/bin/ldconfig'...
   executing: '/usr/bin/systemctl daemon-reload'...
-> done.
-> Driver file installation is complete.
-> Installing DKMS kernel module:
ERROR: Failed to run `/usr/bin/dkms add -m nvidia -v 470.86 -k 5.10.83-34.lts2020`: Error! No write access to DKMS tree at /var/lib/dkms
-> error.
ERROR: Failed to install the kernel module through DKMS. No kernel module was installed; please try installing again without DKMS, or check the DKMS logs for more information.
ERROR: Installation has failed.  Please see the file '/var/log/nvidia-installer.log' for details.  You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com.

And now, every time I boot, Clear Linux tries to boot with the nvidia drivers and crashes xorg, at least I could retrieve the log thanks to using the reliable “alt+F2”.
I haven’t investigated much on this forum, but I think it is really weird that this is happening.

Had a similar problem, which was fixed by creating the /var/lib/dkms folder (if I do remember well, it doesn’t exist on a new install)
So, in a terminal, sudo mkdir /var/lib/dkms, then reinstall Nvidia.

Also, I couldn’t run any clearlinux version >35470 with the Nvidia drivers. Even tried reinstalling the whole system without success. The NVIDIA driver tutorial wasn’t useful either. Finally fixed it with the following install command:

sudo sh ./NVIDIA-Linux-x86_64-495.46.run --utility-prefix=/opt/nvidia --opengl-prefix=/opt/nvidia --compat32-prefix=/opt/nvidia --compat32-libdir=lib32 --x-prefix=/opt/nvidia --x-module-path=/opt/nvidia/lib64/xorg/modules --x-library-path=/opt/nvidia/lib64 --x-sysconfig-path=/etc/X11/xorg.conf.d --documentation-prefix=/opt/nvidia --application-profile-path=/etc/nvidia/nvidia-application-profiles-rc.d --no-precompiled-interface --no-distro-scripts --force-libglx-indirect --glvnd-egl-config-path=/etc/glvnd/egl_vendor.d --egl-external-platform-config-path=/etc/egl/egl_external_platform.d --dkms --no-cc-version-check --expert

And either change the options or keep the defaults when prompted

3 Likes