I’ve written a script to prevent me from stuffing up my nvidia/cuda/kernel combination of packages. It has only been used for the G06 and G07 OpenSUSE packaged signed nvidia and cuda drivers, I don’t have the environments necessary to test for any others, but it might be made to work with them. I just put it up as agist in case it might help others: nvidia_OpenSUSE_Gxx_updater.bash gist at github
The approach taken is to zypper-lock everything that can get out of sync: the kernel, the Gxx driver, the supporting
packages, and the other non-application Gxx drivers.
When run,
- The script checks what is currently installed against what is available via zypper-search.
- The script identifies matching versions of kernel, driver, and supporting packages.
- Once all update requirements are matched, it will offer to update (or report it’s not possible or not necessary).
- Only then will it remove selective locks, upgrade packages to specific versions (not simply the latest), and then restore the locks.
First time use: run/sudo the script to put in place the necessary locks - it details what it’s going to do and prompts for permission.
Subsequent use:
- Use zypper dup as per normal, the locks prevent any kernel and driver updates.
- After a dup also run/sudo the script which will determine if a kernel+driver pairing is available, and optionally perform the updates.
The script won’t make any changes without first detailing them and prompting for permission.
I normally also backup my OS partition before zypper-dups.
Output from a sample run:
kosmos1:~ # bash ~michael/OpenSUSE-Installs-Local/nvidia_OpenSUSE_Gxx_updater.bash
INFO: OpenSUSE Open Gxx Nvidia driver update script - for desktop PC with a modern Nvidia card
WARNING: This scripts adds zypper locks to prevent zypper dup from updating the kernel and driver
INFO: reading config from /root/.config/nvidia_open_Gxx_updater/kosmos1.gentoo.co.nz
NVIDIA_REPO='cuda'
GXX_VARIANT='G07'
NVIDIA_DRIVER_NAME='nvidia-open-driver-G07-signed-cuda-kmp-default'
LOCK_KERNEL_AND_DRIVER=y
LOCK_OTHER_GXX=y
INFO: GPU: GA106 [GeForce RTX 3060 Lite Hash Rate] (rev a1)
INFO: Detected Nvidia proprietary repo: cuda
INFO: config NVIDIA_REPO='cuda'
>>>> Nvidia repo name? (cuda)
INFO: Nvidia driver OpenSUSE package variant G07 already installed.
INFO: config GXX_VARIANT='G07'
>>>> Nvidia driver OpenSUSE package variant? [G07/G06/G05/G04] (G07)
INFO: Nvidia repo: cuda
INFO: Nvidia driver OpenSUSE package variant: G07
INFO: OpenSUSE Nvidia Gxx driver default: nvidia-open-driver-G07-signed-cuda-kmp-default
INFO: Supporting packages: nvidia-video-Gxx nvidia-compute-utils-Gxx nvidia-persistenced
INFO: config NVIDIA_DRIVER_NAME='nvidia-open-driver-G07-signed-cuda-kmp-default'
>>>> Nvidia driver name: (nvidia-open-driver-G07-signed-cuda-kmp-default)
INFO: Linux kernel package: kernel-default
INFO: Nvidia driver OpenSUSE package: nvidia-open-driver-G07-signed-cuda-kmp-default
INFO: Current kernel version: 6.19.2
INFO: Installed version of nvidia-open-driver-G07-signed-cuda-kmp-default is 590.48.01_k6.19.2_1
INFO: Available version of nvidia-open-driver-G07-signed-cuda-kmp-default is 590.48.01_k6.19.2_1
INFO: Required kernel is kernel-default 6.19.2
INFO: Required kernel-default 6.19.2 is available
INFO: Supporting nvidia-video-G07-590.48.01 is already installed (from cuda repo)
INFO: Supporting nvidia-compute-utils-G07-590.48.01 is already installed (from cuda repo)
INFO: Supporting nvidia-persistenced-590.48.01 is already installed (from cuda repo)
INFO: Supporting packages already up to date for 590.48.01_k6.19.2_1.
INFO: Required Linux kernel 6.19.2 already installed
>>>> No Nvidia updates required/available, proceed anyway (to setup locks perhaps)? [y/n]? (n) y
INFO: config LOCK_KERNEL_AND_DRIVER=y
>>>> Lock down Linux kernel kernel-* and G07 packages to keep them in sync? [y/n]? (y) y
+ zypper al 'kernel-*' '*nvidia*G07*'
INFO: config LOCK_OTHER_GXX=y
>>>> Lock down other Gxx packages to keep them from erroneously being picked up by zypper dup? [y/n]? (y) y
+ zypper al '*nvidia*G06*'
+ zypper al '*nvidia*G05*'
+ zypper al '*nvidia*G04*'
INFO: Package list: kernel-default == 6.19.2 kernel-default-devel == 6.19.2 nvidia-open-driver-G07-signed-cuda-kmp-default == 590.48.01_k6.19.2_1 nvidia-video-G07 == 590.48.01 nvidia-compute-utils-G07 == 590.48.01 nvidia-persistenced == 590.48.01
INFO: Proposed zypper commands:
zypper --quiet rl "kernel-*" "*nvidia*G07*"
zypper --no-refresh install --no-allow-vendor-change kernel-default == 6.19.2 kernel-default-devel == 6.19.2 nvidia-open-driver-G07-signed-cuda-kmp-default == 590.48.01_k6.19.2_1 nvidia-video-G07 == 590.48.01 nvidia-compute-utils-G07 == 590.48.01 nvidia-persistenced == 590.48.01
zypper --quiet al "kernel-*" "*nvidia*G07*"
>>>> Perform updates? [y/n]? (n) n
INFO: finished