[GH-ISSUE #11916] Race condition with GPU driver using AMD GPU on Linux #69968

Open
opened 2026-05-04 19:57:17 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @importantblimp on GitHub (Aug 15, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/11916

What is the issue?

When Ollama is started before the GPU driver has created /sys/class/kfd/kfd/topology/nodes/*/properties Ollama falls back to using the CPU, and doesn't re-attempt to use the GPU.

This leads to inconsistent performance when (e.g.) running ollama serve on startup.
Sometimes Ollama uses the GPU and sometimes it uses the CPU, depending on whether ollama serve runs first or the driver creates the paths first.

This is an issue on master and is an issue because the GPU information is only read once.

Relevant log output

Line 3 is caused by /sys/class/kfd/kfd/topology/nodes/*/properties not existing yet:

source=gpu.go:217 msg="looking for compatible GPUs"
source=amd_linux.go:61 msg="ollama recommends running the https://www.amd.com/en/support/linux-drivers" error="amdgpu version file missing: /sys/module/amdgpu/version stat /sys/module/amdgpu/version: no such file or directory"
source=amd_linux.go:402 msg="no compatible amdgpu devices detected"
source=gpu.go:377 msg="no compatible GPUs were discovered"

Re-running ollama serve after the amdgpu kernelModule has loaded:

source=gpu.go:217 msg="looking for compatible GPUs"
source=amd_linux.go:61 msg="ollama recommends running the https://www.amd.com/en/support/linux-drivers" error="amdgpu version file missing: /sys/module/amdgpu/version stat /sys/module/amdgpu/version: no such file or directory"
source=amd_linux.go:389 msg="skipping rocm gfx compatibility check" HSA_OVERRIDE_GFX_VERSION=10.3.0
source=types.go:130 msg="inference compute" id=0 library=rocm variant="" compute=gfx1031 driver=0.0 name=1002:73df total="10.0 GiB" available="8.6 GiB"

OS

Linux

GPU

AMD

CPU

AMD

Ollama version

0.7.0

Originally created by @importantblimp on GitHub (Aug 15, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/11916 ### What is the issue? When Ollama is started before the GPU driver has created `/sys/class/kfd/kfd/topology/nodes/*/properties` Ollama falls back to using the CPU, and doesn't re-attempt to use the GPU. This leads to inconsistent performance when (e.g.) running `ollama serve` on startup. Sometimes Ollama uses the GPU and sometimes it uses the CPU, depending on whether `ollama serve` runs first or the driver creates the paths first. This is an issue on [master](https://github.com/ollama/ollama/blob/main/discover/amd_linux.go#L27) and is an issue because the GPU information is only read once. ### Relevant log output Line 3 is caused by `/sys/class/kfd/kfd/topology/nodes/*/properties` not existing yet: ``` source=gpu.go:217 msg="looking for compatible GPUs" source=amd_linux.go:61 msg="ollama recommends running the https://www.amd.com/en/support/linux-drivers" error="amdgpu version file missing: /sys/module/amdgpu/version stat /sys/module/amdgpu/version: no such file or directory" source=amd_linux.go:402 msg="no compatible amdgpu devices detected" source=gpu.go:377 msg="no compatible GPUs were discovered" ``` Re-running `ollama serve` after the `amdgpu` kernelModule has loaded: ``` source=gpu.go:217 msg="looking for compatible GPUs" source=amd_linux.go:61 msg="ollama recommends running the https://www.amd.com/en/support/linux-drivers" error="amdgpu version file missing: /sys/module/amdgpu/version stat /sys/module/amdgpu/version: no such file or directory" source=amd_linux.go:389 msg="skipping rocm gfx compatibility check" HSA_OVERRIDE_GFX_VERSION=10.3.0 source=types.go:130 msg="inference compute" id=0 library=rocm variant="" compute=gfx1031 driver=0.0 name=1002:73df total="10.0 GiB" available="8.6 GiB" ``` ### OS Linux ### GPU AMD ### CPU AMD ### Ollama version 0.7.0
GiteaMirror added the bug label 2026-05-04 19:57:17 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#69968