[GH-ISSUE #932] Failed to parse available VRAM: strconv.ParseInt: parsing "[Insufficient Permissions]" #46969

Closed
opened 2026-04-28 02:19:12 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @domWinter on GitHub (Oct 27, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/932

Originally assigned to: @BruceMacD on GitHub.

Hi,

I am trying to run ollama in a docker container with the nvidia runtime on a system with a Nvidia A100 and MIG enabled.
When starting the ollama server I get the following error:

2023/10/27 09:16:05 routes.go:682: Warning: GPU support may not enabled, check you have installed install GPU drivers: failed to parse available VRAM: strconv.ParseInt: parsing "[Insufficient Permissions]": invalid syntax

The ollama server is running as root user.

However, when running nvidia-smi inside the container I see the passed through GPU and MIG device and I am also able to allocate the GPU with e.g. pytorch in the same container.

Cuda Version: 12.2
Nvidia Driver Version: 535.104.12
Docker version 24.0.6, build ed223bc
ollama version 0.1.3

Any help is appreciated!

Originally created by @domWinter on GitHub (Oct 27, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/932 Originally assigned to: @BruceMacD on GitHub. Hi, I am trying to run ollama in a docker container with the nvidia runtime on a system with a Nvidia A100 and MIG enabled. When starting the ollama server I get the following error: `2023/10/27 09:16:05 routes.go:682: Warning: GPU support may not enabled, check you have installed install GPU drivers: failed to parse available VRAM: strconv.ParseInt: parsing "[Insufficient Permissions]": invalid syntax` The ollama server is running as root user. However, when running nvidia-smi inside the container I see the passed through GPU and MIG device and I am also able to allocate the GPU with e.g. pytorch in the same container. Cuda Version: 12.2 Nvidia Driver Version: 535.104.12 Docker version 24.0.6, build ed223bc ollama version 0.1.3 Any help is appreciated!
Author
Owner

@domWinter commented on GitHub (Oct 27, 2023):

Seems like the problematic call is e5d1ce4dde/llm/llama.go (L203)

nvidia-smi --query-gpu=memory.free --format=csv,noheader,nounits

Which returns [Insufficient Permissions]

<!-- gh-comment-id:1782615807 --> @domWinter commented on GitHub (Oct 27, 2023): Seems like the problematic call is https://github.com/jmorganca/ollama/blob/e5d1ce4dde0e30594c1b49d761ad98b50e3d17ab/llm/llama.go#L203 nvidia-smi --query-gpu=memory.free --format=csv,noheader,nounits Which returns [Insufficient Permissions]
Author
Owner

@BruceMacD commented on GitHub (Oct 27, 2023):

Thanks for opening the issue. Looks like the container might need some host level permissions it does not currently have. When you run ollama as the root user in the container it will have sudo permissions in the container, but not externally.

Another workaround is to manually set the num_gpu in a modelfile.

<!-- gh-comment-id:1783198547 --> @BruceMacD commented on GitHub (Oct 27, 2023): Thanks for opening the issue. Looks like the container might need some host level permissions it does not currently have. When you run ollama as the root user in the container it will have sudo permissions in the container, but not externally. Another workaround is to manually set the `num_gpu` in a modelfile.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#46969