User Tools

Site Tools


notes:vulkan

Vulkan

Tricky – need to set up without X or Wayland, exact process depends on your GPU hardware.

Install these deps first to get them out of the way: sudo apt-get install libvulkan-dev libvulkan1 vulkan-tools libdrm-dev libdrm-tests flex bison python3-mako python3-setuptools libexpat1-dev libudev-dev gettext ca-certificates xz-utils zlib1g-dev pkg-config meson --no-install-recommends

Pi 4

Basically follow this post except:

Don't bother installing libdrm from source, just do sudo apt install libdrm-dev as we say above

Run the meson configure command for Mesa without the -Ddri-drivers='' option, which was removed in some recent version of Mesa since the guide was written:

CFLAGS="-O2 -march=armv8-a+crc+simd -mtune=cortex-a72" CXXFLAGS="-O2 -march=armv8-a+crc+simd -mtune=cortex-a72" meson -Dglx=disabled -Dplatforms= -Dllvm=disabled -Dvulkan-drivers=broadcom -Dgallium-drivers=v3d,vc4,kmsro -Dbuildtype=release ..

After building Mesa, sudo ninja install to install Mesa system-wide

Clone https://github.com/krh/vkcube and mkdir build and meson .. and ninja and ./vkcube -m khr -k 0:0:0.

Hades Canyon NUC

Also similar to above Pi 4 instructions.

modetest -M amdgpu to list connectors and not try the Intel integrated graphics

modetest -M amdgpu -s 86:3840x2160

You need glslang-tools before running meson to build Mesa:

sudo apt install glslang-dev glslang-tools spirv-tools python3-mako pkg-config libudev-dev clang llvm-dev bison flex

sudo apt install libelf-dev for some reason https://gitlab.freedesktop.org/mesa/mesa/-/issues/7456 make sure meson finds it below! Run-time dependency libelf found: YES 0.186 it won’t fail in configure phase if it doesn’t

Mesa meson configure options for the AMD GPU:

meson -Dglx=disabled -Dplatforms= -Dvulkan-drivers=amd -Ddri-drivers='' -Dgallium-drivers=radeonsi -Dbuildtype=release ..

vulkaninfo

sudo chmod 666 /dev/dri/renderD129

Other systems

Usually, you need to change the -Dvulkan-drivers and -Dgallium-drivers options depending on your GPU.

Intel i915 (Charles): meson -Dllvm=disabled -Dglx=disabled -Dplatforms= -Dvulkan-drivers=intel -Dgallium-drivers=i915 -Dbuildtype=release ..

You might need to chmod a different /dev/dri path if no Vulkan device found.

Other deps

sudo apt install vulkan-validationlayers

glslc: https://github.com/google/shaderc/blob/main/downloads.md

Testing

clone https://github.com/krh/vkcube

mkdir build; cd build; meson .. && ninja

./vkcube -m khr -k 0:0:0

notes/vulkan.txt · Last modified: 2023/09/30 19:41 by osnr

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki