[GH-ISSUE #8064] How can I specify the GPU for running the LLM? #5155

Closed
opened 2026-04-12 16:15:52 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @NilsHellwig on GitHub (Dec 12, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/8064

What is the issue?

The num_gpu parameter doesn't seem to work as expected. How can I ensure the model runs on a specific GPU? I have two A5000 GPUs available.

I'm not using Docker, just installed ollama by using curl -fsSL https://ollama.com/install.sh | sh.

OS

Linux

GPU

Nvidia

CPU

Intel

Ollama version

0.5.1

Originally created by @NilsHellwig on GitHub (Dec 12, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/8064 ### What is the issue? The `num_gpu` parameter doesn't seem to work as expected. How can I ensure the model runs on a specific GPU? I have two A5000 GPUs available. I'm not using Docker, just installed ollama by using `curl -fsSL https://ollama.com/install.sh | sh`. ### OS Linux ### GPU Nvidia ### CPU Intel ### Ollama version 0.5.1
GiteaMirror added the bug label 2026-04-12 16:15:52 -05:00
Author
Owner

@wqerrewetw commented on GitHub (Dec 12, 2024):

https://github.com/ollama/ollama/blob/main/docs/gpu.md

<!-- gh-comment-id:2537945638 --> @wqerrewetw commented on GitHub (Dec 12, 2024): https://github.com/ollama/ollama/blob/main/docs/gpu.md
Author
Owner

@rick-github commented on GitHub (Dec 12, 2024):

num_gpu specifies how many model layers to offload to the GPU, not which GPU to use. As per the link provided by @wqerrewetw, you want CUDA_VISIBLE_DEVICES.

<!-- gh-comment-id:2539035488 --> @rick-github commented on GitHub (Dec 12, 2024): `num_gpu` specifies how many model layers to offload to the GPU, not which GPU to use. As per the link provided by @wqerrewetw, you want `CUDA_VISIBLE_DEVICES`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#5155