Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andrewtwin/ansible-role-install_nvidia_cuda
Ansible role for installing Nvidia drivers and CUDA toolkit
https://github.com/andrewtwin/ansible-role-install_nvidia_cuda
ansible-role cuda-toolkit drivers nvidia
Last synced: 12 days ago
JSON representation
Ansible role for installing Nvidia drivers and CUDA toolkit
- Host: GitHub
- URL: https://github.com/andrewtwin/ansible-role-install_nvidia_cuda
- Owner: andrewtwin
- Created: 2025-01-15T06:40:04.000Z (20 days ago)
- Default Branch: main
- Last Pushed: 2025-01-17T06:33:08.000Z (18 days ago)
- Last Synced: 2025-01-17T07:29:20.299Z (18 days ago)
- Topics: ansible-role, cuda-toolkit, drivers, nvidia
- Language: Jinja
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
install-nvidia-cuda
=========Install pre-compiled or dkms Nvidia drivers and cuda-toolkit on:
- RHEL8
- RHEL9
- Ubuntu 22.04
- Ubuntu 24.04
- Debian 12Other distros in these families may also work.
Based on the instructions from:
- https://docs.nvidia.com/datacenter/tesla/driver-installation-guide/
- https://docs.nvidia.com/cuda/cuda-installation-guide-linux/Requirements
------------See Nvidia docs for system requirements.
Drivers and tool-kit can take up 10Gb+ on some systems.Role Variables
--------------- `driver_version` - Default `propriety`.
`open` for the latest open drivers.
`propriety` for the latest propriety drivers.
Or another value from https://docs.nvidia.com/datacenter/tesla/driver-installation-guide/index.html#precompiled-streams.
Open drivers require a 'Turing' (RTX 20xx, 16xx, etc.) or newer Nvidia GPU.
- `allow_autoremove` - Default `false`. If autoremove should run when packages are installed or removed.
- `driver_packages` - Default `true`. Install (or remove) Nvidia driver packages.
- `cuda_packages` - Default `true`. Install (or remove) the CUDA toolkit packages.Dependencies
------------- `community.general.dnf_config_manager` module
Example Playbook
----------------Can test the ouput of `lspci` to only run on nodes with Nvidia GPU hardware.
The propriety, pre-compiled drivers should work with older, pre-Turing, GPUs if required.
```
---
- name: Install CUDA on nodes with GPUs
hosts: all
become: true
gather_facts: true
pre_tasks:
- name: Check which nodes have NVIDIA GPUs
register: lspci_result
changed_when: false
check_mode: false
ansible.builtin.command:
cmd: "lspci"tasks:
- name: Install CUDA
vars:
driver_version: propriety
when: lspci_result['stdout'] | regex_search('vga.*nvidia', ignorecase=true, multiline=false)
ansible.builtin.include_role:
name: install_nvidia_cuda
```License
-------BSD-3-Clause