[GH-ISSUE #6356] AMD Multiple GPU support #50500

Open
opened 2026-04-28 16:06:31 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @VitalickS on GitHub (Aug 14, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/6356

Originally assigned to: @dhiltgen on GitHub.

Hi,

I think the current AMD ROCm doesn’t work well with multiple video cards. I have an XTX 7900 (24GB) and an XT 7900 (20GB). My processor also has a small integrated GPU, but that shouldn’t be a problem.

When I try to load the model llama3.1:70b (39GB):

  1. It doesn’t crash, but it has an infinite load time (at least 10 minutes, maybe more).
  2. My PC gets stuck; I can’t move my mouse or do anything else, including exiting the loading process with Ctrl+C.
  3. It uses (not very actively) only one GPU
  4. The CPU is also loaded in the server process (only a few cores), and the only way to exit this mode is to shut down with the power button.

here my server.log

I can try anything you want, just tell me what to do (recompile llama.cpp or something else).

OS

Windows

GPU

AMD

CPU

AMD

Ollama version

0.3.6

Originally created by @VitalickS on GitHub (Aug 14, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/6356 Originally assigned to: @dhiltgen on GitHub. ### Hi, I think the current AMD ROCm doesn’t work well with multiple video cards. I have an XTX 7900 (24GB) and an XT 7900 (20GB). My processor also has a small integrated GPU, but that shouldn’t be a problem. When I try to load the model llama3.1:70b (39GB): 1. It doesn’t crash, but it has an infinite load time (at least 10 minutes, maybe more). 2. My PC gets stuck; I can’t move my mouse or do anything else, including exiting the loading process with Ctrl+C. 3. It uses (not very actively) only one GPU 4. The CPU is also loaded in the server process (only a few cores), and the only way to exit this mode is to shut down with the power button. here my [server.log](https://github.com/user-attachments/files/16610677/server.log) I can try anything you want, just tell me what to do (recompile llama.cpp or something else). ### OS Windows ### GPU AMD ### CPU AMD ### Ollama version 0.3.6
GiteaMirror added the bugamdwindows labels 2026-04-28 16:06:31 -05:00
Author
Owner

@Speedway1 commented on GitHub (Aug 18, 2024):

Your OS is Windows so this comment may not be too helpful, as we use Linux. But on Linux, we are running on multiple GPUs no problem. However we needed to revert to Rocm 6.1 as the latest produced garbage.

<!-- gh-comment-id:2295289269 --> @Speedway1 commented on GitHub (Aug 18, 2024): Your OS is Windows so this comment may not be too helpful, as we use Linux. But on Linux, we are running on multiple GPUs no problem. However we needed to revert to Rocm 6.1 as the latest produced garbage.
Author
Owner

@dhiltgen commented on GitHub (Aug 18, 2024):

@VitalickS unfortunately the ROCm APIs on windows don't report accurate free VRAM information like they do on Linux, so we've disabled concurrency by default, and in some cases, if there are other apps using VRAM, we may overshoot memory allocations leading to RAM<->VRAM page thrashing which can cause a noticeable performance impact on the system. Once ROCm version 6.2 ships and is available on windows, we believe the APIs will start reporting accurate free VRAM information. Until then, you can stick with smaller models, or set num_gpu to a smaller value than our default algorithm determines so we don't overshoot the VRAM allocations.

<!-- gh-comment-id:2295314259 --> @dhiltgen commented on GitHub (Aug 18, 2024): @VitalickS unfortunately the ROCm APIs on windows don't report accurate free VRAM information like they do on Linux, so we've disabled concurrency by default, and in some cases, if there are other apps using VRAM, we may overshoot memory allocations leading to RAM<->VRAM page thrashing which can cause a noticeable performance impact on the system. Once ROCm version 6.2 ships and is available on windows, we believe the APIs will start reporting accurate free VRAM information. Until then, you can stick with smaller models, or set `num_gpu` to a smaller value than our default algorithm determines so we don't overshoot the VRAM allocations.
Author
Owner

@Speedway1 commented on GitHub (Aug 18, 2024):

Shamelessly standing on the shoulders of @dhiltgen here to put in a plug for running things on Linux anyway. Strongly recommended. Open Source all the way.

OK, I'll get off my soap box now. Thanks for "listening" and wishing the best of luck with the LLM journey.

<!-- gh-comment-id:2295368237 --> @Speedway1 commented on GitHub (Aug 18, 2024): Shamelessly standing on the shoulders of @dhiltgen here to put in a plug for running things on Linux anyway. Strongly recommended. Open Source all the way. OK, I'll get off my soap box now. Thanks for "listening" and wishing the best of luck with the LLM journey.
Author
Owner

@VitalickS commented on GitHub (Aug 18, 2024):

@dhiltgen spent more time to make it alive on my Ubuntu 22.04 LTS.
What I did: customize envs HSA_OVERRIDE_GFX_VERSION=10.3.0 and HIP_VISIBLE_DEVICES=0,1 . So ollama and system see my cards and start loading. But after few seconds (of loading) it crashes with error:
ERROR source=sched.go:451 msg="error loading llama server" error="llama runner process has terminated: signal: segmentation fault (core dumped)" I tried also create custom model with lower number of num_gpu, but it didn't help.
here full dump of that
linux_2amd_log.log

It looks like some issue in unknown place, maybe another one. But devices became visible. Any suggestions?

<!-- gh-comment-id:2295391961 --> @VitalickS commented on GitHub (Aug 18, 2024): @dhiltgen spent more time to make it alive on my Ubuntu 22.04 LTS. What I did: customize envs HSA_OVERRIDE_GFX_VERSION=10.3.0 and HIP_VISIBLE_DEVICES=0,1 . So ollama and system see my cards and start loading. But after few seconds (of loading) it crashes with error: `ERROR source=sched.go:451 msg="error loading llama server" error="llama runner process has terminated: signal: segmentation fault (core dumped)"` I tried also create custom model with lower number of num_gpu, but it didn't help. here full dump of that [linux_2amd_log.log](https://github.com/user-attachments/files/16652202/linux_2amd_log.log) It looks like some issue in unknown place, maybe another one. But devices became visible. Any suggestions?
Author
Owner

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

@VitalickS why are you setting the GFX override? Your GPUs are gfx1100 which is natively supported on linux.

time=2024-09-03T18:26:46.659Z level=DEBUG source=amd_linux.go:336 msg="rocm supported GPUs" types="[gfx1030 gfx1100 gfx1101 gfx1102 gfx900 gfx906 gfx908 gfx90a gfx940 gfx941 gfx942]"
<!-- gh-comment-id:2327163231 --> @dhiltgen commented on GitHub (Sep 3, 2024): @VitalickS why are you setting the GFX override? Your GPUs are gfx1100 which is natively supported on linux. ``` time=2024-09-03T18:26:46.659Z level=DEBUG source=amd_linux.go:336 msg="rocm supported GPUs" types="[gfx1030 gfx1100 gfx1101 gfx1102 gfx900 gfx906 gfx908 gfx90a gfx940 gfx941 gfx942]" ```
Author
Owner

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

Looking at the log a bit closer, it looks like our prediction was just a few hundred mb below what was available on the GPUs, so my suspicion is our prediction was slightly off for the multi-GPU setup, which adds a little more overhead.

You can workaround this by setting OLLAMA_GPU_OVERHEAD to set aside a little VRAM on each GPU to cause us to allocate a layer or two less, which will likely spill over into CPU, but should keep it from crashing.

<!-- gh-comment-id:2415379652 --> @dhiltgen commented on GitHub (Oct 16, 2024): Looking at the log a bit closer, it looks like our prediction was just a few hundred mb below what was available on the GPUs, so my suspicion is our prediction was slightly off for the multi-GPU setup, which adds a little more overhead. You can workaround this by setting OLLAMA_GPU_OVERHEAD to set aside a little VRAM on each GPU to cause us to allocate a layer or two less, which will likely spill over into CPU, but should keep it from crashing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#50500