CL 38270: Good news, the bad news, and solution for NVIDIA graphics

Re: https://github.com/marioroy/nvidia-driver-on-clear-linux

Good news: The recent Clear Linux OS (release 38270) installs the libglvnd package, a vendor-neutral dispatch layer for arbitrating OpenGL API calls between multiple vendors on a per-screen basis. Thank you, CL team.

The bad news: Updating to CL 38270 will break NVIDIA graphics using the NVIDIA proprietary driver. Before CL 38270, the NVIDIA installer removes non-libglvnd libraries { libGLESv2, libGLESv1_CM, libOpenGL, libEGL, libGLX, and libGL }. This requires automation to create symbolic links to the /opt/nvidia path via post-update trigger script.

Starting with CL 38270, the NVIDIA installer detects the presence of libglvnd libraries.

executing: '/bin/sh ./libglvnd_install_checker/check-libglvnd-install.sh'...
Found libglvnd libraries:
   libGLESv2.so.2 libGLESv1_CM.so.1 libOpenGL.so.0
   libEGL.so.1 libGLX.so.0 libGL.so.1
libglvnd appears to be installed.

Solution: Follow the steps to get NVIDIA graphics working again. This requires re-installing the proprietary driver to detect libglvnd. Notably important is running the pre-install-driver script with the update argument. That will refresh the trigger script to not make symbolic links to the libraries mentioned above.

  1. Boot into multi-user mode by pressing the letter e on the boot screen. Prepend 3 with a space to the list of kernel arguments.
  2. Uninstall the proprietary driver: sudo /usr/bin/nvidia-uninstall
  3. Remove artifacts: sudo rm -f /usr/lib64/libnvidia*
  4. Repair lib-opengl: sudo swupd repair -x --bundles=lib-opengl
  5. Run: git pull from the nvidia-driver-on-clear-linux folder
  6. Run: bash pre-install-driver update

Finally, install the proprietary driver: bash install-driver 525 or desired version 520, 515, 510, or 470.

2 Likes

Anything that Open Source :slight_smile:

Thank you for this update. I am still back at build 37500, not having gone to the NVIDIA proprietary driver with auto update solution yet. Thank you for the gethub link as well.

Run: git update from the nvidia-driver-on-clear-linux folder

~/nvidia-driver-on-clear-linux (main) $ git update
WARNING: You called a Git command named 'update', which does not exist.
Continuing in 1.5 seconds, assuming that you meant 'update-ref'.
usage: git update-ref [<options>] -d <refname> [<old-val>]
   or: git update-ref [<options>]    <refname> <new-val> [<old-val>]
   or: git update-ref [<options>] --stdin [-z]

    -m <reason>           reason of the update
    -d                    delete the reference
    --no-deref            update <refname> not the one it points to
    -z                    stdin has NUL-terminated arguments
    --stdin               read updates from stdin
    --create-reflog       create a reflog

And not only is the GitHub command wrong, but …

And finally I get the dreaded Oh No! Something has gone wrong gnome screen.

Well back to manual install!

The original post is fixed. That was met to be git pull.

It will not work without the dkms bits. The kernel-current-dkms bundle is no longer available. Your issue can be resolved by installing another kernel and removing kernel-current.

Hi @marioroy
I have not been active in the forum because of heavy workload recently. Thought I would let you know that the 530 driver is working fine on my machine. The ‘regression’ issue is not troubling mine-I have a 4k LG tv and a 144hz 1080p monitor. And aren’t we lucky to have a rolling release distro that is cutting edge and fast?

Just for your amusement, I asked ChatGPT 4 (with bing search) to compare your script to the official guide on installing the driver :laughing: and response was;

The method provided in the GitHub script and the official guide to installing the Nvidia graphics driver have similarities and differences.

Both methods have pre-installation requirements:

GitHub Method:

Requires a recent Clear Linux image (version 39110 or newer)​1​.
Depending on the Clear Linux release, the open-source nouveau driver might not work with recent Nvidia graphics cards (3000 series or newer). Hence, the OS should be installed in text mode​-1eon the boot screen and prependnomodeset 3with a space to the list of kernel arguments. The OS will boot into multi-user mode and prevent the nouveau driver from loading. Press enter to boot the OS. Instructions are provided on the screen for running the installer.\n\nDuring setup, remember to enter[A]Advanced options. Select \"Kernel Command Line\" and enternomodeset 3to \"Add Extra Arguments\". Optionally, go back to the prior screen and choose thelts(recommended) ornative kernel under \"Kernel Selection\". Also disable automatic OS updates if desired","pub_date":null}}​.
During setup, the user should select "Kernel Command Line" and enter nomodeset 3 to "Add Extra Arguments". The user can also select the lts or native kernel under "Kernel Selection"​-1eon the boot screen and prependnomodeset 3with a space to the list of kernel arguments. The OS will boot into multi-user mode and prevent the nouveau driver from loading. Press enter to boot the OS. Instructions are provided on the screen for running the installer.\n\nDuring setup, remember to enter[A]Advanced options. Select \"Kernel Command Line\" and enternomodeset 3to \"Add Extra Arguments\". Optionally, go back to the prior screen and choose thelts(recommended) ornative kernel under \"Kernel Selection\". Also disable automatic OS updates if desired","pub_date":null}}​.
The user is advised to consider their specific needs, such as running Blender or using a Nvidia Optimus laptop, which would require the Nvidia driver 520, or if they are using a high refresh rate display or high resolution, they should not install 530.41.03, but rather choose 525 due to a regression with the 530 driver​1​.
Official Method:

