I want to run the Ollama WebUI docker compose container with offloading to the GPU. But I cant seam to get it to work. This is my current docker config:
But right now when running the docker run --gpus all nvidia/cuda:11.6.2-cudnn8-runtime-ubuntu20.04 nvidia-smi command I get this error:
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: /nix/store/rlkbyypmi5xdy72sf7fb4kkfx5qrk5rl-nvidia-docker/bin/nvidia-container-runtime did not terminate successfully: exit status 125: unknown.
ERRO[0000] error waiting for container:
If I remove extraOptions = "--default-runtime=nvidia"; it will run, but then it will complain in the SMI that no driver was loaded and acceleration was disabled.
I have looked at many other topics to no success, so I am making my own. Any help would be much appreciated.
The only issue I have with this setup is that whenever I wake from sleep mode, I have to run the following two commands for the container to gain access to the GPU again:
I ran into this same issue (exit status 125 when trying to attach GPUs to Docker containers). After a while of testing, I tried running the container with podman instead, which worked first try without issues. The two settings I needed on unstable were
For what its worth, these are the changes I had to make to my NixOS config to be able to use VS Code’s dev container extension to build software inside of NVIDIA-published docker images:
Of note, that included switching to Docker 25 so I could manually enable CDI.