Hi there!
This is a bit ahead of time, but I believe it’s about time to start trying, because I have high hopes in VULKAN for Pi4 performance. So let’s go:
Install dependencies (most notably, the MESON build system, Vulkan loader and headers):
sudo apt-get install --no-install-recommends flex bison python3-mako python3-setuptools libexpat1-dev libudev-dev gettext ca-certificates xz-utils zlib1g-dev pkg-config meson libvulkan-dev libvulkan1 glslang-dev spirv-tools
Get libDRM, configure, build and install:
wget https://dri.freedesktop.org/libdrm/libdrm-2.4.100.tar.gz
tar xvzpf libdrm-2.4.100.tar.gz
cd libdrm-2.4.102
mkdir build
cd build
CFLAGS="-O2 -march=armv8-a+crc+simd -mtune=cortex-a72" CXXFLAGS="-O2 -march=armv8-a+crc+simd -mtune=cortex-a72" meson -Dudev=true -Dvc4=true -Dintel=false -Dvmwgfx=false -Dradeon=false -Damdgpu=false -Dnouveau=false -Dfreedreno=false -Dinstall-test-programs=true ..
ninja -j4
sudo ninja install
Get MESA with v3dv VULKAN support, configure, build and install:
git clone https://gitlab.freedesktop.org/apinheiro/mesa.git mesa -b wip/igalia/v3dv --depth 1
cd mesa
mkdir build
cd build
CFLAGS="-O2 -march=armv8-a+crc+simd -mtune=cortex-a72" CXXFLAGS="-O2 -march=armv8-a+crc+simd -mtune=cortex-a72" meson -Dudev=true -Dplatforms=drm -Dvulkan-drivers=broadcom -Ddri-drivers= -Dgallium-drivers=v3d,vc4,kmsro -Dglx=disabled -Dinstall-test-programs=true -Dbuildtype=release --libdir lib ..
ninja -j4
sudo ninja install
Small “fix” so RA finds the headers it needs:
sudo cp -R /usr/include/glslang/SPIRV
Configure RA for VULKAN:
CFLAGS="-O2 -march=armv8-a+crc+simd -mtune=cortex-a72 -DEGL_NO_X11" CXXFLAGS="-O2 -march=armv8-a+crc+simd -mtune=cortex-a72 -DEGL_NO_X11" ./configure --disable-ibxm --disable-vg --disable-x11 --disable-wayland --disable-sdl2 --disable-al --disable-cheevos --disable-ffmpeg --disable-networking --disable-netplaydiscovery --disable-libretrodb --enable-udev --disable-sdl --disable-pulse --disable-oss --disable-freetype --disable-7zip --disable-imageviewer --disable-rjpeg --disable-rbmp --disable-rtga --disable-flac --disable-qt --disable-materialui --disable-xmb --enable-rgui --disable-ozone --disable-gfx_widgets --disable-langextra --disable-cdrom --disable-accessibility --disable-tinyalsa --disable-builtinglslang --disable-rpiled --enable-vulkan
Export the filenames json location so the Vulkan loader can locate the Vulkan library (this could well go into /etc/profile por permanent fix)
export VK_ICD_FILENAMES=/usr/local/share/vulkan/icd.d/broadcom_icd.aarch64.json
However, RA refuses to run:
pi@raspberrypi:~/src/libretro/RetroArch-1.9.0 $ retroarch -v
[INFO] === Build =======================================
[INFO] Capabilities: ASIMD
[INFO] Built: Oct 9 2020
[INFO] Version: 1.9.0
[INFO] =================================================
[INFO] [Environ]: SET_PIXEL_FORMAT: RGB565.
[INFO] [Overrides]: Redirecting save file to "/home/pi/.config/retroarch/saves/.srm".
[INFO] [Overrides]: Redirecting save state to "/home/pi/.config/retroarch/states/.state".
[INFO] Version of libretro API: 1
[INFO] Compiled against API: 1
[INFO] [Audio]: Set audio input rate to: 48000.00 Hz.
[INFO] [Video]: Video @ fullscreen
[INFO] [Vulkan]: Vulkan dynamic library loaded.
[ERROR] [Vulkan]: Could not find instance extensions. Will attempt without them.
[INFO] [Vulkan]: Found vulkan context: khr_display
[INFO] [Vulkan]: Detecting screen resolution 0x0.
[ERROR] [Vulkan]: Failed to enumerate physical devices.
[ERROR] [Vulkan]: Failed to create KHR_display surface.
[ERROR] [Vulkan]: Failed to set video mode.
[ERROR] [Video]: Cannot open video driver ... Exiting ...
[ERROR] Fatal error received in: "init_video()"
Any ideas on why it fails at this point?