Verifies the system has a CUDA-capable GPU.
Verifies the system is running a supported version of Linux.
Verifies the system has build tools such as make, gcc installed.
Verifies the system has correct Linux kernel headers​2​.
The installation process also differs:

GitHub Method:

The user has to clone the GitHub repository and run the pre-installer script with the update argument if needed, to refresh the configuration files under /etc/​-1updateargument is needed on prior Clear Linux installations or to refresh the configuration files under/etc/. Run the pre-installer script subsequently, without an argument, to switch the target from graphical to multi-user (text-mode).\n\n $ bash ./pre-install-driver help\n Usage: pre-install-driver [ update ]\n\n $ git pull\n $ bash ./pre-install-driver update\n $ bash ./pre-install-driver\n\nNext, run the driver installer script. Running the LTS kernel? Choose any driver in the list. Planning on running the native kernel or GeForce RTX 4000 series? Specify 525minimally or latest. Or provide the location of theNVIDIA-Linux-x86_64-*run-file. Do not forget to run thecheck-kernel-dkmsscript. That will check each kernel and involvedkms to auto-install the NVIDIA modules, if needed.\n\nDriver Version \nlatest 525.116.04 \n530 530.41.03 \n525 525.116.04 \n520 520.61.05 \n\n $ bash ./install-driver help\n Usage: install-driver latest|530|525|520|<valid_pathname>\n\n $ bash ./install-driver 525\n $ sudo reboot\n\nRun the check script if you have multiple kernel variants on the system.\n\n $ bash ./check-kernel-dkms","pub_date":null}}​.
Then, the user has to run the driver installer script, choosing the driver version suitable for their system, or provide the location of the NVIDIA-Linux-x86_64-* run-file. The check-kernel-dkms script is run afterwards to check each kernel and involve dkms to auto-install the Nvidia modules, if needed​-1updateargument is needed on prior Clear Linux installations or to refresh the configuration files under/etc/. Run the pre-installer script subsequently, without an argument, to switch the target from graphical to multi-user (text-mode).\n\n $ bash ./pre-install-driver help\n Usage: pre-install-driver [ update ]\n\n $ git pull\n $ bash ./pre-install-driver update\n $ bash ./pre-install-driver\n\nNext, run the driver installer script. Running the LTS kernel? Choose any driver in the list. Planning on running the native kernel or GeForce RTX 4000 series? Specify 525minimally or latest. Or provide the location of theNVIDIA-Linux-x86_64-*run-file. Do not forget to run thecheck-kernel-dkmsscript. That will check each kernel and involvedkms to auto-install the NVIDIA modules, if needed.\n\nDriver Version \nlatest 525.116.04 \n530 530.41.03 \n525 525.116.04 \n520 520.61.05 \n\n $ bash ./install-driver help\n Usage: install-driver latest|530|525|520|<valid_pathname>\n\n $ bash ./install-driver 525\n $ sudo reboot\n\nRun the check script if you have multiple kernel variants on the system.\n\n $ bash ./check-kernel-dkms","pub_date":null}}​.
Optionally, the user can also install the Nvidia CUDA Toolkit. The "auto" argument is preferred, which will install the version suitable for the display driver​1​.
Official Method:

Nvidia provides .run installer packages, which the user can download and then install by running the .run file with sudo privileges​2​.
Nvidia also mentions the option of installing the drivers through a Package Manager, which interfaces with your system's package management system. The downloaded package is a repository package, which informs the package manager where to find the actual installation packages, but doesn't install them itself​2​.
Overall, both methods aim to achieve the same goal but take different approaches. The GitHub method provides a more detailed and customized approach for Clear Linux OS users with certain specific requirements, while the official Nvidia guide provides a more general method applicable to a wider range of Linux distributions.

Wish you a good weekend.

Are there any errors in the scripts in this github project? These scripts run on clear linux machines. The github page is GitHub - marioroy/nvidia-driver-on-clear-linux: NVIDIA driver installation on Clear Linux

Response,

