Install NVIDIA Drivers

Hey how did you setup optimus?

I downloaded Clear Linux today and installed fresh. Trying to follow this guide to install the nvidia drivers. I get to step 3 of Install (sudo ./NVIDIA-Linux-x86_64-430.09.run …), but it fails there. Are there any updated instructions to get past this issue?

uname -a
Linux 5.9.16-1009.native #1 SMP Mon Dec 21 05:03:27 PST 2020 x86_64 GNU/Linux

Error Output
ERROR: Failed to run /usr/bin/dkms build -m nvidia -v 430.09 -k 5.9.16-1009.native:
Kernel preparation unnecessary for this kernel. Skipping…

   Building module:
   cleaning build area...
   'make' -j16 NV_EXCLUDE_BUILD_MODULES='' KERNEL_UNAME=5.9.16-1009.native IGNORE_CC_MISMATCH='' modules...(bad exit status: 2)
   Error! Bad return status for module build on kernel: 5.9.16-1009.native (x86_64)
   Consult /var/lib/dkms/nvidia/430.09/build/make.log for more information.

Looking in make.log
/var/lib/dkms/nvidia/430.09/build/common/inc/nv-linux.h:166:10: fatal error: linux/ioctl32.h: No such file or directory
166 | #include <linux/ioctl32.h> /* register_ioctl32_conversion() */
| ^~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
compilation terminated.

for nvidia driver installation better go with the lts kernel

Thanks for the helpful information. I have installed Nvidia drivers but still, that is showing the updated driver window. should I use the driver updater for that. My friend suggests me to download a free driver updater. is this an easy process? can I get a solution with this?

Please help me with it. Thanks in advance

There should be no window. It’s all in terminal.

The instructions failed for me also. The reason is the installation installs the 64-bit libraries to lib64, not lib under /opt/nvidia. Note no trailing space after lib64 and lib32.

printf "/opt/nvidia/lib64\n/opt/nvidia/lib32\n" | sudo tee --append /etc/ld.so.conf.d/nvidia.conf

Ditto for the fix-nvidia-libGL-trigger.service file. Replace lib with lib64.

ExecStart=/usr/bin/ln -sfv /opt/nvidia/lib64/libGL.so.1 /usr/lib64/libGL.so.1
ExecStart=/usr/bin/ln -sfv /opt/nvidia/lib32/libGL.so.1 /usr/lib32/libGL.so.1

For OpenCL to work, I removed the --no-nvidia-modprobe argument during installation. I tested PyOpenCL and failed initially as a user until I reinstalled the driver without the --no-nvidia-modprobe argument.

Once OpenCL was working, I then tried CUDA. CUDA 11.x compiles with GCC 10.x and not require installing GCC 8. OpenCL and CUDA work great using PyOpenCL and PyCUDA.

If you only need CUDA as shared library then you don’t need GCC 8.
But if you need to do CUDA development, that you link CUDA header files in your program, then there are some requirement on GCC depending on the kernel and CUDA version.

I just followed your instructions and installed the drivers using the terminal at ctrl+alt+f2, however after my first reboot I’ve got this screen which I tried to fix by using sudo swupd update and sudo swupd repair but it didn’t help, what do I do now?

can you open gnome-terminal with Ctrl-Alt-T ?

Nope, only ctrl+alt+f2 does work

I did a destructive install, repaired using -m and —picky but I’m still getting this screen

Did you try uninstalling and reinstalling desktop?

I re installed it using destructive install is that enough or do I need to uninstall it first, and how do I uninstall it?

sudo swupd bundle-remove desktop-autostart
sudo swupd bundle-remove desktop
sudo swupd bundle-add desktop-autostart
reboot

See if it works

Above says:
" Install the kernel-native-dkms or kernel-lts-dkms bundle:

  1. Determine which kernel variant is running on Clear Linux OS. Only the native and lts kernels are enabled to build and load out-of-tree kernel modules with DKMS."

I find that the installer Advanced Options tab has the choice of Native or LTS latest.
After installation can one downgrade to a LTS kernel, and how?
Can one upgrade an LTS kernel to native, and how?
How can one know what the current LTS kernel is?

The referred to documentation has been removed. Is this page still current? Is there more current documentation on installing NVIDIA drivers?

https://clearlinux.org/documentation/clear-linux/guides/maintenance/kernel-modules-dkms#kernel-modules-dkms

1 Like

Documentation got moved over to docs.01.org a while back. I think this is the doc you’re looking for.

https://docs.01.org/clearlinux/latest/guides/kernel/kernel-modules-dkms.html

1 Like