Vulkan, ROCm and general AMD GPU questions

cracauer@

Developer
Wondering...

1) How do I test whether I currently have Vulkan available? Is there something like `glxinfo`?

2) Is Vulkan on AMD GPU even supposed to work on FreeBSD right now?

3) What about ROCm, if you have a matching GPU (I don't right now). Are there any big obstacles to bringing that to FreeBSD?
 
@cracauer vulkaninfo --summary is the equivalent of glxinfo -B
Do note that if you only see llvmpipe you have issues.

For OpenCL install mesa-devel (and drm-latest-kmod) and use rusticl. Search for it on recent posts. It should work.

Here: https://forums.freebsd.org/threads/opencl-crashes-the-gpu-amd-mi50.102074/#post-750655

Regarding, vulkan working, yes absolutely (FreeBSD and wine64). For compat/linux, check my howto here: https://forums.freebsd.org/threads/how-to-enable-vulkan-on-compat-linux.101997/ or use shkhln chroot script.

Furmark is my suggestion to test wine/linuxlator. For integrated gpus your millage may vary and opengl may offer better performance.
 
3) What about ROCm, if you have a matching GPU (I don't right now). Are there any big obstacles to bringing that to FreeBSD?
I recall something on Linux with ROCm if the GPU was running in a PCI-E 2.0 slot without PCI-E Atomics support (was trying to use OpenCL with a 6600 XT on a Phenom II board); AMDGPU-PRO libraries worked
 
Thanks, folks.

Looks like I do have Vulkan support on my AMD Ryzen 7 PRO 4750U with Radeon Graphics

Now for testing llama.cpp on it...

Code:
==========
VULKANINFO
==========

Vulkan Instance Version: 1.4.336


Instance Extensions: count = 24
-------------------------------
VK_EXT_acquire_drm_display             : extension revision 1
VK_EXT_acquire_xlib_display            : extension revision 1
VK_EXT_debug_report                    : extension revision 10
VK_EXT_debug_utils                     : extension revision 2
VK_EXT_direct_mode_display             : extension revision 1
VK_EXT_display_surface_counter         : extension revision 1
VK_EXT_headless_surface                : extension revision 1
VK_EXT_surface_maintenance1            : extension revision 1
VK_EXT_swapchain_colorspace            : extension revision 4
VK_KHR_device_group_creation           : extension revision 1
VK_KHR_display                         : extension revision 23
VK_KHR_external_fence_capabilities     : extension revision 1
VK_KHR_external_memory_capabilities    : extension revision 1
VK_KHR_external_semaphore_capabilities : extension revision 1
VK_KHR_get_display_properties2         : extension revision 1
VK_KHR_get_physical_device_properties2 : extension revision 2
VK_KHR_get_surface_capabilities2       : extension revision 1
VK_KHR_portability_enumeration         : extension revision 1
VK_KHR_surface                         : extension revision 25
VK_KHR_surface_protected_capabilities  : extension revision 1
VK_KHR_wayland_surface                 : extension revision 6
VK_KHR_xcb_surface                     : extension revision 6
VK_KHR_xlib_surface                    : extension revision 6
VK_LUNARG_direct_driver_loading        : extension revision 1

Instance Layers:
----------------

Devices:
========
GPU0:
	apiVersion         = 1.3.278
	driverVersion      = 24.1.7
	vendorID           = 0x1002
	deviceID           = 0x1636
	deviceType         = PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU
	deviceName         = AMD Radeon Graphics (RADV RENOIR)
	driverID           = DRIVER_ID_MESA_RADV
	driverName         = radv
	driverInfo         = Mesa 24.1.7
	conformanceVersion = 1.2.7.1
	deviceUUID         = 00000000-0700-0000-0000-000000000000
	driverUUID         = 414d442d-4d45-5341-2d44-525600000000
GPU1:
	apiVersion         = 1.3.278
	driverVersion      = 0.0.1
	vendorID           = 0x10005
	deviceID           = 0x0000
	deviceType         = PHYSICAL_DEVICE_TYPE_CPU
	deviceName         = llvmpipe (LLVM 19.1.7, 256 bits)
	driverID           = DRIVER_ID_MESA_LLVMPIPE
	driverName         = llvmpipe
	driverInfo         = Mesa 24.1.7 (LLVM 19.1.7)
	conformanceVersion = 1.3.1.1
	deviceUUID         = 6d657361-3234-2e31-2e37-000000000000
	driverUUID         = 6c6c766d-7069-7065-5555-494400000000
 
Well, llama.cpp coredumps with "illegal instruction".

I can force ollama to use Vulkan with "OLLAMA_VULKAN=1 GGML_VULKAN=1 ollama ...", but it only goes faster from 1.2 t/s to 2,8 t/s with phi4. I suppose that is more than double, but it doesn't make it useable.
 
cracauer@ if compat/linux is an option, you can install (chroot) the proprietary amd drivers there (pick the last release before they switch to radv for vulkan), the vulkan performance is better than radv. But in any case, as you found out, the vega igpu that you have is a bit anemic.
 
Heh, vulkaninfo doesn't like the gfx card in my main workstation
Code:
tingo@kg-core2:~ $ vulkaninfo --summary
WARNING: radv is not a conformant Vulkan implementation, testing use only.
'-avx512er' is not a recognized feature for this target (ignoring feature)
'-avx512pf' is not a recognized feature for this target (ignoring feature)
'-avx512er' is not a recognized feature for this target (ignoring feature)
'-avx512pf' is not a recognized feature for this target (ignoring feature)
'-avx512er' is not a recognized feature for this target (ignoring feature)
'-avx512pf' is not a recognized feature for this target (ignoring feature)
'-avx512er' is not a recognized feature for this target (ignoring feature)
'-avx512pf' is not a recognized feature for this target (ignoring feature)
'-avx512er' is not a recognized feature for this target (ignoring feature)
'-avx512pf' is not a recognized feature for this target (ignoring feature)
'-avx512er' is not a recognized feature for this target (ignoring feature)
'-avx512pf' is not a recognized feature for this target (ignoring feature)
'-avx512er' is not a recognized feature for this target (ignoring feature)
'-avx512pf' is not a recognized feature for this target (ignoring feature)
'-avx512er' is not a recognized feature for this target (ignoring feature)
'-avx512pf' is not a recognized feature for this target (ignoring feature)
==========
VULKANINFO
==========

Vulkan Instance Version: 1.4.336


Instance Extensions: count = 24
-------------------------------
VK_EXT_acquire_drm_display             : extension revision 1
VK_EXT_acquire_xlib_display            : extension revision 1
VK_EXT_debug_report                    : extension revision 10
VK_EXT_debug_utils                     : extension revision 2
VK_EXT_direct_mode_display             : extension revision 1
VK_EXT_display_surface_counter         : extension revision 1
VK_EXT_headless_surface                : extension revision 1
VK_EXT_surface_maintenance1            : extension revision 1
VK_EXT_swapchain_colorspace            : extension revision 4
VK_KHR_device_group_creation           : extension revision 1
VK_KHR_display                         : extension revision 23
VK_KHR_external_fence_capabilities     : extension revision 1
VK_KHR_external_memory_capabilities    : extension revision 1
VK_KHR_external_semaphore_capabilities : extension revision 1
VK_KHR_get_display_properties2         : extension revision 1
VK_KHR_get_physical_device_properties2 : extension revision 2
VK_KHR_get_surface_capabilities2       : extension revision 1
VK_KHR_portability_enumeration         : extension revision 1
VK_KHR_surface                         : extension revision 25
VK_KHR_surface_protected_capabilities  : extension revision 1
VK_KHR_wayland_surface                 : extension revision 6
VK_KHR_xcb_surface                     : extension revision 6
VK_KHR_xlib_surface                    : extension revision 6
VK_LUNARG_direct_driver_loading        : extension revision 1

Instance Layers:
----------------

Devices:
========
GPU0:
    apiVersion         = 1.3.278
    driverVersion      = 24.1.7
    vendorID           = 0x1002
    deviceID           = 0x6617
    deviceType         = PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
    deviceName         = AMD Radeon R7 240 Series (RADV OLAND)
    driverID           = DRIVER_ID_MESA_RADV
    driverName         = radv
    driverInfo         = Mesa 24.1.7
    conformanceVersion = 0.0.0.0
    deviceUUID         = 00000000-0700-0000-0000-000000000000
    driverUUID         = 414d442d-4d45-5341-2d44-525600000000
GPU1:
    apiVersion         = 1.3.278
    driverVersion      = 0.0.1
    vendorID           = 0x10005
    deviceID           = 0x0000
    deviceType         = PHYSICAL_DEVICE_TYPE_CPU
    deviceName         = llvmpipe (LLVM 19.1.7, 256 bits)
    driverID           = DRIVER_ID_MESA_LLVMPIPE
    driverName         = llvmpipe
    driverInfo         = Mesa 24.1.7 (LLVM 19.1.7)
    conformanceVersion = 1.3.1.1
    deviceUUID         = 6d657361-3234-2e31-2e37-000000000000
    driverUUID         = 6c6c766d-7069-7065-5555-494400000000
Interesting.
 
tingo, that card is supported for vulkan 1.3. But being a gcn 1.0 card has the problem of you needing to force the usage of the amdgpu driver instead of the radeonkms driver (loading the module and maybe some sysctl configurations).
Try with mesa-devel and drm-latest-kmod maybe it works out of the box.

For reference the linux kernel instructions are these:

Note that for GFX6-7 (GCN 1-2) GPUs, the amdgpu kernel driver is currently not the default in Linux (by default the old radeon KMD is used for these old GPUs, which is not supported by RADV), so users need to manually enable amdgpu by adding the following to the kernel command line: radeon.si_support=0 radeon.cik_support=0 amdgpu.si_support=1 amdgpu.cik_support=1
 
Back
Top