[GH-ISSUE #13233] bootstrapDevices() may silently fail without logging an error #55262

Closed
opened 2026-04-29 08:39:30 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @Battlesheepu on GitHub (Nov 24, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/13233

What is the issue?

What's wrong

While debugging why my AMD GPU (9070XT) is not detected when running the ollama/ollama:rocm docker image, I've stumbled upon this piece of code

# discover/runner.go
(...)
	if err != nil {
		if cmd.ProcessState != nil && cmd.ProcessState.ExitCode() >= 0 {
			// Expected during bootstrapping while we filter out unsupported AMD GPUs
			logutil.Trace("runner exited", "OLLAMA_LIBRARY_PATH", ollamaLibDirs, "extra_envs", extraEnvs, "code", cmd.ProcessState.ExitCode())
		} else {
			slog.Info("failure during GPU discovery", "OLLAMA_LIBRARY_PATH", ollamaLibDirs, "extra_envs", extraEnvs, "error", err)
		}
	}
(...)

That piece of code would explain why I don't get my information while debugging the docker container, as

cmd.ProcessState != nil && cmd.ProcessState.ExitCode() >= 0

Will not inform whether the exit code is a successful one or not, as that information is limited only to the Trace.

Suggested solution

Shouldn't we just split that condition into two, logging any errors when the exit code is not 0? Or instead of that information going into Trace, just moving it into Debug?

Final notes

As always, huge thanks for all your hard work :)

Relevant log output

ollama-1  | time=2025-11-24T22:13:01.540Z level=DEBUG source=server.go:393 msg=subprocess PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin OLLAMA_DEBUG=1 GPU_MAX_HW_QUEUES=1 LD_LIBRARY_PATH=/usr/lib/ollama:/usr/lib/ollama/rocm:/usr/local/nvidia/lib:/usr/local/nvidia/lib64 OLLAMA_HOST=0.0.0.0:11434 OLLAMA_LIBRARY_PATH=/usr/lib/ollama:/usr/lib/ollama/rocm
ollama-1  | time=2025-11-24T22:13:01.589Z level=DEBUG source=runner.go:422 msg="bootstrap discovery took" duration=50.214588ms OLLAMA_LIBRARY_PATH="[/usr/lib/ollama /usr/lib/ollama/rocm]" extra_envs=map[]
ollama-1  | time=2025-11-24T22:13:01.589Z level=DEBUG source=runner.go:120 msg="evaluating which, if any, devices to filter out" initial_count=0
ollama-1  | time=2025-11-24T22:13:01.589Z level=DEBUG source=runner.go:40 msg="GPU bootstrap discovery took" duration=50.461833ms

OS

Ubuntu 25.10

GPU

AMD Radeon 9070XT

CPU

Ryzen 5800x

Ollama version

ollama/ollama:rocm docker image (a21e03ec67ef)

Originally created by @Battlesheepu on GitHub (Nov 24, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/13233 ### What is the issue? ## What's wrong While debugging why my AMD GPU (9070XT) is not detected when running the ollama/ollama:rocm docker image, I've stumbled upon this piece of code ```go # discover/runner.go (...) if err != nil { if cmd.ProcessState != nil && cmd.ProcessState.ExitCode() >= 0 { // Expected during bootstrapping while we filter out unsupported AMD GPUs logutil.Trace("runner exited", "OLLAMA_LIBRARY_PATH", ollamaLibDirs, "extra_envs", extraEnvs, "code", cmd.ProcessState.ExitCode()) } else { slog.Info("failure during GPU discovery", "OLLAMA_LIBRARY_PATH", ollamaLibDirs, "extra_envs", extraEnvs, "error", err) } } (...) ``` That piece of code would explain why I don't get my information while debugging the docker container, as ``` cmd.ProcessState != nil && cmd.ProcessState.ExitCode() >= 0 ``` Will not inform whether the exit code is a successful one or not, as that information is limited only to the Trace. ## Suggested solution Shouldn't we just split that condition into two, logging any errors when the exit code is not 0? Or instead of that information going into Trace, just moving it into Debug? ## Final notes As always, huge thanks for all your hard work :) ### Relevant log output ```shell ollama-1 | time=2025-11-24T22:13:01.540Z level=DEBUG source=server.go:393 msg=subprocess PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin OLLAMA_DEBUG=1 GPU_MAX_HW_QUEUES=1 LD_LIBRARY_PATH=/usr/lib/ollama:/usr/lib/ollama/rocm:/usr/local/nvidia/lib:/usr/local/nvidia/lib64 OLLAMA_HOST=0.0.0.0:11434 OLLAMA_LIBRARY_PATH=/usr/lib/ollama:/usr/lib/ollama/rocm ollama-1 | time=2025-11-24T22:13:01.589Z level=DEBUG source=runner.go:422 msg="bootstrap discovery took" duration=50.214588ms OLLAMA_LIBRARY_PATH="[/usr/lib/ollama /usr/lib/ollama/rocm]" extra_envs=map[] ollama-1 | time=2025-11-24T22:13:01.589Z level=DEBUG source=runner.go:120 msg="evaluating which, if any, devices to filter out" initial_count=0 ollama-1 | time=2025-11-24T22:13:01.589Z level=DEBUG source=runner.go:40 msg="GPU bootstrap discovery took" duration=50.461833ms ``` ### OS Ubuntu 25.10 ### GPU AMD Radeon 9070XT ### CPU Ryzen 5800x ### Ollama version ollama/ollama:rocm docker image (a21e03ec67ef)
GiteaMirror added the bug label 2026-04-29 08:39:30 -05:00
Author
Owner

@Battlesheepu commented on GitHub (Nov 24, 2025):

I've just realised that I can set the log level to trace, making this issue redundant - unless we wish to improve logging on this.
Sorry for the trouble.

<!-- gh-comment-id:3573179361 --> @Battlesheepu commented on GitHub (Nov 24, 2025): I've just realised that I can set the log level to trace, making this issue redundant - unless we wish to improve logging on this. Sorry for the trouble.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#55262