Vulkan GPU not seen
Im running into an issue where my gpu is not seen inside of localai
john@home ~> MESA_VK_DEVICE_SELECT=list vulkaninfo
'DISPLAY' environment variable not set... skipping surface info
selectable devices:
GPU 0: 1002:1586 "Radeon 8060S Graphics (RADV GFX1151)" integrated GPU 0000:f5:00.0
GPU 1: 10005:0 "llvmpipe (LLVM 20.1.8, 256 bits)" CPU 0000:00:00.0
However when I run the command inside of the container
WARNING: [Loader Message] Code 0 : Layer VK_LAYER_MESA_device_select uses API version 1.3 which is older than the application specified API version of 1.4. May cause issues.
WARNING: [Loader Message] Code 0 : terminator_CreateInstance: Received return code -3 from call to vkCreateInstance in ICD /usr/lib/x86_64-linux-gnu/libvulkan_virtio.so. Skipping this driver.
'DISPLAY' environment variable not set... skipping surface info
error: XDG_RUNTIME_DIR not set in the environment.
amdgpu: unknown (family_id, chip_external_rev): (150, 193)
ERROR: [../src/amd/vulkan/radv_physical_device.c:1918] Code 0 : failed to initialize winsys (VK_ERROR_INITIALIZATION_FAILED)
ERROR: [Loader Message] Code 0 : setup_loader_term_phys_devs: Call to 'vkEnumeratePhysicalDevices' in ICD /usr/lib/x86_64-linux-gnu/libvulkan_radeon.so failed with error code -3
amdgpu: unknown (family_id, chip_external_rev): (150, 193)
ERROR: [../src/amd/vulkan/radv_physical_device.c:1918] Code 0 : failed to initialize winsys (VK_ERROR_INITIALIZATION_FAILED)
ERROR: [Loader Message] Code 0 : setup_loader_term_phys_devs: Call to 'vkEnumeratePhysicalDevices' in ICD /usr/lib/x86_64-linux-gnu/libvulkan_radeon.so failed with error code -3
selectable devices:
GPU 0: 10005:0 "llvmpipe (LLVM 15.0.7, 256 bits)" CPU
https://github.com/MooreThreads/ollama-musa/issues/24
Ahhh, looks like Ubuntu 25.04 uses a new version of libvulkan1
Installing https://launchpad.net/~kisak/+archive/ubuntu/turtle
add-apt-repository ppa:kisak/turtle
apt update
apt upgrade
provides the following output:
# MESA_VK_DEVICE_SELECT=list vulkaninfo
WARNING: [Loader Message] Code 0 : terminator_CreateInstance: Received return code -3 from call to vkCreateInstance in ICD /usr/lib/x86_64-linux-gnu/libvulkan_dzn.so. Skipping this driver.
'DISPLAY' environment variable not set... skipping surface info
error: XDG_RUNTIME_DIR not set in the environment.
selectable devices:
GPU 0: 1002:1586 "AMD Radeon Graphics (RADV GFX1151)" integrated GPU 0000:f5:00.0
GPU 1: 10005:0 "llvmpipe (LLVM 15.0.7, 256 bits)" CPU 0000:00:00.0
Restarting the container and now... :49AM DBG GRPC(flux.1-dev-ggml-127.0.0.1:42729): stderr Creating context 5:49AM DBG GRPC(flux.1-dev-ggml-127.0.0.1:42729): stderr [DEBUG] stable-diffusion.cpp:152 - Using Vulkan backend 5:49AM DBG GRPC(flux.1-dev-ggml-127.0.0.1:42729): stderr [DEBUG] ggml_extend.hpp:62 - ggml_vulkan: Found 1 Vulkan devices: 5:49AM DBG GRPC(flux.1-dev-ggml-127.0.0.1:42729): stderr [DEBUG] ggml_extend.hpp:62 - ggml_vulkan: 0 = AMD Radeon Graphics (RADV GFX1151) (radv) | uma: 1 | fp16: 1 | bf16: 0 | warp size: 64 | shared memory: 65536 | int dot: 1 | matrix cores:
And image generation works :)