-
-
Notifications
You must be signed in to change notification settings - Fork 13.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Khronos Vulkan Samples not running #85817
Comments
I ran the program trough strace and noticed a lot of these errors:
These messages happen right before it prints out the line I also tried running it in gdb, it crashes with the following message:
|
I was able to get the |
OK, I am posting one last update since I figured out what was wrong. So, void* module = dlopen("libvulkan.so", RTLD_NOW | RTLD_LOCAL); but since the I first got around this by replacing said line with: void* module = dlopen("/nix/store/xxxx-vulkan-loader-1.2.131.2/lib/libvulkan.so", RTLD_NOW | RTLD_LOCAL); But that is a little bit too hacky in my opinion, and if the nix store path changes or disappears, it'll break the program again. so I tried editing my with import <nixpkgs> {};
stdenv.mkDerivation rec {
name = "Vulkan-Samples";
buildInputs = [
pkgs.gcc
pkgs.cmake
pkgs.mesa
pkgs.vulkan-headers
pkgs.vulkan-loader
pkgs.vulkan-tools
pkgs.vulkan-validation-layers
pkgs.glfw
pkgs.glm
pkgs.libGLU
pkgs.python3
pkgs.xorg.libX11
pkgs.xorg.libXcursor
pkgs.xorg.libXrandr
pkgs.xorg.libXinerama
pkgs.xorg.libXi
pkgs.xorg.libXext
pkgs.xorg.libXrender
pkgs.xorg.libXxf86vm
pkgs.xorg.libXdmcp
pkgs.xorg.libXau
pkgs.xorg.libxcb
pkgs.gnutls
pkgs.xorg.libpthreadstubs
pkgs.llvm_10
pkgs.clang_10
pkgs.pkg-config
];
LD_LIBRARY_PATH="${pkgs.vulkan-loader}/lib";
shellHook = "echo ${pkgs.vulkan-loader}";
} I know there probably is a bunch of packages in there right now I do not actually need but those are worries for another time. Running the hello_triangle sample produces the correct triangle this time :D. Now I am wondering if this is the correct way to dynamically link with |
You'll frequently run into this problem when using
|
I think I will stick with this solution for now since my own application will be statically linked, so that shouldn't be a problem. I am however going to looking into point 2 and 3, just to broaden my knowledge :). Thanks for the reply, I will close this issue. |
You shouldn't statically link the vulkan loader; it's specifically designed to be upgraded independent of applications, for compatibility with future drivers and layers. It's also impossible to have a 100% statically linked application that uses vulkan at all, because video drivers are dynamically loaded, which requires a dynamically linked libc. |
Describe the bug
I am able to build the Khronos Vulkan Samples but not run them.
I get an error:
[error] [build/linux/app/main.cpp:75] Failed to initialize volk.
To Reproduce
Expected behavior
With a simple sample application like
hello_triangle
a multi colored triangle is supposed to show up in a window accelerated by Vulkan.Additional context
I am extremely new to nix and nixos, I literally installed it yesterday.
So I am extremely sorry if I am posting this issue in the wrong place.
Please do correct me and I will move my question elsewhere.
I used to use Arch Linux before and I was able to get the samples to run on there.
I checked on the volk github page and it says that if it fails to find a vulkan loader it will throw that error.
I am trying to build it in a separate
nix-shell
with adefault.nix
:I also tried installing the
vulkan-*
packages directly into my system packages but nothing changed.I read a previous issue #57770 and tried setting the environment variable
VK_ICD_FILENAMES
and deleting the files in~/.cache/
but that also did not fix the problem.Metadata
The text was updated successfully, but these errors were encountered: