1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: Apache-2.0
5 - name: Install NVIDIA package pins
7 src: arvados-nvidia.pref
8 dest: /etc/apt/preferences.d/arvados-nvidia.pref
12 when: "arvados_compute_pin_packages|bool"
14 - name: Install NVIDIA CUDA apt repository
16 deb: "https://developer.download.nvidia.com/compute/cuda/repos/{{ ansible_distribution|lower }}{{ ansible_distribution_major_version }}{{ ansible_distribution_minor_version if ansible_distribution == 'Ubuntu' else '' }}/{{ ansible_architecture }}/cuda-keyring_1.1-1_all.deb"
17 register: cuda_apt_task
19 - name: Install NVIDIA container toolkit apt repository
20 ansible.builtin.deb822_repository:
21 name: nvidia-container-toolkit
23 uris: "{{ nvidia_container_apt_url }}/stable/deb/$(ARCH)"
25 signed_by: "{{ nvidia_container_apt_url }}/gpgkey"
26 register: nvidia_apt_task
28 - name: Install NVIDIA packages
30 update_cache: "{{ cuda_apt_task.changed or nvidia_apt_task.changed }}"
33 - libnvidia-container1
34 - libnvidia-container-tools
35 - nvidia-container-toolkit
37 - name: Copy nvidia.conf modules to nvidia.avail
39 src: /etc/modules-load.d/nvidia.conf
40 dest: /etc/modules-load.d/nvidia.avail
43 - name: Remove nvidia.conf modules from autoloading
45 dest: /etc/modules-load.d/nvidia.conf
48 - name: Install dynamic module loading script
51 dest: /usr/local/sbin/detect-gpu.sh
56 - name: Prepare systemd-modules-load override directory
58 path: /etc/systemd/system/systemd-modules-load.service.d
64 - name: Install dynamic module load hook
67 dest: /etc/systemd/system/systemd-modules-load.service.d/arvados-detect-gpu.conf
72 # crunch-run has its own CUDA initialization code.
73 # We prefer to use that over NVIDIA's.
74 - name: Query nvidia-persistenced.service
75 ansible.builtin.systemd_service:
76 name: nvidia-persistenced.service
77 register: nvidia_persistenced
79 - name: Disable nvidia-persistenced.service
80 when: "nvidia_persistenced.status.LoadState != 'not-found'"
81 ansible.builtin.systemd_service:
82 name: nvidia-persistenced.service