Tools for building ML environments & infra
How to know docker, Nvidia Driver, Nvidia Docker have been installed correctly
docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi
The output will be somethings like
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 450.80.02 Driver Version: 450.80.02 CUDA Version: 11.0 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 GeForce GTX 108... Off | 00000000:01:00.0 On | N/A |
| 43% 57C P0 71W / 250W | 3291MiB / 11175MiB | 5% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
+-----------------------------------------------------------------------------+
Update runtime for nvidia-docker
$ cat /etc/docker/daemon.json
{
"runtimes": {
"nvidia": {
"path": "nvidia-container-runtime",
"runtimeArgs": []
}
}
}
The docker images has Jupyter Lab inside, when you start docker image the Jupyter will automatically launch, and bind to 8889
port on your computer.
Happy Coding!!!
$ cd dockerfiles
$ docker-compose -f docker-compose.yml -f dev-gpu.yml up --build
localhost:8889
Test.ipynb
Run the first code block
import torch
torch.cuda.current_device()