Nvidia driver load previous Kernel?

Can you help me understand what is necessary to have nvidia drivers load on a previous kernel following a kernel upgrade?

Reading it would seem nvidia dkms driver + dkms + kernel headers should take care of it all?

On mint 22.1 (Ubuntu 24.04) + 5070 ti

Nvidia 570 driver was working on kernel 6.11.0-24.
Then updated to 6.11.0-25-generic kernel and rebooted. Then installed Nvidia 575 driver via Mint’s driver manager. Rebooted. Had issues with Proton. So rolled back to Nvidia 570 via Driver Manager while using 6.11.0-25 kernel.

Nvidia 570 working fine on 6.11.0-25 , but now whenever I boot previous 6.11.0-24-generic nvidia driver doesn’t load. Rather nouveau driver loads despite it being blacklisted in /lib/modprobe.d/nvidia-graphics-drivers.conf

Kernel has cmdline: nvidia_drm.fbdev=1

ii  libnvidia-cfg1-570:amd64                       570.133.20-0ubuntu1                        amd64        NVIDIA binary OpenGL/GLX configuration library
ii  libnvidia-common-570                           570.133.20-0ubuntu1                        all          Shared files used by the NVIDIA libraries
rc  libnvidia-compute-535:amd64                    535.247.01-0ubuntu1                        amd64        NVIDIA libcompute package
ii  libnvidia-compute-570:amd64                    570.133.20-0ubuntu1                        amd64        NVIDIA libcompute package
ii  libnvidia-compute-570:i386                     570.133.20-0ubuntu1                        i386         NVIDIA libcompute package
ii  libnvidia-decode-570:amd64                     570.133.20-0ubuntu1                        amd64        NVIDIA Video Decoding runtime libraries
ii  libnvidia-decode-570:i386                      570.133.20-0ubuntu1                        i386         NVIDIA Video Decoding runtime libraries
ii  libnvidia-encode-570:amd64                     570.133.20-0ubuntu1                        amd64        NVENC Video Encoding runtime library
ii  libnvidia-encode-570:i386                      570.133.20-0ubuntu1                        i386         NVENC Video Encoding runtime library
ii  libnvidia-extra-570:amd64                      570.133.20-0ubuntu1                        amd64        Extra libraries for the NVIDIA driver
ii  libnvidia-fbc1-570:amd64                       570.133.20-0ubuntu1                        amd64        NVIDIA OpenGL-based Framebuffer Capture runtime library
ii  libnvidia-fbc1-570:i386                        570.133.20-0ubuntu1                        i386         NVIDIA OpenGL-based Framebuffer Capture runtime library
ii  libnvidia-gl-570:amd64                         570.133.20-0ubuntu1                        amd64        NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii  libnvidia-gl-570:i386                          570.133.20-0ubuntu1                        i386         NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii  libnvidia-ml-dev:amd64                         12.0.140~12.0.1-4build4                    amd64        NVIDIA Management Library (NVML) development files
ii  nvidia-compute-utils-570                       570.133.20-0ubuntu1                        amd64        NVIDIA compute utilities
ii  nvidia-cuda-dev:amd64                          12.0.146~12.0.1-4build4                    amd64        NVIDIA CUDA development files
ii  nvidia-cuda-gdb                                12.0.140~12.0.1-4build4                    amd64        NVIDIA CUDA Debugger (GDB)
ii  nvidia-cuda-toolkit                            12.0.140~12.0.1-4build4                    amd64        NVIDIA CUDA development toolkit
ii  nvidia-cuda-toolkit-doc                        12.0.1-4build4                             all          NVIDIA CUDA and OpenCL documentation
rc  nvidia-dkms-570                                570.124.06-0ubuntu1                        amd64        NVIDIA DKMS package
ii  nvidia-dkms-570-open                           570.133.20-0ubuntu1                        amd64        NVIDIA DKMS package (open kernel module)
ii  nvidia-driver-570-open                         570.133.20-0ubuntu1                        amd64        NVIDIA driver (open kernel) metapackage
ii  nvidia-firmware-570-570.133.20                 570.133.20-0ubuntu1                        amd64        Firmware files used by the kernel module
ii  nvidia-kernel-common-570                       570.133.20-0ubuntu1                        amd64        Shared files used with the kernel module
ii  nvidia-kernel-source-570-open                  570.133.20-0ubuntu1                        amd64        NVIDIA kernel source package
ii  nvidia-modprobe                                575.51.03-0ubuntu1                         amd64        Load the NVIDIA kernel driver and create device files
ii  nvidia-opencl-dev:amd64                        12.0.140~12.0.1-4build4                    amd64        NVIDIA OpenCL development files
ii  nvidia-prime-applet                            1.4.4                                      all          An applet for NVIDIA Prime
ii  nvidia-profiler                                12.0.146~12.0.1-4build4                    amd64        NVIDIA Profiler for CUDA and OpenCL
ii  nvidia-settings                                575.51.03-0ubuntu1                         amd64        Tool for configuring the NVIDIA graphics driver
ii  nvidia-utils-570                               570.133.20-0ubuntu1                        amd64        NVIDIA driver support binaries
ii  nvidia-visual-profiler                         12.0.146~12.0.1-4build4                    amd64        NVIDIA Visual Profiler for CUDA and OpenCL
ii  screen-resolution-extra                        0.18.3                                     all          Extension for the nvidia-settings control panel
ii  xserver-xorg-video-nvidia-570                  570.133.20-0ubuntu1                        amd64        NVIDIA binary Xorg driver

