gpu
2.1 KB•MD
README.md
2.1 KB • 99 lines • markdown
1# GPU Role
2
3**Simple** NVIDIA GPU support role for Ubuntu systems. Installs NVIDIA drivers and container runtime for Docker GPU support - **no complex detection, no monitoring, just the basics**.
4
5## Features
6
7- **NVIDIA driver installation** (nvidia-driver-535 or specified version)
8- **NVIDIA Container Runtime** for Docker GPU support
9- **Clean and simple** - no unnecessary complexity
10
11## Requirements
12
13- Ubuntu 20.04/22.04/24.04
14- NVIDIA GPU hardware
15- Internet connection
16- **Depends on `geerlingguy.docker` role**
17
18## Quick Start
19
20```yaml
21- hosts: gpu_servers
22 become: yes
23 roles:
24 - role: geerlingguy.docker
25 - role: gpu
26```
27
28## Variables
29
30### Simple Configuration
31
32```yaml
33# Enable GPU role
34gpu_enabled: true
35
36# Driver version (535 is stable, or 'latest')
37gpu_driver_version: "535"
38
39# Enable container runtime for Docker
40gpu_container_runtime_enabled: true
41```
42
43That's it - no complex configuration needed!
44
45## What This Role Does
46
471. **Installs NVIDIA drivers** using Ubuntu's built-in packages (nvidia-driver-535 by default)
482. **Installs NVIDIA Container Runtime** for Docker GPU support
493. **Configures Docker** to use the NVIDIA runtime
504. **That's it!** No complex detection, no monitoring, no debugging tools
51
52## Testing GPU Support
53
54After installation, test with:
55
56```bash
57# Check driver installation
58nvidia-smi
59
60# Test Docker GPU access
61docker run --rm --runtime=nvidia --gpus all nvidia/cuda:12.0-base-ubuntu22.04 nvidia-smi
62```
63
64## Troubleshooting
65
66**Driver not working?**
67- Reboot after installation
68- Check `nvidia-smi` command exists
69- Verify in Docker: `docker run --rm --gpus all nvidia/cuda:12.0-base-ubuntu22.04 nvidia-smi`
70
71**Docker GPU not working?**
72- Restart Docker: `sudo systemctl restart docker`
73- Check daemon config: `/etc/docker/daemon.json`
74
75## Examples
76
77### Basic Setup
78```yaml
79- hosts: gpu_compute
80 become: yes
81 roles:
82 - role: geerlingguy.docker
83 - role: gpu
84```
85
86### Specific Driver Version
87```yaml
88- hosts: gpu_compute
89 become: yes
90 roles:
91 - role: geerlingguy.docker
92 - role: gpu
93 vars:
94 gpu_driver_version: "525"
95```
96
97## License
98
99MIT