Describe the bug
NVIDIA Docker (virtualisation.docker.enableNvidia) cannot be used on default NixOS option due to cgroup v2 not supported by libnvidia-container (the error, root cause). The container refuse to spawn because this runtime error.
$ nvidia-docker run -it -p 3000:3000 mycroft/mimic2:gpu
docker: Error response from daemon: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: Running hook #1:: error running hook: exit status 1, stdout: , stderr: nvidia-container-cli: container error: cgroup subsystem devices not found: unknown.
ERRO[0003] error waiting for container: context canceled
I encountered this issue exactly because I'm running rootless docker with nvidia runtime using your usernetes. Everything works, except have to set no-cgroups = true in /etc/nvidia-container-runtime/config.toml
To Reproduce
Steps to reproduce the behavior:
Clone mycroft/mimic2 repository and enter the directory. This might be any repository or docker image with gpu requirements.
# a list of nixpkgs attributes affected by the problem
attribute:
- systemd.enableUnifiedCgroupHierarchy
- virtualisation.docker.enableNvidia
# a list of nixos modules affected by the problem
module:
- systemd
- nvidia-docker
Describe the bug NVIDIA Docker (
virtualisation.docker.enableNvidia
) cannot be used on default NixOS option due to cgroup v2 not supported by libnvidia-container (the error, root cause). The container refuse to spawn because this runtime error.There are two potential solutions as https://github.com/NVIDIA/libnvidia-container/issues/111#issuecomment-782332657,
systemd.enableUnifiedCgroupHierarchy = false;
)nvidia-container-runtime
per https://github.com/NVIDIA/nvidia-container-runtime/issues/47#issuecomment-463495931.To Reproduce Steps to reproduce the behavior:
mycroft/mimic2
repository and enter the directory. This might be any repository or docker image with gpu requirements.docker build -t mycroft/mimic2:gpu -f gpu.Dockerfile .
nvidia-docker run -it -p 3000:3000 mycroft/mimic2:gpu
.Expected behavior Run happily ever after.
Metadata Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Maintainer information: