I’m trying to create a development environment for a vulkan engine, GitHub - tmayoff/wren: vulkan game engine.
However whenever I try running the application SDL2 spits this error out: Installed Vulkan doesn't implement the VK_KHR_surface extension.
and vulkaninfo:
WARNING: [Loader Message] Code 0 : Found pre_instance_functions section in explicit layer from "/nix/store/i7byxilmli2jrp5gwj0pgr31s1mhmkzr-renderdoc-1.32/share/vulkan/implicit_layer.d/renderdoc_capture.json". This section is only valid in implicit layers. The section will be ignored
ERROR: [Loader Message] Code 0 : libdrm.so.2: cannot open shared object file: No such file or directory
ERROR: [Loader Message] Code 0 : loader_icd_scan: Failed loading library associated with ICD JSON /usr/lib64/libvulkan_broadcom.so. Ignoring this JSON
ERROR: [Loader Message] Code 0 : libz.so.1: cannot open shared object file: No such file or directory
ERROR: [Loader Message] Code 0 : loader_icd_scan: Failed loading library associated with ICD JSON /usr/lib64/libvulkan_freedreno.so. Ignoring this JSON
ERROR: [Loader Message] Code 0 : libdrm.so.2: cannot open shared object file: No such file or directory
ERROR: [Loader Message] Code 0 : loader_icd_scan: Failed loading library associated with ICD JSON /usr/lib64/libvulkan_intel_hasvk.so. Ignoring this JSON
ERROR: [Loader Message] Code 0 : libdrm.so.2: cannot open shared object file: No such file or directory
ERROR: [Loader Message] Code 0 : loader_icd_scan: Failed loading library associated with ICD JSON /usr/lib64/libvulkan_intel.so. Ignoring this JSON
ERROR: [Loader Message] Code 0 : libLLVM.so.18.1: cannot open shared object file: No such file or directory
ERROR: [Loader Message] Code 0 : loader_icd_scan: Failed loading library associated with ICD JSON /usr/lib64/libvulkan_lvp.so. Ignoring this JSON
ERROR: [Loader Message] Code 0 : libdrm.so.2: cannot open shared object file: No such file or directory
ERROR: [Loader Message] Code 0 : loader_icd_scan: Failed loading library associated with ICD JSON /usr/lib64/libvulkan_panfrost.so. Ignoring this JSON
ERROR: [Loader Message] Code 0 : libpowervr_rogue.so: cannot open shared object file: No such file or directory
ERROR: [Loader Message] Code 0 : loader_icd_scan: Failed loading library associated with ICD JSON /usr/lib64/libvulkan_powervr_mesa.so. Ignoring this JSON
ERROR: [Loader Message] Code 0 : libLLVM.so.18.1: cannot open shared object file: No such file or directory
ERROR: [Loader Message] Code 0 : loader_icd_scan: Failed loading library associated with ICD JSON /usr/lib64/libvulkan_radeon.so. Ignoring this JSON
ERROR: [Loader Message] Code 0 : vkCreateInstance: Found no drivers!
Cannot create Vulkan instance.
This problem is often caused by a faulty installation of the Vulkan driver or attempting to use a GPU that does not support Vulkan.
ERROR at /build/source/vulkaninfo/./vulkaninfo.h:458:vkCreateInstance failed with ERROR_INCOMPATIBLE_DRIVER
This is my flake
{
description = "Wren game engine";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = import nixpkgs {
inherit system;
};
vma = pkgs.stdenv.mkDerivation {
name = "VulkanMemoryAllocator";
src = pkgs.fetchFromGitHub {
owner = "GPUOpen-LibrariesAndSDKs";
repo = "VulkanMemoryAllocator";
rev = "7942b798289f752dc23b0a79516fd8545febd718";
hash = "sha256-x/5OECXCG4rxNtyHZKaMnrNbDjxiP9bQFtQiqEFjNKQ=";
};
nativeBuildInputs = with pkgs; [
cmake
];
};
rawNativeBuildInputs = with pkgs; [
pkg-config
meson
cmake
ninja
];
rawBuildInputs = with pkgs; [
# catch2_3
SDL2
spdlog
tl-expected
boost
vulkan-headers
tracy
vma
shaderc
spirv-headers
fontconfig
];
in rec {
vulkan_layer_path = "${pkgs.vulkan-validation-layers}/share/vulkan/explicit_layer.d:${pkgs.renderdoc}/share/vulkan/implicit_layer.d";
spirv-reflect = pkgs.stdenv.mkDerivation {
name = "spirv-reflect";
src = pkgs.fetchFromGitHub {
owner = "KhronosGroup";
repo = "SPIRV-Reflect";
rev = "vulkan-sdk-1.3.275.0";
hash = "sha256-WnbNEyoutiWs+4Cu9Nv9KfNNmT4gKe/IzyiL/bLb3rg=";
};
cmakeFlags = [
"-DSPIRV_REFLECT_STATIC_LIB=On"
];
nativeBuildInputs = [
pkgs.meson
pkgs.cmake
pkgs.ninja
];
};
packages = rec {
wren_editor = pkgs.stdenv.mkDerivation {
name = "wren_editor";
src = ./.;
VK_LAYER_PATH = vulkan_layer_path;
nativeBuildInputs = rawNativeBuildInputs;
buildInputs = rawBuildInputs;
installPhase = ''
mkdir -p $out/bin
ninja install
'';
};
default = wren_editor;
};
devShell = pkgs.mkShell.override {stdenv = pkgs.clangStdenv;} {
NIX_CFLAGS_COMPILE = "-U_FORTIFY_SOURCE";
VK_LAYER_PATH = vulkan_layer_path;
nativeBuildInputs = with pkgs;
[
vulkan-loader
vulkan-tools
]
++ rawNativeBuildInputs;
buildInputs = with pkgs;
[
vulkan-validation-layers
]
++ rawBuildInputs;
};
shellHook = ''
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:${pkgs.spirv-cross}"
'';
}
);
}
I’m running fedora 39 with wayland & nix install. vulkaninfo works fine outside of the devshell