Nvidia-driver-latest-dkms vs nvidia-driver-latest

I would like to install CUDA in my centos7. After checking some resources, I find the below 2 ways:

  1. yum install nvidia-driver-latest-dkms → yum install cuda → install cuda-drivers
  2. yum install cuda-drivers ( install nvidia-driver-latest package ) → yum install cuda

Are there some differences between them? I understand that #1 uses dkms and #2 doesn’t. If dkms package is used, then kernel update would not break the driver. Is my understanding correct?

Thanks.

First of all, don’t install “cuda” but cuda-toolkit. The “cuda” metapackage also includes the driver.
The non-dkms package includes pre-compiled kernel modules, so they will be updated alongside the kernel. Those are only available for the stock kernel.

Thanks for your response.
I don’t understand for “don’t install “cuda” but cuda-toolkit”. Did you mean directly using the command “yum install cuda” to install both driver and toolkit?

No. If you want to take control over which driver gets installed, use yum install cuda-toolkit after installing the nvidia driver.
https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#package-manager-metas

Thanks again.
So can I use yum install cuda-drivers to install driver and then use yum install cuda-toolkit? As this is a easier way.

The cuda driver is part of the nvidia-driver (libcuda.so) so I don’t really know why you would want to start with that.

Per doc Release Notes :: CUDA Toolkit Documentation (nvidia.com), it says “For convenience, the NVIDIA driver is installed as part of the CUDA Toolkit installation.”.

So may I know why “yum install cuda” can not be used to install both driver and toolkit?

If you want to take control over which driver gets installed, use yum install cuda-toolkit after installing the nvidia driver.

If you don’t care which driver gets installed then you can just install full “cuda” and call it a day. But then I don’t understand your initial question.

Sorry for confusion. Please allow me to clarify here:

  1. The full cuda package is found to install non-dkms nvidia driver when using “yum install cuda”
  2. Some of online resources use "yum install nvidia-driver-latest-dkms " to install the driver, and then install other components

So I posted my initial question here to see what’s the difference between these 2 drivers, non-dkms vs dkms.

I ran the command “yum install cuda” on my centos7, and found the following in the output:

→ Finished Dependency Resolution
NVIDIA: No kernel module package kmod-nvidia-latest for kernel-3.10.0-1160.59.1.el7.x86_64 and 3:nvidia-driver-latest-510.47.03-1.el7.x86_64 found. Ignoring the new kernel

Then it installed kmod-nvidia-latest-dkms.

As per our previous discussion, “yum install cuda” uses nvidia-driver-latest package, which includes pre-compiled kernel modules. When the pre-compiled kernel modules like kmod-nvidia-latest is not availble, it installs kmod-nvidia-latest-dkms.

So is this by design? Thanks.