ii  libcudnn9-dev-cuda-12                          9.9.0.52-1                                 amd64        cuDNN development headers and symlinks for CUDA 12.9
ii  libx11-dev:amd64                               2:1.8.7-1build1                            amd64        X11 client-side library (development headers)
ii  libxau-dev:amd64                               1:1.0.9-1build6                            amd64        X11 authorisation library (development headers)
ii  libxdmcp-dev:amd64                             1:1.1.3-0ubuntu6                           amd64        X11 authorisation library (development headers)
ii  linux-generic                                  6.8.0-59.61                                amd64        Complete Generic Linux kernel and headers
ii  linux-generic-hwe-24.04                        6.11.0-25.25~24.04.1                       amd64        Complete Generic Linux kernel and headers
ii  linux-headers-6.11.0-19-generic                6.11.0-19.19~24.04.1                       amd64        Linux kernel headers for version 6.11.0 on 64 bit x86 SMP
ii  linux-headers-6.11.0-21-generic                6.11.0-21.21~24.04.1                       amd64        Linux kernel headers for version 6.11.0 on 64 bit x86 SMP
ii  linux-headers-6.11.0-24-generic                6.11.0-24.24~24.04.1                       amd64        Linux kernel headers for version 6.11.0 on 64 bit x86 SMP
ii  linux-headers-6.11.0-25-generic                6.11.0-25.25~24.04.1                       amd64        Linux kernel headers for version 6.11.0 on 64 bit x86 SMP
ii  linux-headers-6.8.0-51                         6.8.0-51.52                                all          Header files related to Linux kernel version 6.8.0
ii  linux-headers-6.8.0-51-generic                 6.8.0-51.52                                amd64        Linux kernel headers for version 6.8.0 on 64 bit x86 SMP
ii  linux-headers-6.8.0-55                         6.8.0-55.57                                all          Header files related to Linux kernel version 6.8.0
ii  linux-headers-6.8.0-55-generic                 6.8.0-55.57                                amd64        Linux kernel headers for version 6.8.0 on 64 bit x86 SMP
ii  linux-headers-6.8.0-56                         6.8.0-56.58                                all          Header files related to Linux kernel version 6.8.0
ii  linux-headers-6.8.0-56-generic                 6.8.0-56.58                                amd64        Linux kernel headers for version 6.8.0 on 64 bit x86 SMP
ii  linux-headers-6.8.0-57                         6.8.0-57.59                                all          Header files related to Linux kernel version 6.8.0
ii  linux-headers-6.8.0-57-generic                 6.8.0-57.59                                amd64        Linux kernel headers for version 6.8.0 on 64 bit x86 SMP
ii  linux-headers-6.8.0-58                         6.8.0-58.60                                all          Header files related to Linux kernel version 6.8.0
ii  linux-headers-6.8.0-58-generic                 6.8.0-58.60                                amd64        Linux kernel headers for version 6.8.0 on 64 bit x86 SMP
ii  linux-headers-6.8.0-59                         6.8.0-59.61                                all          Header files related to Linux kernel version 6.8.0
ii  linux-headers-6.8.0-59-generic                 6.8.0-59.61                                amd64        Linux kernel headers for version 6.8.0 on 64 bit x86 SMP
ii  linux-headers-generic                          6.8.0-59.61                                amd64        Generic Linux kernel headers
ii  linux-headers-generic-hwe-24.04                6.11.0-25.25~24.04.1                       amd64        Generic Linux kernel headers
ii  linux-hwe-6.11-headers-6.11.0-19               6.11.0-19.19~24.04.1                       all          Header files related to Linux kernel version 6.11.0
ii  linux-hwe-6.11-headers-6.11.0-21               6.11.0-21.21~24.04.1                       all          Header files related to Linux kernel version 6.11.0
ii  linux-hwe-6.11-headers-6.11.0-24               6.11.0-24.24~24.04.1                       all          Header files related to Linux kernel version 6.11.0
ii  linux-hwe-6.11-headers-6.11.0-25               6.11.0-25.25~24.04.1                       all          Header files related to Linux kernel version 6.11.0
ii  opencl-c-headers                               3.0~2023.12.14-1                           all          OpenCL (Open Computing Language) C header files
ii  opencl-clhpp-headers                           3.0~2023.12.14-1ubuntu1                    all          C++ headers for OpenCL development
ii  x11proto-dev                                   2023.2-1                                   all          X11 extension protocols and auxiliary headers

