From 996442da25bffd7d42db7ae3cbf8035dcc159bf7 Mon Sep 17 00:00:00 2001 From: Adam DeConinck Date: Tue, 14 Dec 2021 22:21:03 +0000 Subject: [PATCH] Align driver branch across all installs and update to r470 --- README.md | 3 +-- defaults/main.yml | 9 +++++++-- tasks/install-redhat.yml | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6625ede..551087b 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ $ ansible-galaxy install nvidia.nvidia_driver | `nvidia_driver_skip_reboot` | `no` | Whether to skip rebooting the node during the install | | `nvidia_driver_module_file` | `"/etc/modprobe.d/nvidia.conf"` | Filename to use for NVIDIA driver parameters | | `nvidia_driver_module_params` | `""` | Parameters to pass to the NVIDIA driver | +| `nvidia_driver_branch` | `"470"` | Default driver branch to install | ### Red Hat specific variables @@ -50,8 +51,6 @@ By default, the Canonical repositories will be used, and the driver installed wi | Variable | Default value | Description | | -------- | ------------- | ----------- | | `nvidia_driver_ubuntu_install_from_cuda_repo` | `no` | Flag whether to use the CUDA repo | -| `nvidia_driver_ubuntu_branch` | `450` | Driver branch to use for the install | -| `nvidia_driver_ubuntu_packages` | `["nvidia-headless-450-server", "nvidia-headless-450-utils"]` | Package names to install from Canonical repo | | `nvidia_driver_ubuntu_cuda_repo_baseurl` | `"http://developer.download.nvidia.com/compute/cuda/repos/{{ _ubuntu_repo_dir }}"` | Base URL to use for CUDA repo | | `nvidia_driver_ubuntu_cuda_repo_gpgkey_url` | `"https://developer.download.nvidia.com/compute/cuda/repos/{{ _ubuntu_repo_dir }}/7fa2af80.pub"` | GPG key for the CUDA repo | | `nvidia_driver_ubuntu_cuda_repo_gpgkey_id` | `"7fa2af80"` | GPG key ID for the CUDA repo | diff --git a/defaults/main.yml b/defaults/main.yml index d6764de..b498509 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -5,6 +5,7 @@ nvidia_driver_skip_reboot: no nvidia_driver_module_file: /etc/modprobe.d/nvidia.conf nvidia_driver_module_params: '' nvidia_driver_add_repos: yes +nvidia_driver_branch: "470" ############################################################################## @@ -15,16 +16,20 @@ epel_repo_key: "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ ansibl nvidia_driver_rhel_cuda_repo_baseurl: "https://developer.download.nvidia.com/compute/cuda/repos/{{ _rhel_repo_dir }}/" nvidia_driver_rhel_cuda_repo_gpgkey: "https://developer.download.nvidia.com/compute/cuda/repos/{{ _rhel_repo_dir }}/7fa2af80.pub" +nvidia_driver_rhel_branch: "{{ nvidia_driver_branch }}" + ############################################################################## # Ubuntu # ############################################################################## +# Driver branch to install with Ubuntu +nvidia_driver_ubuntu_branch: "{{ nvidia_driver_branch }}" + # Determine if we should install from CUDA repo instead of Canonical repos nvidia_driver_ubuntu_install_from_cuda_repo: no # Installing with Canonical repositories -nvidia_driver_ubuntu_branch: "450" nvidia_driver_ubuntu_packages: - "nvidia-headless-{{ nvidia_driver_ubuntu_branch }}-server" - "nvidia-utils-{{ nvidia_driver_ubuntu_branch }}-server" @@ -35,4 +40,4 @@ nvidia_driver_ubuntu_packages: nvidia_driver_ubuntu_cuda_repo_gpgkey_url: "https://developer.download.nvidia.com/compute/cuda/repos/{{ _ubuntu_repo_dir }}/7fa2af80.pub" nvidia_driver_ubuntu_cuda_repo_gpgkey_id: "7fa2af80" nvidia_driver_ubuntu_cuda_repo_baseurl: "https://developer.download.nvidia.com/compute/cuda/repos/{{ _ubuntu_repo_dir }}" -nvidia_driver_ubuntu_cuda_package: "cuda-drivers" +nvidia_driver_ubuntu_cuda_package: "cuda-drivers-{{ nvidia_driver_ubuntu_branch }}" diff --git a/tasks/install-redhat.yml b/tasks/install-redhat.yml index d72f37b..b20f34e 100644 --- a/tasks/install-redhat.yml +++ b/tasks/install-redhat.yml @@ -57,7 +57,7 @@ - name: install driver packages RHEL/CentOS 7 and older yum: - name: "{{ nvidia_driver_package_version | ternary('nvidia-driver-latest-dkms-'+nvidia_driver_package_version, 'nvidia-driver-latest-dkms') }}" + name: "{{ nvidia_driver_package_version | ternary('nvidia-driver-latest-dkms-'+nvidia_driver_package_version, 'nvidia-driver-branch-'+nvidia_driver_rhel_branch) }}" state: "{{ nvidia_driver_package_state }}" autoremove: "{{ nvidia_driver_package_state == 'absent' }}" register: install_driver_rhel7 @@ -66,7 +66,7 @@ - name: install driver packages RHEL/CentOS 8 and newer dnf: - name: "{{ nvidia_driver_package_version | ternary('@nvidia-driver:'+nvidia_driver_package_version, '@nvidia-driver:latest-dkms') }}" + name: "{{ nvidia_driver_package_version | ternary('@nvidia-driver:'+nvidia_driver_package_version, '@nvidia-driver:'+nvidia_driver_rhel_branch+'-dkms') }}" state: "{{ nvidia_driver_package_state }}" autoremove: "{{ nvidia_driver_package_state == 'absent' }}" register: install_driver_rhel8