Repository: ollama
Issue: HSA_OVERRIDE_GFX_VERSION_0 while running on only one GPU
Labels: bug

### What is the issue?

I am running `ollama:rocm` in a docker container on Ubuntu 24.04. My GPU is an RX 6600 (`gfx1032`). Everything works fine when I run `ollama` using

```bash
docker run -d \
    --device /dev/kfd \
    --device /dev/dri \
    -v ollama:/root/.ollama \
    -p 11434:11434 \
    --restart unless-stopped \
    --env HSA_OVERRIDE_GFX_VERSION="10.3.0" \
    --env OLLAMA_KEEP_ALIVE="-1" \
    --name ollama-rocm \
    ollama/ollama:rocm
```

```
time=2025-01-18T01:24:54.470Z level=INFO source=routes.go:1238 msg="Listening on [::]:11434 (version 0.5.5-0-g32bd37a-dirty)"
time=2025-01-18T01:24:54.470Z level=INFO source=routes.go:1267 msg="Dynamic LLM libraries" runners="[cpu_avx2 rocm_avx cpu cpu_avx]"
time=2025-01-18T01:24:54.470Z level=INFO source=gpu.go:226 msg="looking for compatible GPUs"
time=2025-01-18T01:24:54.472Z level=WARN 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"
time=2025-01-18T01:24:54.472Z level=INFO source=amd_linux.go:391 msg="skipping rocm gfx compatibility check" HSA_OVERRIDE_GFX_VERSION=10.3.0
time=2025-01-18T01:24:54.472Z level=INFO source=types.go:131 msg="inference compute" id=0 library=rocm variant="" compute=gfx1032 driver=0.0 name=1002:73ff total="8.0 GiB" available="8.0 GiB"
```

However, when I run using

```bash
docker run -d \
    --device /dev/kfd \
    --device /dev/dri \
    -v ollama:/root/.ollama \
    -p 11434:11434 \
    --restart unless-stopped \
    --env HSA_OVERRIDE_GFX_VERSION_0="10.3.0" \
    --env OLLAMA_KEEP_ALIVE="-1" \
    --name ollama-rocm \
    ollama/ollama:rocm
```

`ollama` runs only on CPU:

```
time=2025-01-18T01:25:58.373Z level=INFO source=routes.go:1238 msg="Listening on [::]:11434 (version 0.5.5-0-g32bd37a-dirty)"
time=2025-01-18T01:25:58.373Z level=INFO source=routes.go:1267 msg="Dynamic LLM libraries" runners="[cpu_avx2 rocm_avx cpu cpu_avx]"
time=2025-01-18T01:25:58.373Z level=INFO source=gpu.go:226 msg="looking for compatible GPUs"
time=2025-01-18T01:25:58.375Z level=WARN 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"
time=2025-01-18T01:25:58.378Z level=WARN source=amd_linux.go:378 msg="amdgpu is not supported (supported types:[gfx1030 gfx1100 gfx1101 gfx1102 gfx900 gfx906 gfx908 gfx90a gfx940 gfx941 gfx942])" gpu_type=gfx1032 gpu=0 library=/usr/lib/ollama
time=2025-01-18T01:25:58.378Z level=WARN source=amd_linux.go:385 msg="See https://github.com/ollama/ollama/blob/main/docs/gpu.md#overrides for HSA_OVERRIDE_GFX_VERSION usage"
time=2025-01-18T01:25:58.378Z level=INFO source=amd_linux.go:404 msg="no compatible amdgpu devices detected"
time=2025-01-18T01:25:58.378Z level=INFO source=gpu.go:392 msg="no compatible GPUs were discovered"
time=2025-01-18T01:25:58.378Z level=INFO source=types.go:131 msg="inference compute" id=0 library=cpu variant=avx2 compute="" driver=0.0 name="" total="62.7 GiB" available="61.2 GiB"
```

I am trying this because eventually I want to get newer AMD GPUs and use them concurrently for `ollama`.
Is this not supported when running `ollama` in `docker`?

If I want to use this RX 6600 and an RX 7800 in the same system, how should I do it with `docker`?

### OS

Linux

### GPU

AMD

### CPU

Intel

### Ollama version

0.5.5-0-g32bd37a-dirty