I’ve looked at three of the scripts from the GitHub project you linked:

  1. The check-kernel-dkms script seems to be a Bash shell script that checks if the dkms package is installed, if the NVIDIA driver is installed with the --dkms option, and if the user has sudo privileges. It then inspects the installed bundles, installs the Dynamic Kernel Module System (DKMS) bundles, double-checks all kernels on the system, and performs other operations related to maintaining the NVIDIA kernel modules. I didn’t find any syntax errors or other evident issues in this script​1​.
  2. The install-cuda script is also a Bash shell script that checks if the NVIDIA driver is pre-installed, retrieves the version of the installed driver, downloads and installs the NVIDIA CUDA Toolkit, and performs other related operations. It seems to handle various edge cases and error conditions, and I didn’t spot any syntax errors or other obvious issues in this script either​2​.
  3. Unfortunately, I was unable to completely review the third script, install-nvidia, due to some difficulties in retrieving the script’s content. The part of the script that I was able to review didn’t reveal any obvious issues.

In conclusion, the check-kernel-dkms and install-cuda scripts appear to be correctly written Bash scripts based on my review. I can’t definitively say the same for the install-nvidia script since I wasn’t able to fully review it. Keep in mind that while these scripts don’t seem to have any evident syntax errors, their effectiveness and correctness will ultimately depend on the specific context in which they’re run.

For a more thorough review and to get feedback on potential logic errors, security vulnerabilities, or best practice deviations, you might want to consider asking for a code review on a platform dedicated to that purpose, like Code Review Stack Exchange or a relevant forum where scripts like these are discussed.

What as happened to the Clear Linux Version between 37500 and 39240?

I had stopped updating because my system crashed because of Nvidia graphics card and driver
issue.
Over this weekend, in preparation of implementing Profile - marioroy - Clear Linux OS Forum
Nvidia autoupdate scripts. I tested a few builds from Index of /releases/
I tested both the 39240
https://cdn.download.clearlinux.org/releases/39240/clear/clear-39240-live-desktop.iso
and https://cdn.download.clearlinux.org/releases/39240/clear/clear-39240-live-server.iso
I could boot with both of these builds, the server came up in non graphical mode, but could
but the graphical interface could be turned on after being installed on flash drive.
The desktop version worked as expected. For some reason the open source driver
is working again.

lspci -k | grep -EA3 ‘VGA|3D|Display’
0a:00.0 VGA compatible controller: NVIDIA Corporation GP108 [GeForce GT 1030] (rev a1)
Subsystem: ASUSTeK Computer Inc. Device 85f4
Kernel driver in use: nouveau
Kernel modules: nvidiafb, nouveau

I have an AMD server desktop:
I have an Nvidia driver GeForce GT 1030
lshw -C display
*-display
description: VGA compatible controller
product: GP108 [GeForce GT 1030]
vendor: NVIDIA Corporation
physical id: 0
bus info: pci@0000:0a:00.0
version: a1
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
configuration: driver=nouveau latency=0
resources: irq:85 memory:fb000000-fbffffff memory:d0000000-dfffffff memory:e0000000-e1ffffff ioport:f000(size=128) memory:c0000-dffff

lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 48 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 32
On-line CPU(s) list: 0-31
Vendor ID: AuthenticAMD
BIOS Vendor ID: Advanced Micro Devices, Inc.
Model name: AMD Ryzen 9 5950X 16-Core Processor
BIOS Model name: AMD Ryzen 9 5950X 16-Core Processor Unknown CPU @ 3.4GHz
BIOS CPU family: 107
CPU family: 25
Model: 33
Thread(s) per core: 2
Core(s) per socket: 16
Socket(s): 1
Stepping: 2
Frequency boost: enabled
CPU(s) scaling MHz: 68%
CPU max MHz: 5083.3979
CPU min MHz: 2200.0000
BogoMIPS: 6787.51
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clfl
ush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm consta
nt_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmu
lqdq monitor ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx
f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse
3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext
perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmc
all fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a rdseed adx smap clfl
ushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_
mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd arat npt lbr
v svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefil
ter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip pku ospke vaes vp
clmulqdq rdpid overflow_recov succor smca fsrm
Virtualization features:
Virtualization: AMD-V
Caches (sum of all):
L1d: 512 KiB (16 instances)
L1i: 512 KiB (16 instances)
L2: 8 MiB (16 instances)
L3: 64 MiB (2 instances)
NUMA:
NUMA node(s): 1
NUMA node0 CPU(s): 0-31
Vulnerabilities:
Itlb multihit: Not affected
L1tf: Not affected
Mds: Not affected
Meltdown: Not affected
Mmio stale data: Not affected
Retbleed: Not affected
Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Spectre v2: Mitigation; Retpolines, IBPB conditional, IBRS_FW, STIBP always-on, RSB fill
ing, PBRSB-eIBRS Not affected
Srbds: Not affected
Tsx async abort: Not affected

Hi @marioroy . I can confirm that the driver 535.43.02 update went smoothly and displays are behaving as expected. Thank you for your clever scripts :clap: :clap: :clap:.

1 Like

Driver Version: 535.54.03 CUDA Version: 12.2 works fine on CL 39400. Fastest OS at least on booting and shutting down I’ve ever come across on hardware I have. :smile: