Vulkaninfo failure

~$ nix-shell -p vulkan-tools --run vulkaninfo
==========
VULKANINFO
==========

Vulkan Instance Version: 1.1.82

ERROR: [Loader Message] Code 0 : libexpat.so.1: cannot open shared object file: No such file or directory
ERROR: [Loader Message] Code 0 : libz.so.1: cannot open shared object file: No such file or directory
Cannot create Vulkan instance.
/build/source/vulkaninfo/vulkaninfo.c:825: failed with VK_ERROR_INCOMPATIBLE_DRIVER

Is this expected? vulkan-tools runs fine with the system package manager (Pop!_OS 18.10).

I’ve tried chasing down the dependencies, but it ends up looking for libLLVM-7.so.1 which I haven’t found anywhere yet.

I’m not familiar with non-NixOS unfortunately, I heard there are some specialties regarding graphics drivers.
I’m surprised it looks for LLVM 7, the mesa in nixpkgs master uses LLVM 9 (which is still outdated, the latest one is 11).
A similar problem turned up for amdvlk in NixOS, it loads some libraries at runtime, so they needed to be added to the rpath and dontPatchELF = true needed to be set, otherwise nix stripped them again. This kept vulkaninfo and vkcube from working, although other applications worked fine when they linked to the needed libraries anyway.

ldd /run/opengl-driver/lib/libvulkan_radeon.so shows libz.so.1 for me and
env VK_ICD_FILENAMES=/run/opengl-driver/share/vulkan/icd.d/radeon_icd.x86_64.json vulkaninfo works fine.

libvulkan.so from vulkan-loader doesn’t link to libz.so though.

Which vulkan driver are you using?

I have libvulkan1-1.1.82.0-0ubuntu1 installed with dpkg, which works alongside vulkan-tools-1.1.82.0+dfsg1-0ubuntu2.

The driver I’m getting with nixpkgs-20.03 is /nix/store/c7xva3f4wk9i56wnz8lff7cx4fx97zp9-vulkan-loader-1.2.131.2/lib/libvulkan.so.1.

I would look at https://github.com/guibou/nixGL#vulkan-wrappers , should allow you to use nixpkgs pkgs with gpu packages

on NixOS, the original nix-shell -p vulkan-tools --run vulkaninfo run command runs fine.

I’m on a Darter Pro running PopOS, and the suggestion to use nixGL is on point. That is exactly how I run GL and Vulkan applications on this machine

1 Like