Hello,
I have access to GPU enabled hardware (NSF Jetstream2 cloud) and I am able to successfully launch VMs and run NVIDIA-based Docker containers such as this one without issue on those GPU VMs.
docker run --gpus all cschranz/gpu-jupyter:v1.4_cuda-11.6_ubuntu-20.04 nvidia-smi
Wed Sep 21 17:16:22 2022
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 510.85.02 Driver Version: 510.85.02 CUDA Version: 11.6 |
|-------------------------------+----------------------+----------------------+
| 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 GRID A100X-8C On | 00000000:00:06.0 Off | 0 |
| N/A N/A P0 N/A / N/A | 1MiB / 8192MiB | 0% Default |
| | | Disabled |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+
My aim is to launch a JupyterHub with Kubernetes cluster with those GPU VMs as worker nodes. (I’ve launched and run many of these clusters with CPUs in the past so I am comfortable in that area). However, I would like to launch a GPU enabled Zero to JupyterHub cluster. In order to do that, I have to supply the --gpus all
to the Docker image above, but I don’t know how to achieve that. Searching around I did find this reference, but I am not sure how to make use of that code snippet. I did try the code below in the configuration yaml
file, but that failed with import errors, and I believe that is the wrong approach anyway.
hub:
extraConfig:
cuda: |
import docker
c.DockerSpawner.extra_host_config = {
"device_requests": [
docker.types.DeviceRequest(
count=-1,
capabilities=[["gpu"]],
),
],
}
Does anyone know how to simply supply the --gpus all
when launching a singleuser
Docker image via Jupyter with Kubernetes?