[GH-ISSUE #11493] Add possibility to setup GPU priority. #85277

Closed
opened 2026-05-09 22:57:16 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @Crandel on GitHub (Jul 22, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/11493

I have 2 GPU setup, one GPU is NVIDIA with 6 Gb RAM, and another one is AMD with 24 Gb RAM. Ollama always choose AMD GPU even if model(Gemma 3) fits to NVIDIA GPU, which is way faster than AMD GPU. Is there any way to prioritize NVIDIA GPU over AMD?

Originally created by @Crandel on GitHub (Jul 22, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/11493 I have 2 GPU setup, one GPU is NVIDIA with 6 Gb RAM, and another one is AMD with 24 Gb RAM. Ollama always choose AMD GPU even if model(Gemma 3) fits to NVIDIA GPU, which is way faster than AMD GPU. Is there any way to prioritize NVIDIA GPU over AMD?
GiteaMirror added the feature request label 2026-05-09 22:57:16 -05:00
Author
Owner

@rick-github commented on GitHub (Jul 22, 2025):

Try setting main_gpu.

<!-- gh-comment-id:3102391249 --> @rick-github commented on GitHub (Jul 22, 2025): Try setting [`main_gpu`](https://github.com/ollama/ollama/blob/82da19c634b6cb2e72d6d648b278f1a1bfcc1e0c/docs/api.md?plain=1#L404).
Author
Owner

@Crandel commented on GitHub (Jul 22, 2025):

Is it possible to do via env variables? I'm not controlling ollama clients which should use ollama

<!-- gh-comment-id:3102419170 --> @Crandel commented on GitHub (Jul 22, 2025): Is it possible to do via env variables? I'm not controlling ollama clients which should use ollama
Author
Owner

@rick-github commented on GitHub (Aug 11, 2025):

There isn't an environment variable for controlling main_gpu, but you should be able to set it as a parameter in the Modelfile:

echo FROM gemma3 > Modelfile
echo PARAMETER main_gpu 1 >> Modelfile
ollama create gemma3:gpu1
<!-- gh-comment-id:3177051962 --> @rick-github commented on GitHub (Aug 11, 2025): There isn't an environment variable for controlling `main_gpu`, but you should be able to set it as a parameter in the Modelfile: ```console echo FROM gemma3 > Modelfile echo PARAMETER main_gpu 1 >> Modelfile ollama create gemma3:gpu1 ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#85277