@@ -134,54 +134,32 @@ deployment_groups:
134134 * - nofile 1048576
135135 * - cpu unlimited
136136 * - rtprio unlimited
137-
137+ - type : shell
138+ destination : install-cuda-toolkit.sh
139+ content : |
140+ #!/bin/bash
141+ set -e -o pipefail
142+ add-nvidia-repositories -y
143+ apt install -y cuda-toolkit-12-8
144+ apt install -y datacenter-gpu-manager-4-cuda12
138145 - type : ansible-local
139- destination : install_cuda_dcgm .yml
146+ destination : settings_nvidia_dcgm .yml
140147 content : |
141148 ---
142- - name: Install CUDA & DCGM
149+ - name: Nvidia and DGMA settings
143150 hosts: all
144151 become: true
145- vars:
146- distribution: "{{ ansible_distribution | lower }}{{ ansible_distribution_version | replace('.','') }}"
147- cuda_repo_url: https://developer.download.nvidia.com/compute/cuda/repos/{{ distribution }}/x86_64/cuda-keyring_1.1-1_all.deb
148- cuda_repo_filename: /tmp/{{ cuda_repo_url | basename }}
149- enable_nvidia_dcgm: false
150- nvidia_packages:
151- - cuda-toolkit-12-8
152- - datacenter-gpu-manager-4-cuda12
153152 tasks:
154- - name: Download NVIDIA repository package
155- ansible.builtin.get_url:
156- url: "{{ cuda_repo_url }}"
157- dest: "{{ cuda_repo_filename }}"
158- - name: Install NVIDIA repository package
159- ansible.builtin.apt:
160- deb: "{{ cuda_repo_filename }}"
161- state: present
162153 - name: Reduce NVIDIA repository priority
163154 ansible.builtin.copy:
164155 dest: /etc/apt/preferences.d/cuda-repository-pin-600
165156 mode: 0o0644
166157 owner: root
167158 group: root
168159 content: |
169- Package: nsight-compute
170- Pin: origin *ubuntu.com*
171- Pin-Priority: -1
172-
173- Package: nsight-systems
174- Pin: origin *ubuntu.com*
175- Pin-Priority: -1
176-
177160 Package: *
178161 Pin: release l=NVIDIA CUDA
179162 Pin-Priority: 400
180- - name: Install CUDA & DCGM
181- ansible.builtin.apt:
182- name: "{{ item }}"
183- update_cache: true
184- loop: "{{ nvidia_packages }}"
185163 - name: Create nvidia-persistenced override directory
186164 ansible.builtin.file:
187165 path: /etc/systemd/system/nvidia-persistenced.service.d
0 commit comments