[GH-ISSUE #5543] Slow inference speed on RTX 3090. #3463

Closed
opened 2026-04-12 14:08:35 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @Saniel0 on GitHub (Jul 8, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/5543

Originally assigned to: @dhiltgen on GitHub.

What is the issue?

I am getting only about 60t/s compared to 85t/s in llama.cpp when running llama3-8B-q8_0. When I run ollama on RTX 4080 super, I get the same performance as in llama.cpp. I tried running both natively and in docker, results were the same.

That leads me to believe that something is not right, or is that expected behaviour? Thanks

OS

Linux

GPU

Nvidia

CPU

Intel

Ollama version

0.1.48

Originally created by @Saniel0 on GitHub (Jul 8, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/5543 Originally assigned to: @dhiltgen on GitHub. ### What is the issue? I am getting only about 60t/s compared to 85t/s in llama.cpp when running llama3-8B-q8_0. When I run ollama on RTX 4080 super, I get the same performance as in llama.cpp. I tried running both natively and in docker, results were the same. That leads me to believe that something is not right, or is that expected behaviour? Thanks ### OS Linux ### GPU Nvidia ### CPU Intel ### Ollama version 0.1.48
GiteaMirror added the gpunvidiaperformancebug labels 2026-04-12 14:08:35 -05:00
Author
Owner

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

What cuda version do you have installed?

What flags did you use to compile llama.cpp, and do they differ from our settings?

In general we're trying to balance broad hardware support for older and newer GPUs. We're looking at adding 2 distinct cuda runners (adding a v12 runner in addition to our existing v11 runner) which will allow us to tune the v12 runner to optimize for newer GPUs without dropping support for older GPUs with the v11 runner.

<!-- gh-comment-id:2246576634 --> @dhiltgen commented on GitHub (Jul 24, 2024): What cuda version do you have installed? What flags did you use to compile llama.cpp, and do they differ from our settings? - https://github.com/ollama/ollama/blob/main/llm/generate/gen_common.sh#L43 - https://github.com/ollama/ollama/blob/main/llm/generate/gen_linux.sh#L160-L185 In general we're trying to balance broad hardware support for older and newer GPUs. We're looking at adding 2 distinct cuda runners ([adding a v12 runner](https://github.com/ollama/ollama/pull/5049) in addition to our existing v11 runner) which will allow us to tune the v12 runner to optimize for newer GPUs without dropping support for older GPUs with the v11 runner.
Author
Owner

@Saniel0 commented on GitHub (Jul 24, 2024):

I am using cuda 12.5. I did default cuda llama.cpp compile, I did not set any extra flags.

I tried the v12 runner branch, but the performance did not improve.

After some further testing, it seems that the issue is maybe not related to the gpu. When some model is running, one cpu thread is running constantly at 100% (both in ollama and llama.cpp). With 3090, I am using xeon e5 2699 v3, which does not have great single core performance. With 4080 (where I did not see performance degradation), I was using ryzen 5 5600x. So maybe there is larger cpu overhead in ollama?

I ended up running full fp16 version, where I found that the performance is closer to llama.cpp - I get around 42.5t/s in ollama and 49.5t/s in llama.cpp.

<!-- gh-comment-id:2247777292 --> @Saniel0 commented on GitHub (Jul 24, 2024): I am using cuda 12.5. I did default cuda llama.cpp compile, I did not set any extra flags. I tried the v12 runner branch, but the performance did not improve. After some further testing, it seems that the issue is maybe not related to the gpu. When some model is running, one cpu thread is running constantly at 100% (both in ollama and llama.cpp). With 3090, I am using xeon e5 2699 v3, which does not have great single core performance. With 4080 (where I did not see performance degradation), I was using ryzen 5 5600x. So maybe there is larger cpu overhead in ollama? I ended up running full fp16 version, where I found that the performance is closer to llama.cpp - I get around 42.5t/s in ollama and 49.5t/s in llama.cpp.
Author
Owner

@dhiltgen commented on GitHub (Oct 15, 2024):

@Saniel0 from your last comment, it sounds like the original comparison wasn't "apples to apples" on otherwise identical hardware. Yes, the CPU is involved in coordinating and processing results as they're generated by the GPU.

It sounds like we can close this issue. If there's still a performance concern, please elaborate and I'll reopen.

<!-- gh-comment-id:2415348771 --> @dhiltgen commented on GitHub (Oct 15, 2024): @Saniel0 from your last comment, it sounds like the original comparison wasn't "apples to apples" on otherwise identical hardware. Yes, the CPU is involved in coordinating and processing results as they're generated by the GPU. It sounds like we can close this issue. If there's still a performance concern, please elaborate and I'll reopen.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#3463