ollama - 💡(How to fix) Fix Adding cap_perfmon to ollama breaks GPU discovery [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#15321Fetched 2026-04-08 02:44:11
View on GitHub
Comments
2
Participants
2
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
commented ×2labeled ×1

Code Example

without cap_perfmon:
Started Ollama Service.
time=2026-04-04T08:08:52.131Z level=INFO source=routes.go:1744 msg="server config" env="map[CUDA_VISIBLE_DEVICES: GGML_VK_VISIBLE_DEVICES: GPU_DEVICE_ORDINAL: HIP_VISIBLE_DEVICES: HSA_OVERRIDE_GFX_VERSION: HTTPS_PROXY: HTTP_PROXY: NO_PROXY: OLLAMA_CONTEXT_LENGTH:0 OLLAMA_DEBUG:INFO OLLAMA_DEBUG_LOG_REQUESTS:false OLLAMA_EDITOR: OLLAMA_FLASH_ATTENTION:false OLLAMA_GPU_OVERHEAD:0 OLLAMA_HOST:http://127.0.0.1:11434 OLLAMA_KEEP_ALIVE:5m0s OLLAMA_KV_CACHE_TYPE: OLLAMA_LLM_LIBRARY: OLLAMA_LOAD_TIMEOUT:5m0s OLLAMA_MAX_LOADED_MODELS:0 OLLAMA_MAX_QUEUE:512 OLLAMA_MODELS:/var/lib/ollama OLLAMA_MULTIUSER_CACHE:false OLLAMA_NEW_ENGINE:false OLLAMA_NOHISTORY:false OLLAMA_NOPRUNE:false OLLAMA_NO_CLOUD:false OLLAMA_NUM_PARALLEL:1 OLLAMA_ORIGINS:[http://localhost https://localhost http://localhost:* https://localhost:* http://127.0.0.1 https://127.0.0.1 http://127.0.0.1:* https://127.0.0.1:* http://0.0.0.0 https://0.0.0.0 http://0.0.0.0:* https://0.0.0.0:* app://* file://* tauri://* vscode-webview://* vscode-file://*] OLLAMA_REMOTES:[ollama.com] OLLAMA_SCHED_SPREAD:false OLLAMA_VULKAN:false ROCR_VISIBLE_DEVICES: http_proxy: https_proxy: no_proxy:]"
time=2026-04-04T08:08:52.131Z level=INFO source=routes.go:1746 msg="Ollama cloud disabled: false"
time=2026-04-04T08:08:52.132Z level=INFO source=images.go:499 msg="total blobs: 29"
time=2026-04-04T08:08:52.132Z level=INFO source=images.go:506 msg="total unused blobs removed: 0"
time=2026-04-04T08:08:52.133Z level=INFO source=routes.go:1802 msg="Listening on 127.0.0.1:11434 (version 0.20.0)"
time=2026-04-04T08:08:52.133Z level=INFO source=runner.go:67 msg="discovering available GPUs..."
time=2026-04-04T08:08:52.133Z level=INFO source=server.go:432 msg="starting runner" cmd="/usr/bin/ollama runner --ollama-engine --port 36717"
time=2026-04-04T08:08:52.268Z level=INFO source=types.go:42 msg="inference compute" id=00000000-0c00-0000-0000-000000000000 filter_id="" library=Vulkan compute=0.0 name=Vulkan0 description="AMD Radeon RX 7700 XT (RADV NAVI32)" libdirs=ollama driver=0.0 pci_id=0000:0c:00.0 type=discrete total="12.0 GiB" available="9.1 GiB"
time=2026-04-04T08:08:52.268Z level=INFO source=types.go:42 msg="inference compute" id=1736597e-c3c7-5b7d-9882-ade1b4a6ea1b filter_id="" library=Vulkan compute=0.0 name=Vulkan1 description="NVIDIA GeForce GTX 1060 6GB" libdirs=ollama driver=0.0 pci_id=0000:0d:00.0 type=discrete total="6.0 GiB" available="5.5 GiB"
time=2026-04-04T08:08:52.268Z level=INFO source=routes.go:1852 msg="vram-based default context" total_vram="18.0 GiB" default_num_ctx=4096


with cap_perfmon:
Started Ollama Service.
time=2026-04-04T08:09:23.746Z level=INFO source=routes.go:1744 msg="server config" env="map[CUDA_VISIBLE_DEVICES: GGML_VK_VISIBLE_DEVICES: GPU_DEVICE_ORDINAL: HIP_VISIBLE_DEVICES: HSA_OVERRIDE_GFX_VERSION: HTTPS_PROXY: HTTP_PROXY: NO_PROXY: OLLAMA_CONTEXT_LENGTH:0 OLLAMA_DEBUG:INFO OLLAMA_DEBUG_LOG_REQUESTS:false OLLAMA_EDITOR: OLLAMA_FLASH_ATTENTION:false OLLAMA_GPU_OVERHEAD:0 OLLAMA_HOST:http://127.0.0.1:11434 OLLAMA_KEEP_ALIVE:5m0s OLLAMA_KV_CACHE_TYPE: OLLAMA_LLM_LIBRARY: OLLAMA_LOAD_TIMEOUT:5m0s OLLAMA_MAX_LOADED_MODELS:0 OLLAMA_MAX_QUEUE:512 OLLAMA_MODELS:/var/lib/ollama OLLAMA_MULTIUSER_CACHE:false OLLAMA_NEW_ENGINE:false OLLAMA_NOHISTORY:false OLLAMA_NOPRUNE:false OLLAMA_NO_CLOUD:false OLLAMA_NUM_PARALLEL:1 OLLAMA_ORIGINS:[http://localhost https://localhost http://localhost:* https://localhost:* http://127.0.0.1 https://127.0.0.1 http://127.0.0.1:* https://127.0.0.1:* http://0.0.0.0 https://0.0.0.0 http://0.0.0.0:* https://0.0.0.0:* app://* file://* tauri://* vscode-webview://* vscode-file://*] OLLAMA_REMOTES:[ollama.com] OLLAMA_SCHED_SPREAD:false OLLAMA_VULKAN:false ROCR_VISIBLE_DEVICES: http_proxy: https_proxy: no_proxy:]"
time=2026-04-04T08:09:23.746Z level=INFO source=routes.go:1746 msg="Ollama cloud disabled: false"
time=2026-04-04T08:09:23.747Z level=INFO source=images.go:499 msg="total blobs: 29"
time=2026-04-04T08:09:23.747Z level=INFO source=images.go:506 msg="total unused blobs removed: 0"
time=2026-04-04T08:09:23.748Z level=INFO source=routes.go:1802 msg="Listening on 127.0.0.1:11434 (version 0.20.0)"
time=2026-04-04T08:09:23.748Z level=INFO source=runner.go:67 msg="discovering available GPUs..."
time=2026-04-04T08:09:23.748Z level=INFO source=server.go:432 msg="starting runner" cmd="/usr/bin/ollama runner --ollama-engine --port 44129"
time=2026-04-04T08:09:23.772Z level=INFO source=types.go:60 msg="inference compute" id=cpu library=cpu compute="" name=cpu description=cpu libdirs=ollama driver="" pci_id="" type="" total="31.3 GiB" available="22.1 GiB"
time=2026-04-04T08:09:23.772Z level=INFO source=routes.go:1852 msg="vram-based default context" total_vram="0 B" default_num_ctx=4096
RAW_BUFFERClick to expand / collapse

What is the issue?

Following the docs at https://docs.ollama.com/gpu#vulkan-gpu-support, I added the perfmon capability to the ollama executable using the command sudo setcap cap_perfmon+ep /usr/bin/ollama to give ollama access to the available VRAM data.

However when restarting the ollama service, I noticed that neither of my GPUs were detected. I usually use Vulkan, but I also tested with ROCm, and I noticed the same behaviour (GPU detected without cap_perfmon, not detected with cap_perfmon).

Relevant log output

without cap_perfmon:
Started Ollama Service.
time=2026-04-04T08:08:52.131Z level=INFO source=routes.go:1744 msg="server config" env="map[CUDA_VISIBLE_DEVICES: GGML_VK_VISIBLE_DEVICES: GPU_DEVICE_ORDINAL: HIP_VISIBLE_DEVICES: HSA_OVERRIDE_GFX_VERSION: HTTPS_PROXY: HTTP_PROXY: NO_PROXY: OLLAMA_CONTEXT_LENGTH:0 OLLAMA_DEBUG:INFO OLLAMA_DEBUG_LOG_REQUESTS:false OLLAMA_EDITOR: OLLAMA_FLASH_ATTENTION:false OLLAMA_GPU_OVERHEAD:0 OLLAMA_HOST:http://127.0.0.1:11434 OLLAMA_KEEP_ALIVE:5m0s OLLAMA_KV_CACHE_TYPE: OLLAMA_LLM_LIBRARY: OLLAMA_LOAD_TIMEOUT:5m0s OLLAMA_MAX_LOADED_MODELS:0 OLLAMA_MAX_QUEUE:512 OLLAMA_MODELS:/var/lib/ollama OLLAMA_MULTIUSER_CACHE:false OLLAMA_NEW_ENGINE:false OLLAMA_NOHISTORY:false OLLAMA_NOPRUNE:false OLLAMA_NO_CLOUD:false OLLAMA_NUM_PARALLEL:1 OLLAMA_ORIGINS:[http://localhost https://localhost http://localhost:* https://localhost:* http://127.0.0.1 https://127.0.0.1 http://127.0.0.1:* https://127.0.0.1:* http://0.0.0.0 https://0.0.0.0 http://0.0.0.0:* https://0.0.0.0:* app://* file://* tauri://* vscode-webview://* vscode-file://*] OLLAMA_REMOTES:[ollama.com] OLLAMA_SCHED_SPREAD:false OLLAMA_VULKAN:false ROCR_VISIBLE_DEVICES: http_proxy: https_proxy: no_proxy:]"
time=2026-04-04T08:08:52.131Z level=INFO source=routes.go:1746 msg="Ollama cloud disabled: false"
time=2026-04-04T08:08:52.132Z level=INFO source=images.go:499 msg="total blobs: 29"
time=2026-04-04T08:08:52.132Z level=INFO source=images.go:506 msg="total unused blobs removed: 0"
time=2026-04-04T08:08:52.133Z level=INFO source=routes.go:1802 msg="Listening on 127.0.0.1:11434 (version 0.20.0)"
time=2026-04-04T08:08:52.133Z level=INFO source=runner.go:67 msg="discovering available GPUs..."
time=2026-04-04T08:08:52.133Z level=INFO source=server.go:432 msg="starting runner" cmd="/usr/bin/ollama runner --ollama-engine --port 36717"
time=2026-04-04T08:08:52.268Z level=INFO source=types.go:42 msg="inference compute" id=00000000-0c00-0000-0000-000000000000 filter_id="" library=Vulkan compute=0.0 name=Vulkan0 description="AMD Radeon RX 7700 XT (RADV NAVI32)" libdirs=ollama driver=0.0 pci_id=0000:0c:00.0 type=discrete total="12.0 GiB" available="9.1 GiB"
time=2026-04-04T08:08:52.268Z level=INFO source=types.go:42 msg="inference compute" id=1736597e-c3c7-5b7d-9882-ade1b4a6ea1b filter_id="" library=Vulkan compute=0.0 name=Vulkan1 description="NVIDIA GeForce GTX 1060 6GB" libdirs=ollama driver=0.0 pci_id=0000:0d:00.0 type=discrete total="6.0 GiB" available="5.5 GiB"
time=2026-04-04T08:08:52.268Z level=INFO source=routes.go:1852 msg="vram-based default context" total_vram="18.0 GiB" default_num_ctx=4096


with cap_perfmon:
Started Ollama Service.
time=2026-04-04T08:09:23.746Z level=INFO source=routes.go:1744 msg="server config" env="map[CUDA_VISIBLE_DEVICES: GGML_VK_VISIBLE_DEVICES: GPU_DEVICE_ORDINAL: HIP_VISIBLE_DEVICES: HSA_OVERRIDE_GFX_VERSION: HTTPS_PROXY: HTTP_PROXY: NO_PROXY: OLLAMA_CONTEXT_LENGTH:0 OLLAMA_DEBUG:INFO OLLAMA_DEBUG_LOG_REQUESTS:false OLLAMA_EDITOR: OLLAMA_FLASH_ATTENTION:false OLLAMA_GPU_OVERHEAD:0 OLLAMA_HOST:http://127.0.0.1:11434 OLLAMA_KEEP_ALIVE:5m0s OLLAMA_KV_CACHE_TYPE: OLLAMA_LLM_LIBRARY: OLLAMA_LOAD_TIMEOUT:5m0s OLLAMA_MAX_LOADED_MODELS:0 OLLAMA_MAX_QUEUE:512 OLLAMA_MODELS:/var/lib/ollama OLLAMA_MULTIUSER_CACHE:false OLLAMA_NEW_ENGINE:false OLLAMA_NOHISTORY:false OLLAMA_NOPRUNE:false OLLAMA_NO_CLOUD:false OLLAMA_NUM_PARALLEL:1 OLLAMA_ORIGINS:[http://localhost https://localhost http://localhost:* https://localhost:* http://127.0.0.1 https://127.0.0.1 http://127.0.0.1:* https://127.0.0.1:* http://0.0.0.0 https://0.0.0.0 http://0.0.0.0:* https://0.0.0.0:* app://* file://* tauri://* vscode-webview://* vscode-file://*] OLLAMA_REMOTES:[ollama.com] OLLAMA_SCHED_SPREAD:false OLLAMA_VULKAN:false ROCR_VISIBLE_DEVICES: http_proxy: https_proxy: no_proxy:]"
time=2026-04-04T08:09:23.746Z level=INFO source=routes.go:1746 msg="Ollama cloud disabled: false"
time=2026-04-04T08:09:23.747Z level=INFO source=images.go:499 msg="total blobs: 29"
time=2026-04-04T08:09:23.747Z level=INFO source=images.go:506 msg="total unused blobs removed: 0"
time=2026-04-04T08:09:23.748Z level=INFO source=routes.go:1802 msg="Listening on 127.0.0.1:11434 (version 0.20.0)"
time=2026-04-04T08:09:23.748Z level=INFO source=runner.go:67 msg="discovering available GPUs..."
time=2026-04-04T08:09:23.748Z level=INFO source=server.go:432 msg="starting runner" cmd="/usr/bin/ollama runner --ollama-engine --port 44129"
time=2026-04-04T08:09:23.772Z level=INFO source=types.go:60 msg="inference compute" id=cpu library=cpu compute="" name=cpu description=cpu libdirs=ollama driver="" pci_id="" type="" total="31.3 GiB" available="22.1 GiB"
time=2026-04-04T08:09:23.772Z level=INFO source=routes.go:1852 msg="vram-based default context" total_vram="0 B" default_num_ctx=4096

OS

Linux

GPU

AMD, Nvidia

CPU

AMD

Ollama version

0.20.0

extent analysis

TL;DR

The issue might be resolved by removing the cap_perfmon capability from the ollama executable, as it seems to be preventing the detection of available GPUs.

Guidance

  • Verify that the cap_perfmon capability is the cause of the issue by removing it and checking if the GPUs are detected again.
  • Check the documentation for the cap_perfmon capability to see if there are any specific requirements or limitations for its use.
  • Consider alternative methods for monitoring GPU performance that do not interfere with GPU detection.
  • Review the log output to see if there are any other clues about what might be causing the issue.

Example

No code example is provided as the issue seems to be related to a specific capability and its interaction with the ollama service.

Notes

The exact cause of the issue is unclear, but it seems to be related to the cap_perfmon capability. Further investigation and testing may be needed to determine the root cause and find a suitable solution.

Recommendation

Apply a workaround by removing the cap_perfmon capability from the ollama executable, as it seems to be the most likely cause of the issue. This can be done by running the command sudo setcap -r /usr/bin/ollama.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

ollama - 💡(How to fix) Fix Adding cap_perfmon to ollama breaks GPU discovery [2 comments, 2 participants]