[GH-ISSUE #6770] Library missing from ollama when running it in Docker #4266

Closed
opened 2026-04-12 15:12:00 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @factor3 on GitHub (Sep 12, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/6770

Originally assigned to: @dhiltgen on GitHub.

What is the issue?

I am attempting to run the docker version of ollama with a nvidia GPU. I have put in all software as described at

https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html

I attempted to run the ollama container:

docker run -d --gpus=all -v ./ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama

and I am getting an error:

docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: Auto-detected mode as 'legacy'
nvidia-container-cli: initialization error: load library failed: libnvidia-ml.so.1: cannot open shared object file: no such file or directory: unknown.

There is clearly something wrong here. Somehow, running the installation of the nvidia container toolkit does not put in a library. Can this be fixed?

OS

Linux

GPU

Nvidia

CPU

AMD

Ollama version

No response

Originally created by @factor3 on GitHub (Sep 12, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/6770 Originally assigned to: @dhiltgen on GitHub. ### What is the issue? I am attempting to run the docker version of ollama with a nvidia GPU. I have put in all software as described at https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html I attempted to run the ollama container: docker run -d --gpus=all -v ./ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama and I am getting an error: docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: Auto-detected mode as 'legacy' nvidia-container-cli: initialization error: load library failed: libnvidia-ml.so.1: cannot open shared object file: no such file or directory: unknown. There is clearly something wrong here. Somehow, running the installation of the nvidia container toolkit does not put in a library. Can this be fixed? ### OS Linux ### GPU Nvidia ### CPU AMD ### Ollama version _No response_
GiteaMirror added the dockerquestionlinuxnvidia labels 2026-04-12 15:12:00 -05:00
Author
Owner

@dhiltgen commented on GitHub (Sep 12, 2024):

My suspicion is something isn't set up properly on your host system. Looking at the nvidia-container-toolkit repo past issues, you might have mismatched package versions on the host (particularly the nvidia management library) or may need to reinstall the driver packages. https://github.com/NVIDIA/nvidia-container-toolkit/issues/305 has some suggestions that you can try to see if those clear up the problem.

<!-- gh-comment-id:2346631357 --> @dhiltgen commented on GitHub (Sep 12, 2024): My suspicion is something isn't set up properly on your host system. Looking at the nvidia-container-toolkit repo past issues, you might have mismatched package versions on the host (particularly the nvidia management library) or may need to reinstall the driver packages. https://github.com/NVIDIA/nvidia-container-toolkit/issues/305 has some suggestions that you can try to see if those clear up the problem.
Author
Owner

@factor3 commented on GitHub (Sep 12, 2024):

Greetings, dhiltgen:

Thanks for the link. Based on it I did the following:

sudo ubuntu-drivers install

and this did apparently solve the missing library.

Unfortunately, this lead to another error:

docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: Auto-detected mode as 'legacy'
nvidia-container-cli: initialization error: nvml error: driver not loaded: unknown.

Is mvml another driver that I have to install somehow?

I do, however, have a suspicion: all the work -- including the nvidia installation instructions -- seem to be directed towards installation on Ubuntu V22. I am running Ubuntu V24. There are no instructions for drivers for V24 that I can find.

I am going to wipe my drive and install Ubuntu V22, and see what happens. I will return once I have done this.

<!-- gh-comment-id:2346837957 --> @factor3 commented on GitHub (Sep 12, 2024): Greetings, dhiltgen: Thanks for the link. Based on it I did the following: sudo ubuntu-drivers install and this did apparently solve the missing library. Unfortunately, this lead to another error: docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: Auto-detected mode as 'legacy' nvidia-container-cli: initialization error: nvml error: driver not loaded: unknown. Is mvml another driver that I have to install somehow? I do, however, have a suspicion: all the work -- including the nvidia installation instructions -- seem to be directed towards installation on Ubuntu V22. I am running Ubuntu V24. There are no instructions for drivers for V24 that I can find. I am going to wipe my drive and install Ubuntu V22, and see what happens. I will return once I have done this.
Author
Owner

@factor3 commented on GitHub (Sep 12, 2024):

I was right. I have ollama working on my machine now.

It turns out that, apparently, the nvidia drivers put onto Ubuntu V24 are not quite compatible with it. Going back to V22 enabled everything to work properly. Nvidia and Ubuntu have not done anything (that I am aware of) to update the nvidia drivers so that they can work with V24.

I am closing this issue, since ultimately this is a nvidia and ubuntu issue. And since I have ollama working now (although with an older version of Docker which I will have to somehow upgrade), there is no reason for me to keep this "issue" open..

Thank you for your help, dhiltgen.

<!-- gh-comment-id:2347385803 --> @factor3 commented on GitHub (Sep 12, 2024): I was right. I have ollama working on my machine now. It turns out that, apparently, the nvidia drivers put onto Ubuntu V24 are not quite compatible with it. Going back to V22 enabled everything to work properly. Nvidia and Ubuntu have not done anything (that I am aware of) to update the nvidia drivers so that they can work with V24. I am closing this issue, since ultimately this is a nvidia and ubuntu issue. And since I have ollama working now (although with an older version of Docker which I will have to somehow upgrade), there is no reason for me to keep this "issue" open.. Thank you for your help, dhiltgen.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#4266