dkms status

blksnap/6.3.1.1016, 6.11.0-19-generic, x86_64: installed
blksnap/6.3.1.1016, 6.11.0-21-generic, x86_64: installed
blksnap/6.3.1.1016, 6.11.0-24-generic, x86_64: installed
blksnap/6.3.1.1016, 6.11.0-25-generic, x86_64: installed
blksnap/6.3.1.1016, 6.8.0-56-generic, x86_64: installed
blksnap/6.3.1.1016, 6.8.0-57-generic, x86_64: installed
blksnap/6.3.1.1016, 6.8.0-58-generic, x86_64: installed
blksnap/6.3.1.1016, 6.8.0-59-generic, x86_64: installed
nvidia/570.133.20, 6.11.0-25-generic, x86_64: installed

I do see driver for previous 6.11.0-24 kernel here:
/lib/modules/6.11.0-24-generic/kernel/drivers/video/fbdev/nvidia/nvidiafb.ko.zst

Any insight would be appreciated.
I really want peace of mind that if I upgrade kernel, that I can always boot previous kernel with nvidia functional.

I tried uninstall + reinstall of 6.11.0-24-generic. This got nvidia driver registered with DKMS and working with 6.11.0-24

I then found the proper solution is here:
https://wiki.archlinux.org/title/Dynami … le_Support

Tried with 6.11.0-21-generic and working:

sudo dkms install -m nvidia -v 570.133.07 -k 6.11.0-21-generic

Have dkms installed + nvidia-dkms-xxx-open installed (included in nvidia-driver-570-open) + kernel headers installed.
Replace -v with your nvidia driver version and -k with kernel version you want to recompile driver for. (Or the --all to do it for every kernel.)

dkms status
Should now show it installed for previous kernels.

blksnap/6.3.1.1016, 6.11.0-19-generic, x86_64: installed
blksnap/6.3.1.1016, 6.11.0-21-generic, x86_64: installed
blksnap/6.3.1.1016, 6.11.0-24-generic, x86_64: installed
blksnap/6.3.1.1016, 6.11.0-25-generic, x86_64: installed
blksnap/6.3.1.1016, 6.8.0-56-generic, x86_64: installed
blksnap/6.3.1.1016, 6.8.0-57-generic, x86_64: installed
blksnap/6.3.1.1016, 6.8.0-58-generic, x86_64: installed
blksnap/6.3.1.1016, 6.8.0-59-generic, x86_64: installed
nvidia/570.133.07, 6.11.0-21-generic, x86_64: installed
nvidia/570.133.07, 6.11.0-24-generic, x86_64: installed
nvidia/570.133.07, 6.11.0-25-generic, x86_64: installed

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.