Skip to content

Commit eabb66f

Browse files
authored
docs(inputs.nvidia_smi): Example of how to enable nvidia-smi via docker compose (#11833)
1 parent 7bebf88 commit eabb66f

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

plugins/inputs/nvidia_smi/README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,21 @@ confirmed to be an issue on an EVGA 2080 Ti.
110110
**NOTE:** For use with docker either generate your own custom docker image based
111111
on nvidia/cuda which also installs a telegraf package or use [volume mount
112112
binding](https://docs.docker.com/storage/bind-mounts/) to inject the required
113-
binary into the docker container.
113+
binary into the docker container. In particular you will need to pass through
114+
the /dev/nvidia* devices, the nvidia-smi binary and the nvidia libraries.
115+
An minimal docker-compose example of how to do this is:
116+
117+
```yaml
118+
telegraf:
119+
image: telegraf
120+
runtime: nvidia
121+
devices:
122+
- /dev/nvidiactl:/dev/nvidiactl
123+
- /dev/nvidia0:/dev/nvidia0
124+
volumes:
125+
- ./telegraf/etc/telegraf.conf:/etc/telegraf/telegraf.conf:ro
126+
- /usr/bin/nvidia-smi:/usr/bin/nvidia-smi:ro
127+
- /usr/lib/x86_64-linux-gnu/nvidia:/usr/lib/x86_64-linux-gnu/nvidia:ro
128+
environment:
129+
- LD_PRELOAD=/usr/lib/x86_64-linux-gnu/nvidia/current/libnvidia-ml.so
130+
```

0 commit comments

Comments
 (0)