[GH-ISSUE #7480] HIP_VISIBLE_DEVICES vs ROCR_VISIBLE_DEVICES #66812

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

Originally created by @sk7n4k3d on GitHub (Nov 3, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/7480

Originally assigned to: @dhiltgen on GitHub.

What is the issue?

I have 8 AMD 7900XTX cards in llama.cpp to limit access to certain GPUs, I use the HIP_VISIBLE_DEVICES command and it works correctly. However, if I want to limit GPU access for Ollama, I get an error with llama3.2-vision. To make it work correctly, I have to give it access to all GPUs and then limit access via ROCR_VISIBLE_DEVICES.

OS

Linux

GPU

AMD

CPU

AMD

Ollama version

0.4.0-pre

Originally created by @sk7n4k3d on GitHub (Nov 3, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/7480 Originally assigned to: @dhiltgen on GitHub. ### What is the issue? I have 8 AMD 7900XTX cards in llama.cpp to limit access to certain GPUs, I use the HIP_VISIBLE_DEVICES command and it works correctly. However, if I want to limit GPU access for Ollama, I get an error with llama3.2-vision. To make it work correctly, I have to give it access to all GPUs and then limit access via ROCR_VISIBLE_DEVICES. ### OS Linux ### GPU AMD ### CPU AMD ### Ollama version 0.4.0-pre
GiteaMirror added the amdbugneeds more info labels 2026-05-04 08:15:47 -05:00
Author
Owner

@rick-github commented on GitHub (Nov 3, 2024):

System logs may aid in debugging.

<!-- gh-comment-id:2453462450 --> @rick-github commented on GitHub (Nov 3, 2024): [System logs](https://github.com/ollama/ollama/blob/main/docs/troubleshooting.md#how-to-troubleshoot-issues) may aid in debugging.
Author
Owner

@dhiltgen commented on GitHub (Nov 3, 2024):

PR #7212 adjusts our algorithm for AMD GPU selection to favor the ROCR_VISIBLE_DEVICES environment variable so we can use UUIDs. It turns out for some users with multiple GPUs, the ordering isn't consistent, so using UUIDs ensures we query and target the intended GPU. It should still support the numeric HIP_VISIBLE_DEVICES as well, but if you have multiple GPUs I'd suggest using UUIDs. Make sure you're running the latest RC and if it's still ignoring the HIP variable share a complete server log at startup so we can see all the settings and discovery information.

<!-- gh-comment-id:2453581886 --> @dhiltgen commented on GitHub (Nov 3, 2024): PR #7212 adjusts our algorithm for AMD GPU selection to favor the ROCR_VISIBLE_DEVICES environment variable so we can use UUIDs. It turns out for some users with multiple GPUs, the ordering isn't consistent, so using UUIDs ensures we query and target the intended GPU. It should still support the numeric HIP_VISIBLE_DEVICES as well, but if you have multiple GPUs I'd suggest using UUIDs. Make sure you're running the latest RC and if it's still ignoring the HIP variable share a complete server log at startup so we can see all the settings and discovery information.
Author
Owner

@dhiltgen commented on GitHub (Jul 4, 2025):

AMD GPU visibility controls should work correctly now. If you're still having problems, let us know and I'll re-open the issue.

<!-- gh-comment-id:3037213363 --> @dhiltgen commented on GitHub (Jul 4, 2025): AMD GPU visibility controls should work correctly now. If you're still having problems, let us know and I'll re-open the issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#66812