[GH-ISSUE #5766] specify a single GPU (id=1)using Docker, Error! #3590

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

Originally created by @catsled on GitHub (Jul 18, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/5766

Originally assigned to: @dhiltgen on GitHub.

What is the issue?

I have 8 gpus, i want to specify the id=1's gpu in a docker,

docker run -it ... --device=/dev/dri/card1 --device=/dev/dri/renderD129 ....

Error occured!

image

when i set HIP_VISIBLE_DEVICES=1

image

image

OS

Linux

GPU

AMD

CPU

Intel

Ollama version

0.21

Originally created by @catsled on GitHub (Jul 18, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/5766 Originally assigned to: @dhiltgen on GitHub. ### What is the issue? I have 8 gpus, i want to specify the id=1's gpu in a docker, `docker run -it ... --device=/dev/dri/card1 --device=/dev/dri/renderD129 ....` Error occured! ![image](https://github.com/user-attachments/assets/ed2137b0-e0a9-4025-a55d-c57205536e39) when i set `HIP_VISIBLE_DEVICES=1` <img width="892" alt="image" src="https://github.com/user-attachments/assets/269de8c9-7d14-4b9b-a57a-75bc4f9d61f5"> ![image](https://github.com/user-attachments/assets/2a7522b4-2e77-4bf6-b0de-3318cbc038ae) ### OS Linux ### GPU AMD ### CPU Intel ### Ollama version 0.21
GiteaMirror added the dockeramdbug labels 2026-04-12 14:19:48 -05:00
Author
Owner

@dhiltgen commented on GitHub (Jul 22, 2024):

It's hard to follow along with the screenshots instead of text logs, but I think you're seeing 2 different problems.

I think when you filter the GPUs via docker command line flags, and set HIP_VISIBLE_DEVICES things get out of sync and we fail to work on the GPU.

I think if you omit that env var, and just filter with docer flags, then there's a gfx compatibility problem. What GPU are you trying to use, and what GFX Override are you setting?

<!-- gh-comment-id:2243995398 --> @dhiltgen commented on GitHub (Jul 22, 2024): It's hard to follow along with the screenshots instead of text logs, but I think you're seeing 2 different problems. I think when you filter the GPUs via docker command line flags, and set HIP_VISIBLE_DEVICES things get out of sync and we fail to work on the GPU. I think if you omit that env var, and just filter with docer flags, then there's a gfx compatibility problem. What GPU are you trying to use, and what GFX Override are you setting?
Author
Owner

@catsled commented on GitHub (Jul 25, 2024):

It's hard to follow along with the screenshots instead of text logs, but I think you're seeing 2 different problems.

I think when you filter the GPUs via docker command line flags, and set HIP_VISIBLE_DEVICES things get out of sync and we fail to work on the GPU.

I think if you omit that env var, and just filter with docer flags, then there's a gfx compatibility problem. What GPU are you trying to use, and what GFX Override are you setting?

I believe I have found the solution. The issue lies in the mapping of the GPU for Docker(Ollama must read them from 0 idx); it can be resolved by remapping. thanks

<!-- gh-comment-id:2249530376 --> @catsled commented on GitHub (Jul 25, 2024): > It's hard to follow along with the screenshots instead of text logs, but I think you're seeing 2 different problems. > > I think when you filter the GPUs via docker command line flags, and set HIP_VISIBLE_DEVICES things get out of sync and we fail to work on the GPU. > > I think if you omit that env var, and just filter with docer flags, then there's a gfx compatibility problem. What GPU are you trying to use, and what GFX Override are you setting? I believe I have found the solution. The issue lies in the mapping of the GPU for Docker(Ollama must read them from 0 idx); it can be resolved by remapping. thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#3590