1
votes

I have basic Vulkan application, "Hello triangle",derived from this tutorial. In debug mode I use two validations layers:

VK_LAYER_KHRONOS_validation and VK_LAYER_LUNARG_monitor

On Windows I got no problem. Both layers load, I can see FPS counter in the title bar. But I am experiencing different behaviour on Linux (Ubuntu 18.04).

Only VK_LAYER_LUNARG_monitor loads. No FPS counter appears in the title bar.

VK_LAYER_KHRONOS_validation fails to load with the error:

ERROR: libVkLayer_khronos_validation.so: cannot open shared object file: No such file or directory

I performed Linux setup according to the guidelines appearing in this LunarG doc.

  1. Put the whole LunarG SDK in an arbitrary location on my Linux filesystem.
  2. Sourced setup-env.sh into .profile file
  3. Inside the setup-env.sh script I also added VK_LOADER_DEBUG=all in order to see detailed info from Vulkan Loader.
  4. Verified that all the variables set by the script point to correct directories in the SDK. They do.

setup-env.sh:

 VULKAN_SDK="$(dirname "$(readlink -f "${BASH_SOURCE:-$_}" )" )/x86_64"
 export VULKAN_SDK
 PATH="$VULKAN_SDK/bin:$PATH"
 export PATH
 LD_LIBRARY_PATH="$VULKAN_SDK/lib:${LD_LIBRARY_PATH:-}"
 export LD_LIBRARY_PATH
 VK_LAYER_PATH="$VULKAN_SDK/etc/vulkan/explicit_layer.d"
 export VK_LAYER_PATH
 export VK_LOADER_DEBUG=all

Here is the chunk I am gettin from debug output that show the failure of loading the layers:

DEBUG: Loading layer library /home/platform-thirdparty/vulkan-sdk/1.1.121.1/x86_64/lib/libVkLayer_monitor.so INFO: Inserted device layer VK_LAYER_LUNARG_monitor (/home/platform-thirdparty/vulkan-sdk/1.1.121.1/x86_64/lib/libVkLayer_monitor.so) Message:libVkLayer_khronos_validation.so: cannot open shared object file: No such file or directory ERROR: libVkLayer_khronos_validation.so: cannot open shared object file: No such file or directory

Even though it says that

Inserted device layer VK_LAYER_LUNARG_monitor

The monitor doesn't work. If I replace VK_LAYER_KHRONOS_validation with VK_LAYER_LUNARG_standard_validation I am getting the same load fail error. The debugger also shows that the loader did find all the manifest files for all the layers in the SDK. I have no clue what else can be a problem.

My system setup:

Ubuntu 18.04 64bit, Nvidia RTX 3000 Nvidia Drivers: 430.0 VulkanSDK(LunarG): 1.1.121.1

1
What about 1.1.126? Monitor does not work on some platforms; I think e.g. wayland.krOoze
Well,didn't try yet the latest version. Hoped to track down this issue without upgrading.Michael IV
@krOoze same thing with 1.1.126.0Michael IV
Looks almost as if LD_LIBRARY_PATH is ignored. What happens if you edit the full path to the *.so in the json file?krOoze
Tried that one. Changed nothing.Michael IV

1 Answers

0
votes

In this SO question lies the answer by user1824407.

It appears that in the latest Ubuntu distributions (at least in 18.04 I use) setting LD_LIBRARY path into config files like: .profile or /etc/environment or .bashrc

Doesn't take any effec.And indeed,I tried adding the lib path to all of those files, the libs didn't load even that echo $LD_LIBRARY_PATH printed the pass I set. And only when I added the path with the Vulkan validation layers location to /etc/ld.so.conf.d/devlibs.conf where

devlibs.conf

is an arbitrary name I gave the file,now I see both VK_LAYER_LUNARG_monitor and VK_LAYER_KHRONOS_validation are loaded by Vulkan.