Skip to content
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

Last steam-manjaro version with pvkrun, does not run the dedicated gpu and vulkan #77

Closed
zimudec opened this issue Sep 29, 2020 · 69 comments

Comments

@zimudec
Copy link

zimudec commented Sep 29, 2020

The latest version of steam-manjaro (1.0.0.66-1) still shows an error when trying to run vulkan:

PrimusVK: Searching for display GPU:
PrimusVK: 0x56731a60: 
PrimusVK: Got integrated gpu!
PrimusVK: Device: Intel(R) HD Graphics 4000 (IVB GT2)
PrimusVK:   Type: 1
PrimusVK: Searching for render GPU:
PrimusVK: 0x56731a60.
PrimusVK: No device for the rendering GPU found. Is the correct driver installed?
PrimusVK: VK_ICD_FILENAMES not set
vkCreateInstance failed with error -3
BInit - Unable to initialize Vulkan!
[0929/203723.960952:INFO:crash_reporting.cc(270)] Crash reporting enabled for process: renderer
[0929/203724.054021:INFO:crash_reporting.cc(270)] Crash reporting enabled for process: renderer
[0929/203724.172321:INFO:crash_reporting.cc(270)] Crash reporting enabled for process: renderer
Installing breakpad exception handler for appid(steam)/version(1599174997)

I go back to the previous version (1.0.0.61-7) and pvkrun with vulkan, steam and optimus works without problems.

I do not know the cause of the problem, I need guidance.

@felixdoerre
Copy link
Owner

Could you share the output with the environment variable VK_LOADER_DEBUG=info set?
The error clearly shows that the nvidia driver is not loading and not reporting any vulkan devices, and I would like to know if the loader skips it (for some reason) or the driver simply does not respond with any devices.

@zimudec
Copy link
Author

zimudec commented Oct 1, 2020

This is the result:

`Manjaro steam native configuration found!
Running Steam on manjarolinux 20.1 64-bit
STEAM_RUNTIME is disabled by the user
Can't find 'steam-runtime-check-requirements', continuing anyway
/home/zimudec/.local/share/Steam/ubuntu12_32/steam
WARNING: setlocale('en_US.UTF-8') failed, using locale: 'C'. International characters may not work.
[2020-09-30 20:58:18] Startup - updater built Sep 3 2020 21:18:09
Installing breakpad exception handler for appid(steam)/version(1599174997)
[2020-09-30 20:58:19] Loading cached metrics from disk (/home/zimudec/.local/share/Steam/package/steam_client_metrics.bin)
Installing breakpad exception handler for appid(steam)/version(1599174997)
[2020-09-30 20:58:19] Verificando instalación...
[2020-09-30 20:58:19] Verification complete
Loaded SDL version 2.0.13-5919606

(steam:2798): Gtk-WARNING **: 20:58:21.609: Unable to locate theme engine in module_path: "murrine",

(steam:2798): Gtk-WARNING **: 20:58:21.632: Unable to locate theme engine in module_path: "murrine",

(steam:2798): Gtk-WARNING **: 20:58:21.632: Unable to locate theme engine in module_path: "murrine",

(steam:2798): Gtk-WARNING **: 20:58:21.632: Unable to locate theme engine in module_path: "murrine",

(steam:2798): Gtk-WARNING **: 20:58:21.649: Unable to locate theme engine in module_path: "adwaita",

(steam:2798): Gtk-WARNING **: 20:58:21.650: Unable to locate theme engine in module_path: "adwaita",

(steam:2798): Gtk-WARNING **: 20:58:21.653: Unable to locate theme engine in module_path: "murrine",

(steam:2798): Gtk-WARNING **: 20:58:21.653: Unable to locate theme engine in module_path: "murrine",
STEAM_RUNTIME_HEAVY: 0
Installing breakpad exception handler for appid(steam)/version(1599174997)
[0930/205826.402867:INFO:crash_reporting.cc(247)] Crash reporting enabled for process: browser
[0930/205826.686080:WARNING:crash_reporting.cc(286)] Failed to set crash key: UserID with value: 0
[0930/205826.686217:WARNING:crash_reporting.cc(286)] Failed to set crash key: BuildID with value: 1599167902
[0930/205826.686267:WARNING:crash_reporting.cc(286)] Failed to set crash key: SteamUniverse with value: Public
[0930/205826.686291:WARNING:crash_reporting.cc(286)] Failed to set crash key: Vendor with value: Valve
[0930/205828.499315:WARNING:crash_reporting.cc(286)] Failed to set crash key: UserID with value: 0
[0930/205828.499445:WARNING:crash_reporting.cc(286)] Failed to set crash key: BuildID with value: 1599167902
[0930/205828.499499:WARNING:crash_reporting.cc(286)] Failed to set crash key: SteamUniverse with value: Public
[0930/205828.499518:WARNING:crash_reporting.cc(286)] Failed to set crash key: Vendor with value: Valve
[0930/205828.500330:INFO:crash_reporting.cc(247)] Crash reporting enabled for process: gpu-process
[0930/205828.832675:ERROR:sandbox_linux.cc(372)] InitializeSandbox() called with multiple threads in process gpu-process.
[0930/205829.759802:WARNING:crash_reporting.cc(286)] Failed to set crash key: UserID with value: 0
[0930/205829.759933:WARNING:crash_reporting.cc(286)] Failed to set crash key: BuildID with value: 1599167902
[0930/205829.759943:WARNING:crash_reporting.cc(286)] Failed to set crash key: SteamUniverse with value: Public
[0930/205829.759952:WARNING:crash_reporting.cc(286)] Failed to set crash key: Vendor with value: Valve
[0930/205829.811928:INFO:crash_reporting.cc(247)] Crash reporting enabled for process: utility
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
CAppInfoCacheReadFromDiskThread took 2880 milliseconds to initialize
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Warning: failed to set thread priority: set failed for 8: -1: setpriority() failed
Warning: failed to set thread priority: set failed for priority 8
Warning: support for elevated priorities is most likely unavailable, suppressing future warnings
Warning: failed to set thread priority: set failed for 8: -1: setpriority() failed
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
CApplicationManagerPopulateThread took 9630 milliseconds to initialize (will have waited on CAppInfoCacheReadFromDiskThread)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Proceed to auto login
Opted-in Controller Mask for AppId 0: 0

(steam:2798): Gtk-WARNING **: 20:58:42.343: gtk_disable_setlocale() must be called before gtk_init()
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/primus_vk.json, version "1.0.0"
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_x86_64.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Loader is running with elevated permissions. Environment variable VK_ICD_FILENAMES will be ignored.
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/nv_vulkan_wrapper.json, version "1.0.0"
Installing breakpad exception handler for appid(steam)/version(1599174997)
local (potentially out of sync) copy of roaming config loaded - 14868 bytes.
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.i686.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/nvidia_icd.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Loader is running with elevated permissions. Environment variable VK_ICD_FILENAMES will be ignored.
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/nv_vulkan_wrapper.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.i686.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/nvidia_icd.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/primus_vk.json, version "1.0.0"
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_x86_64.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/primus_vk.json, version "1.0.0"
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_x86_64.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Loader is running with elevated permissions. Environment variable VK_ICD_FILENAMES will be ignored.
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/nv_vulkan_wrapper.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.i686.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/nvidia_icd.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/primus_vk.json, version "1.0.0"
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_x86_64.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/primus_vk.json, version "1.0.0"
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_x86_64.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Loader is running with elevated permissions. Environment variable VK_LAYER_PATH will be ignored.
INFO: Found manifest file /usr/share/vulkan/explicit_layer.d/VkLayer_MESA_overlay.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Loader is running with elevated permissions. Environment variable VK_ICD_FILENAMES will be ignored.
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/nv_vulkan_wrapper.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.i686.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/nvidia_icd.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.x86_64.json, version "1.0.0"
INFO: Insert instance layer VK_LAYER_MESA_device_select (libVkLayer_MESA_device_select.so)
INFO: Insert instance layer VK_LAYER_PRIMUS_PrimusVK (libprimus_vk.so.1)
Xlib: extension "NV-GLX" missing on display ":0.0".
Xlib: extension "NV-GLX" missing on display ":0.0".
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
PrimusVK: Searching for display GPU:
PrimusVK: 0x55964a423c10:
PrimusVK: Got integrated gpu!
PrimusVK: Device: Intel(R) HD Graphics 4000 (IVB GT2)
PrimusVK: Type: 1
PrimusVK: Searching for render GPU:
PrimusVK: 0x55964a423c10.
PrimusVK: No device for the rendering GPU found. Is the correct driver installed?
PrimusVK: VK_ICD_FILENAMES not set
vkCreateInstance failed with error -3
BInit - Unable to initialize Vulkan!
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
roaming config store loaded successfully - 14868 bytes.
migrating temporary roaming config store
BRefreshApplicationsInLibrary 1: 42ms
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/primus_vk.json, version "1.0.0"
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_x86_64.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Loader is running with elevated permissions. Environment variable VK_ICD_FILENAMES will be ignored.
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/nv_vulkan_wrapper.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.i686.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/nvidia_icd.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Loader is running with elevated permissions. Environment variable VK_ICD_FILENAMES will be ignored.
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/nv_vulkan_wrapper.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.i686.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/nvidia_icd.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/primus_vk.json, version "1.0.0"
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_x86_64.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/primus_vk.json, version "1.0.0"
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_x86_64.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Loader is running with elevated permissions. Environment variable VK_ICD_FILENAMES will be ignored.
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/nv_vulkan_wrapper.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.i686.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/nvidia_icd.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/primus_vk.json, version "1.0.0"
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_x86_64.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/primus_vk.json, version "1.0.0"
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_x86_64.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Loader is running with elevated permissions. Environment variable VK_LAYER_PATH will be ignored.
INFO: Found manifest file /usr/share/vulkan/explicit_layer.d/VkLayer_MESA_overlay.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Loader is running with elevated permissions. Environment variable VK_ICD_FILENAMES will be ignored.
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/nv_vulkan_wrapper.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.i686.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/nvidia_icd.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.x86_64.json, version "1.0.0"
INFO: Insert instance layer VK_LAYER_MESA_device_select (libVkLayer_MESA_device_select.so)
INFO: Insert instance layer VK_LAYER_PRIMUS_PrimusVK (libprimus_vk.so.1)
Xlib: extension "NV-GLX" missing on display ":0.0".
Xlib: extension "NV-GLX" missing on display ":0.0".
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
PrimusVK: Searching for display GPU:
PrimusVK: 0x56cd5be0:
PrimusVK: Got integrated gpu!
PrimusVK: Device: Intel(R) HD Graphics 4000 (IVB GT2)
PrimusVK: Type: 1
PrimusVK: Searching for render GPU:
PrimusVK: 0x56cd5be0.
PrimusVK: No device for the rendering GPU found. Is the correct driver installed?
PrimusVK: VK_ICD_FILENAMES not set
vkCreateInstance failed with error -3
BInit - Unable to initialize Vulkan!
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Failed to init SteamVR because it isn't installed
Installing breakpad exception handler for appid(steam)/version(1599174997)
[0930/205850.625005:INFO:crash_reporting.cc(270)] Crash reporting enabled for process: renderer
ExecCommandLine: "'/home/zimudec/.local/share/Steam/ubuntu12_32/steam'"
System startup time: 30.07 seconds
Installing breakpad exception handler for appid(steam)/version(1599174997)
[0930/205852.431286:INFO:crash_reporting.cc(270)] Crash reporting enabled for process: renderer
[0930/205852.437064:INFO:crash_reporting.cc(270)] Crash reporting enabled for process: renderer
Warning: failed to set thread priority: set failed for 4: -1: setpriority() failed
Warning: failed to set thread priority: set failed for priority 4
Warning: support for elevated priorities is most likely unavailable, suppressing future warnings
Warning: failed to set thread priority: set failed for 4: -1: setpriority() failed
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
BuildCompleteAppOverviewChange: 332
RegisterForAppOverview 1: 33ms
RegisterForAppOverview 2: 34ms
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)`

@felixdoerre
Copy link
Owner

So we can see: the nvidia driver is loaded, however it does not report a device. From the output, I can see, that you didn't remove /usr/share/vulkan/icd.d/nvidia_icd.json. Could you please try to do that?

Loading the nvidia driver twice (once unwrappend and once wrapped) can cause the wrapped driver to not work (and the unwrapped driver never works on optimus laptops in any case). The "real" error message is Xlib: extension "NV-GLX" missing on display ":0.0"., this is where the nvidia driver complains that it tries to connect to display :0 which is not an nvidia-X-server. This is exactly the behavior that the "wrapped" driver intends to fix. However loading the driver twice can nullify this workaround.

@zimudec
Copy link
Author

zimudec commented Oct 1, 2020

I deleted the json file and tried running pvkrun steam, but it showed the same above mentioned error again.

Something very curious:

I ran lutris with pvkrun, it detects my nvidia gpu with no problems. Then, without closing lutris, I ran pvkrun steam, and it also correctly detected my nvidia gpu. But of course, if I close steam and lutris, and then run only pvkrun steam, it doesn't start nvidia and again shows the error.

[zimudec@zimudec ~]$ VK_LOADER_DEBUG=info pvkrun lutris
Unable to load locale dir, translations won't work.
2020-10-01 20:48:16,516: Failed to get libraries from ldconfig: Command '['/usr/bin/ldconfig', '-p']' died with <Signals.SIGSEGV: 11>.
2020-10-01 20:48:17,923: MAME XML generation launched in the background, not returning anything this time
2020-10-01 20:48:17,924: Getting full game list from MAME...
2020-10-01 20:48:17,926: MAME isn't installed, can't retrieve systems list.
2020-10-01 20:48:17,997: Running Lutris 0.5.7.1
2020-10-01 20:48:17,997: Using NVIDIA Corporation
2020-10-01 20:48:17,997: GPU: 8086:0166 17AA:3904 using i915 drivers
2020-10-01 20:48:17,998: i386 libGL.so.1 missing (needed by opengl)
2020-10-01 20:48:17,998: x86_64 libGL.so.1 missing (needed by opengl)
2020-10-01 20:48:17,998: i386 libvulkan.so.1 missing (needed by vulkan)
2020-10-01 20:48:17,998: x86_64 libvulkan.so.1 missing (needed by vulkan)
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/primus_vk.json, version "1.0.0"
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_x86_64.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Loader is running with elevated permissions. Environment variable VK_LAYER_PATH will be ignored.
INFO: Found manifest file /usr/share/vulkan/explicit_layer.d/VkLayer_MESA_overlay.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Loader is running with elevated permissions. Environment variable VK_ICD_FILENAMES will be ignored.
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/nv_vulkan_wrapper.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.i686.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.x86_64.json, version "1.0.0"
INFO: Insert instance layer VK_LAYER_MESA_device_select (libVkLayer_MESA_device_select.so)
INFO: Insert instance layer VK_LAYER_PRIMUS_PrimusVK (libprimus_vk.so.1)
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
PrimusVK: Searching for display GPU:
PrimusVK: 0x557a4ac82fa0:
PrimusVK: Got integrated gpu!
PrimusVK: Device: Intel(R) HD Graphics 4000 (IVB GT2)
PrimusVK: Type: 1
PrimusVK: Searching for render GPU:
PrimusVK: 0x557a4ac82fa0.
PrimusVK: 0x557a4ab92c50.
PrimusVK: Got discrete gpu!
PrimusVK: Device: GeForce GT 740M
PrimusVK: Type: 2
2020-10-01 20:48:19,124: Vulkan is supported
2020-10-01 20:48:19,774: MAME XML written

Without closing lutris:

[zimudec@zimudec ~]$ VK_LOADER_DEBUG=info pvkrun steam
Manjaro steam native configuration found!
Running Steam on manjarolinux 20.1 64-bit
STEAM_RUNTIME is disabled by the user
Can't find 'steam-runtime-check-requirements', continuing anyway
/home/zimudec/.local/share/Steam/ubuntu12_32/steam
WARNING: setlocale('en_US.UTF-8') failed, using locale: 'C'. International characters may not work.
[2020-10-01 20:52:36] Startup - updater built Sep 3 2020 21:18:09
Installing breakpad exception handler for appid(steam)/version(1599174997)
[2020-10-01 20:52:36] Loading cached metrics from disk (/home/zimudec/.local/share/Steam/package/steam_client_metrics.bin)
Installing breakpad exception handler for appid(steam)/version(1599174997)
[2020-10-01 20:52:36] Verificando instalación...
[2020-10-01 20:52:36] Verification complete
Loaded SDL version 2.0.13-5919606

(steam:7774): Gtk-WARNING **: 20:52:37.110: Unable to locate theme engine in module_path: "murrine",

(steam:7774): Gtk-WARNING **: 20:52:37.112: Unable to locate theme engine in module_path: "murrine",

(steam:7774): Gtk-WARNING **: 20:52:37.112: Unable to locate theme engine in module_path: "murrine",

(steam:7774): Gtk-WARNING **: 20:52:37.112: Unable to locate theme engine in module_path: "murrine",

(steam:7774): Gtk-WARNING **: 20:52:37.114: Unable to locate theme engine in module_path: "adwaita",

(steam:7774): Gtk-WARNING **: 20:52:37.114: Unable to locate theme engine in module_path: "adwaita",

(steam:7774): Gtk-WARNING **: 20:52:37.116: Unable to locate theme engine in module_path: "murrine",

(steam:7774): Gtk-WARNING **: 20:52:37.116: Unable to locate theme engine in module_path: "murrine",
Installing breakpad exception handler for appid(steam)/version(1599174997)
STEAM_RUNTIME_HEAVY: 0
[1001/205237.365573:INFO:crash_reporting.cc(247)] Crash reporting enabled for process: browser
[1001/205237.394294:WARNING:crash_reporting.cc(286)] Failed to set crash key: UserID with value: 0
[1001/205237.394374:WARNING:crash_reporting.cc(286)] Failed to set crash key: BuildID with value: 1599167902
[1001/205237.394386:WARNING:crash_reporting.cc(286)] Failed to set crash key: SteamUniverse with value: Public
[1001/205237.394396:WARNING:crash_reporting.cc(286)] Failed to set crash key: Vendor with value: Valve
[1001/205237.441335:WARNING:crash_reporting.cc(286)] Failed to set crash key: UserID with value: 0
[1001/205237.441418:WARNING:crash_reporting.cc(286)] Failed to set crash key: BuildID with value: 1599167902
[1001/205237.441429:WARNING:crash_reporting.cc(286)] Failed to set crash key: SteamUniverse with value: Public
[1001/205237.441439:WARNING:crash_reporting.cc(286)] Failed to set crash key: Vendor with value: Valve
[1001/205237.442136:INFO:crash_reporting.cc(247)] Crash reporting enabled for process: gpu-process
[1001/205237.472483:ERROR:sandbox_linux.cc(372)] InitializeSandbox() called with multiple threads in process gpu-process.
[1001/205237.517278:WARNING:crash_reporting.cc(286)] Failed to set crash key: UserID with value: 0
[1001/205237.517377:WARNING:crash_reporting.cc(286)] Failed to set crash key: BuildID with value: 1599167902
[1001/205237.517387:WARNING:crash_reporting.cc(286)] Failed to set crash key: SteamUniverse with value: Public
[1001/205237.517396:WARNING:crash_reporting.cc(286)] Failed to set crash key: Vendor with value: Valve
[1001/205237.518152:INFO:crash_reporting.cc(247)] Crash reporting enabled for process: utility
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Warning: failed to set thread priority: set failed for 8: -1: setpriority() failed
Warning: failed to set thread priority: set failed for 8: -1: setpriority() failed
Warning: failed to set thread priority: set failed for priority 8
Warning: failed to set thread priority: set failed for priority 8
Warning: support for elevated priorities is most likely unavailable, suppressing future warnings
Warning: support for elevated priorities is most likely unavailable, suppressing future warnings
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
CAppInfoCacheReadFromDiskThread took 143 milliseconds to initialize
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
CApplicationManagerPopulateThread took 6568 milliseconds to initialize (will have waited on CAppInfoCacheReadFromDiskThread)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Proceed to auto login
Opted-in Controller Mask for AppId 0: 0

(steam:7774): Gtk-WARNING **: 20:52:45.026: gtk_disable_setlocale() must be called before gtk_init()
local (potentially out of sync) copy of roaming config loaded - 14868 bytes.
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/primus_vk.json, version "1.0.0"
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_x86_64.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Loader is running with elevated permissions. Environment variable VK_ICD_FILENAMES will be ignored.
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/nv_vulkan_wrapper.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.i686.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Loader is running with elevated permissions. Environment variable VK_ICD_FILENAMES will be ignored.
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/nv_vulkan_wrapper.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.i686.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/primus_vk.json, version "1.0.0"
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_x86_64.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/primus_vk.json, version "1.0.0"
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_x86_64.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Loader is running with elevated permissions. Environment variable VK_ICD_FILENAMES will be ignored.
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/nv_vulkan_wrapper.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.i686.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/primus_vk.json, version "1.0.0"
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_x86_64.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/primus_vk.json, version "1.0.0"
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_x86_64.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Loader is running with elevated permissions. Environment variable VK_LAYER_PATH will be ignored.
INFO: Found manifest file /usr/share/vulkan/explicit_layer.d/VkLayer_MESA_overlay.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Loader is running with elevated permissions. Environment variable VK_ICD_FILENAMES will be ignored.
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/nv_vulkan_wrapper.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.i686.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.x86_64.json, version "1.0.0"
INFO: Insert instance layer VK_LAYER_MESA_device_select (libVkLayer_MESA_device_select.so)
INFO: Insert instance layer VK_LAYER_PRIMUS_PrimusVK (libprimus_vk.so.1)
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
PrimusVK: Searching for display GPU:
PrimusVK: 0x558231586f20:
PrimusVK: Got integrated gpu!
PrimusVK: Device: Intel(R) HD Graphics 4000 (IVB GT2)
PrimusVK: Type: 1
PrimusVK: Searching for render GPU:
PrimusVK: 0x558231586f20.
PrimusVK: 0x558231586f80.
PrimusVK: Got discrete gpu!
PrimusVK: Device: GeForce GT 740M
PrimusVK: Type: 2
INFO: Failed to find vkGetDeviceProcAddr in layer libVkLayer_MESA_device_select.so
INFO: Inserted device layer VK_LAYER_PRIMUS_PrimusVK (libprimus_vk.so.1)
INFO: Failed to find vkGetDeviceProcAddr in layer libVkLayer_MESA_device_select.so
PrimusVK: fetching dispatch for 0x5582316a9e50
PrimusVK: Creating display device finished!: 0
PrimusVK: fetching dispatch for 0x5582316a8bb0
PrimusVK: CreateDevice done
Installing breakpad exception handler for appid(steam)/version(1599174997)
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/primus_vk.json, version "1.0.0"
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_x86_64.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Loader is running with elevated permissions. Environment variable VK_ICD_FILENAMES will be ignored.
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/nv_vulkan_wrapper.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.i686.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Loader is running with elevated permissions. Environment variable VK_ICD_FILENAMES will be ignored.
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/nv_vulkan_wrapper.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.i686.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/primus_vk.json, version "1.0.0"
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_x86_64.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/primus_vk.json, version "1.0.0"
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_x86_64.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Loader is running with elevated permissions. Environment variable VK_ICD_FILENAMES will be ignored.
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/nv_vulkan_wrapper.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.i686.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/primus_vk.json, version "1.0.0"
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_x86_64.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/primus_vk.json, version "1.0.0"
INFO: Found manifest file /usr/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_i386.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamfossilize_x86_64.json, version "1.0.0"
INFO: Found manifest file /home/zimudec/.local/share/vulkan/implicit_layer.d/steamoverlay_x86_64.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Loader is running with elevated permissions. Environment variable VK_LAYER_PATH will be ignored.
INFO: Found manifest file /usr/share/vulkan/explicit_layer.d/VkLayer_MESA_overlay.json, version "1.0.0"
INFO: Loader is running with elevated permissions. Environment variable XDG_DATA_HOME will be ignored.
INFO: Loader is running with elevated permissions. Environment variable VK_ICD_FILENAMES will be ignored.
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/nv_vulkan_wrapper.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.i686.json, version "1.0.0"
INFO: Found ICD manifest file /usr/share/vulkan/icd.d/intel_icd.x86_64.json, version "1.0.0"
INFO: Insert instance layer VK_LAYER_MESA_device_select (libVkLayer_MESA_device_select.so)
INFO: Insert instance layer VK_LAYER_PRIMUS_PrimusVK (libprimus_vk.so.1)
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
PrimusVK: Searching for display GPU:
PrimusVK: 0x579193b0:
PrimusVK: Got integrated gpu!
PrimusVK: Device: Intel(R) HD Graphics 4000 (IVB GT2)
PrimusVK: Type: 1
PrimusVK: Searching for render GPU:
PrimusVK: 0x579193b0.
PrimusVK: 0x57b4bb00.
PrimusVK: Got discrete gpu!
PrimusVK: Device: GeForce GT 740M
PrimusVK: Type: 2
INFO: Failed to find vkGetDeviceProcAddr in layer libVkLayer_MESA_device_select.so
INFO: Inserted device layer VK_LAYER_PRIMUS_PrimusVK (libprimus_vk.so.1)
INFO: Failed to find vkGetDeviceProcAddr in layer libVkLayer_MESA_device_select.so
PrimusVK: fetching dispatch for 0x57b4dc60
PrimusVK: Creating display device finished!: 0
PrimusVK: fetching dispatch for 0x578e1e10
PrimusVK: CreateDevice done
Installing breakpad exception handler for appid(steam)/version(1599174997)
roaming config store loaded successfully - 14868 bytes.
migrating temporary roaming config store
BRefreshApplicationsInLibrary 1: 25ms
[1001/205248.043860:INFO:crash_reporting.cc(270)] Crash reporting enabled for process: renderer
[1001/205248.149118:INFO:crash_reporting.cc(270)] Crash reporting enabled for process: renderer
[1001/205248.266152:INFO:crash_reporting.cc(270)] Crash reporting enabled for process: renderer
Installing breakpad exception handler for appid(steam)/version(1599174997)
Failed to init SteamVR because it isn't installed
ExecCommandLine: "'/home/zimudec/.local/share/Steam/ubuntu12_32/steam'"
Installing breakpad exception handler for appid(steam)/version(1599174997)
System startup time: 13.45 seconds
[1001/205250.535708:INFO:crash_reporting.cc(270)] Crash reporting enabled for process: renderer
Warning: failed to set thread priority: set failed for 4: -1: setpriority() failed
Warning: failed to set thread priority: set failed for priority 4
Warning: support for elevated priorities is most likely unavailable, suppressing future warnings
[1001/205250.556680:INFO:crash_reporting.cc(270)] Crash reporting enabled for process: renderer
Warning: failed to set thread priority: set failed for 4: -1: setpriority() failed
Warning: failed to set thread priority: set failed for priority 4
Warning: support for elevated priorities is most likely unavailable, suppressing future warnings
BuildCompleteAppOverviewChange: 332
RegisterForAppOverview 1: 30ms
RegisterForAppOverview 2: 31ms
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)

@felixdoerre
Copy link
Owner

When you run pvkrun steam now it can not show the same output. At least the lines with nvidia_icd.json have to vanish. (I currently don't run pvkrun steam, but modify the individual game commands to run pvkrun %command%. That way the dedicated graphics card is not triggered when only steam is running, but only for the individual games). Could you show the exact output of running pvkrun steam when it does not work?

@felixdoerre
Copy link
Owner

you can also try to run ENABLE_PRIMUS_LAYER=1 optirun -b none steam (and post the output when it fails)? That way the wrapper explicitly powers on the dedicated graphics card and it is not only powered on when an access to the graphics API is detected (maybe such a detection is broken). This would fit to the symptoms of a successful launch when another application is using bumblebee in parallel.

@zimudec
Copy link
Author

zimudec commented Oct 3, 2020

When you run pvkrun steam now it can not show the same output. At least the lines with nvidia_icd.json have to vanish. (I currently don't run pvkrun steam, but modify the individual game commands to run pvkrun %command%. That way the dedicated graphics card is not triggered when only steam is running, but only for the individual games). Could you show the exact output of running pvkrun steam when it does not work?

[zimudec@zimudec ~]$ pvkrun steam
Manjaro steam native configuration found!
Running Steam on manjarolinux 20.1 64-bit
STEAM_RUNTIME is disabled by the user
Can't find 'steam-runtime-check-requirements', continuing anyway
/home/zimudec/.local/share/Steam/ubuntu12_32/steam
WARNING: setlocale('en_US.UTF-8') failed, using locale: 'C'. International characters may not work.
[2020-10-02 20:52:01] Startup - updater built Sep 3 2020 21:18:09
Installing breakpad exception handler for appid(steam)/version(1599174997)
[2020-10-02 20:52:02] Loading cached metrics from disk (/home/zimudec/.local/share/Steam/package/steam_client_metrics.bin)
Installing breakpad exception handler for appid(steam)/version(1599174997)
[2020-10-02 20:52:02] Verificando instalación...
[2020-10-02 20:52:02] Verification complete
Loaded SDL version 2.0.13-5919606

(steam:3150): Gtk-WARNING **: 20:52:02.951: Unable to locate theme engine in module_path: "murrine",

(steam:3150): Gtk-WARNING **: 20:52:02.954: Unable to locate theme engine in module_path: "murrine",

(steam:3150): Gtk-WARNING **: 20:52:02.954: Unable to locate theme engine in module_path: "murrine",

(steam:3150): Gtk-WARNING **: 20:52:02.954: Unable to locate theme engine in module_path: "murrine",

(steam:3150): Gtk-WARNING **: 20:52:02.966: Unable to locate theme engine in module_path: "adwaita",

(steam:3150): Gtk-WARNING **: 20:52:02.967: Unable to locate theme engine in module_path: "adwaita",

(steam:3150): Gtk-WARNING **: 20:52:02.972: Unable to locate theme engine in module_path: "murrine",

(steam:3150): Gtk-WARNING **: 20:52:02.972: Unable to locate theme engine in module_path: "murrine",
Installing breakpad exception handler for appid(steam)/version(1599174997)
STEAM_RUNTIME_HEAVY: 0
[1002/205203.507188:INFO:crash_reporting.cc(247)] Crash reporting enabled for process: browser
[1002/205203.543996:WARNING:crash_reporting.cc(286)] Failed to set crash key: UserID with value: 0
[1002/205203.544093:WARNING:crash_reporting.cc(286)] Failed to set crash key: BuildID with value: 1599167902
[1002/205203.544114:WARNING:crash_reporting.cc(286)] Failed to set crash key: SteamUniverse with value: Public
[1002/205203.544134:WARNING:crash_reporting.cc(286)] Failed to set crash key: Vendor with value: Valve
[1002/205203.590648:WARNING:crash_reporting.cc(286)] Failed to set crash key: UserID with value: 0
[1002/205203.590720:WARNING:crash_reporting.cc(286)] Failed to set crash key: BuildID with value: 1599167902
[1002/205203.590733:WARNING:crash_reporting.cc(286)] Failed to set crash key: SteamUniverse with value: Public
[1002/205203.590743:WARNING:crash_reporting.cc(286)] Failed to set crash key: Vendor with value: Valve
[1002/205203.591668:INFO:crash_reporting.cc(247)] Crash reporting enabled for process: gpu-process
[1002/205203.620580:ERROR:sandbox_linux.cc(372)] InitializeSandbox() called with multiple threads in process gpu-process.
[1002/205203.663657:WARNING:crash_reporting.cc(286)] Failed to set crash key: UserID with value: 0
[1002/205203.663738:WARNING:crash_reporting.cc(286)] Failed to set crash key: BuildID with value: 1599167902
[1002/205203.663751:WARNING:crash_reporting.cc(286)] Failed to set crash key: SteamUniverse with value: Public
[1002/205203.663760:WARNING:crash_reporting.cc(286)] Failed to set crash key: Vendor with value: Valve
[1002/205203.664461:INFO:crash_reporting.cc(247)] Crash reporting enabled for process: utility
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Warning: failed to set thread priority: set failed for 8: -1: setpriority() failed
Warning: failed to set thread priority: set failed for priority 8
Warning: support for elevated priorities is most likely unavailable, suppressing future warnings
Warning: failed to set thread priority: set failed for 8: -1: setpriority() failed
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
CAppInfoCacheReadFromDiskThread took 134 milliseconds to initialize
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
CApplicationManagerPopulateThread took 6528 milliseconds to initialize (will have waited on CAppInfoCacheReadFromDiskThread)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Proceed to auto login
Opted-in Controller Mask for AppId 0: 0

(steam:3150): Gtk-WARNING **: 20:52:11.039: gtk_disable_setlocale() must be called before gtk_init()
Xlib: extension "NV-GLX" missing on display ":0.0".
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
PrimusVK: Searching for display GPU:
PrimusVK: 0x560cc4b75f90:
PrimusVK: Got integrated gpu!
PrimusVK: Device: Intel(R) HD Graphics 4000 (IVB GT2)
PrimusVK: Type: 1
PrimusVK: Searching for render GPU:
PrimusVK: 0x560cc4b75f90.
PrimusVK: No device for the rendering GPU found. Is the correct driver installed?
PrimusVK: VK_ICD_FILENAMES not set
vkCreateInstance failed with error -3
BInit - Unable to initialize Vulkan!
Installing breakpad exception handler for appid(steam)/version(1599174997)
local (potentially out of sync) copy of roaming config loaded - 14868 bytes.
Xlib: extension "NV-GLX" missing on display ":0.0".
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
PrimusVK: Searching for display GPU:
PrimusVK: 0x5694ae80:
PrimusVK: Got integrated gpu!
PrimusVK: Device: Intel(R) HD Graphics 4000 (IVB GT2)
PrimusVK: Type: 1
PrimusVK: Searching for render GPU:
PrimusVK: 0x5694ae80.
PrimusVK: No device for the rendering GPU found. Is the correct driver installed?
PrimusVK: VK_ICD_FILENAMES not set
vkCreateInstance failed with error -3
BInit - Unable to initialize Vulkan!
roaming config store loaded successfully - 14868 bytes.
migrating temporary roaming config store
BRefreshApplicationsInLibrary 1: 32ms
[1002/205214.020722:INFO:crash_reporting.cc(270)] Crash reporting enabled for process: renderer
[1002/205214.118370:INFO:crash_reporting.cc(270)] Crash reporting enabled for process: renderer
[1002/205214.238605:INFO:crash_reporting.cc(270)] Crash reporting enabled for process: renderer
Installing breakpad exception handler for appid(steam)/version(1599174997)
Failed to init SteamVR because it isn't installed
ExecCommandLine: "'/home/zimudec/.local/share/Steam/ubuntu12_32/steam'"
System startup time: 12.15 seconds
Warning: failed to set thread priority: set failed for 4: -1: setpriority() failed
Warning: failed to set thread priority: set failed for priority 4
Warning: support for elevated priorities is most likely unavailable, suppressing future warnings
[1002/205214.837514:INFO:crash_reporting.cc(270)] Crash reporting enabled for process: renderer
[1002/205214.862030:INFO:crash_reporting.cc(270)] Crash reporting enabled for process: renderer
Warning: failed to set thread priority: set failed for 4: -1: setpriority() failed
Warning: failed to set thread priority: set failed for priority 4
Warning: support for elevated priorities is most likely unavailable, suppressing future warnings
BuildCompleteAppOverviewChange: 332
RegisterForAppOverview 1: 22ms
RegisterForAppOverview 2: 22ms
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)

When I run only steam (to run with the integrated gpu), and then in the game properties I enter pvkrun %command%, there if it runs with the dedicated gpu!

I checked with darkest dungeon and sleeping dogs definitive edition with proton GE-5.5-1 (both run without issue over the older version of steam-manjaro with pvkrun steam).

Will I have to do the same for each game? will there be a more elegant solution? why does this affect only steam? (well it might affect another app as well and I haven't checked yet)

@zimudec
Copy link
Author

zimudec commented Oct 3, 2020

you can also try to run ENABLE_PRIMUS_LAYER=1 optirun -b none steam (and post the output when it fails)? That way the wrapper explicitly powers on the dedicated graphics card and it is not only powered on when an access to the graphics API is detected (maybe such a detection is broken). This would fit to the symptoms of a successful launch when another application is using bumblebee in parallel.

[zimudec@zimudec ~]$ ENABLE_PRIMUS_LAYER=1 optirun -b none steam
Manjaro steam native configuration found!
Running Steam on manjarolinux 20.1 64-bit
STEAM_RUNTIME is disabled by the user
Can't find 'steam-runtime-check-requirements', continuing anyway
/home/zimudec/.local/share/Steam/ubuntu12_32/steam
WARNING: setlocale('en_US.UTF-8') failed, using locale: 'C'. International characters may not work.
[2020-10-02 21:12:18] Startup - updater built Sep 3 2020 21:18:09
Installing breakpad exception handler for appid(steam)/version(1599174997)
[2020-10-02 21:12:18] Loading cached metrics from disk (/home/zimudec/.local/share/Steam/package/steam_client_metrics.bin)
Installing breakpad exception handler for appid(steam)/version(1599174997)
[2020-10-02 21:12:18] Verificando instalación...
[2020-10-02 21:12:18] Verification complete
Loaded SDL version 2.0.13-5919606

(steam:7098): Gtk-WARNING **: 21:12:19.580: Unable to locate theme engine in module_path: "murrine",

(steam:7098): Gtk-WARNING **: 21:12:19.605: Unable to locate theme engine in module_path: "murrine",

(steam:7098): Gtk-WARNING **: 21:12:19.605: Unable to locate theme engine in module_path: "murrine",

(steam:7098): Gtk-WARNING **: 21:12:19.605: Unable to locate theme engine in module_path: "murrine",

(steam:7098): Gtk-WARNING **: 21:12:19.620: Unable to locate theme engine in module_path: "adwaita",

(steam:7098): Gtk-WARNING **: 21:12:19.621: Unable to locate theme engine in module_path: "adwaita",

(steam:7098): Gtk-WARNING **: 21:12:19.624: Unable to locate theme engine in module_path: "murrine",

(steam:7098): Gtk-WARNING **: 21:12:19.624: Unable to locate theme engine in module_path: "murrine",
Installing breakpad exception handler for appid(steam)/version(1599174997)
STEAM_RUNTIME_HEAVY: 0
[1002/211220.258108:INFO:crash_reporting.cc(247)] Crash reporting enabled for process: browser
[1002/211220.294450:WARNING:crash_reporting.cc(286)] Failed to set crash key: UserID with value: 0
[1002/211220.294534:WARNING:crash_reporting.cc(286)] Failed to set crash key: BuildID with value: 1599167902
[1002/211220.294546:WARNING:crash_reporting.cc(286)] Failed to set crash key: SteamUniverse with value: Public
[1002/211220.294555:WARNING:crash_reporting.cc(286)] Failed to set crash key: Vendor with value: Valve
[1002/211220.353024:WARNING:crash_reporting.cc(286)] Failed to set crash key: UserID with value: 0
[1002/211220.353101:WARNING:crash_reporting.cc(286)] Failed to set crash key: BuildID with value: 1599167902
[1002/211220.353114:WARNING:crash_reporting.cc(286)] Failed to set crash key: SteamUniverse with value: Public
[1002/211220.353123:WARNING:crash_reporting.cc(286)] Failed to set crash key: Vendor with value: Valve
[1002/211220.353804:INFO:crash_reporting.cc(247)] Crash reporting enabled for process: gpu-process
[1002/211220.385991:ERROR:sandbox_linux.cc(372)] InitializeSandbox() called with multiple threads in process gpu-process.
[1002/211220.454545:WARNING:crash_reporting.cc(286)] Failed to set crash key: UserID with value: 0
[1002/211220.454626:WARNING:crash_reporting.cc(286)] Failed to set crash key: BuildID with value: 1599167902
[1002/211220.454638:WARNING:crash_reporting.cc(286)] Failed to set crash key: SteamUniverse with value: Public
[1002/211220.454649:WARNING:crash_reporting.cc(286)] Failed to set crash key: Vendor with value: Valve
[1002/211220.455381:INFO:crash_reporting.cc(247)] Crash reporting enabled for process: utility
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
CAppInfoCacheReadFromDiskThread took 137 milliseconds to initialize
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Warning: failed to set thread priority: set failed for 8: -1: setpriority() failed
Warning: failed to set thread priority: set failed for priority 8
Warning: support for elevated priorities is most likely unavailable, suppressing future warnings
Warning: failed to set thread priority: set failed for 8: -1: setpriority() failed
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
CApplicationManagerPopulateThread took 6725 milliseconds to initialize (will have waited on CAppInfoCacheReadFromDiskThread)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Proceed to auto login
Opted-in Controller Mask for AppId 0: 0

(steam:7098): Gtk-WARNING **: 21:12:28.288: gtk_disable_setlocale() must be called before gtk_init()
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
PrimusVK: Searching for display GPU:
PrimusVK: 0x5625330e0d50:
PrimusVK: Got integrated gpu!
PrimusVK: Device: Intel(R) HD Graphics 4000 (IVB GT2)
PrimusVK: Type: 1
PrimusVK: Searching for render GPU:
PrimusVK: 0x5625330e0d50.
PrimusVK: 0x5625330e5930.
PrimusVK: Got discrete gpu!
PrimusVK: Device: GeForce GT 740M
PrimusVK: Type: 2
PrimusVK: fetching dispatch for 0x562533208d20
PrimusVK: Creating display device finished!: 0
PrimusVK: fetching dispatch for 0x562533207a80
PrimusVK: CreateDevice done
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
local (potentially out of sync) copy of roaming config loaded - 14868 bytes.
roaming config store loaded successfully - 14868 bytes.
migrating temporary roaming config store
BRefreshApplicationsInLibrary 1: 21ms
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
PrimusVK: Searching for display GPU:
PrimusVK: 0x57119bc0:
PrimusVK: Got integrated gpu!
PrimusVK: Device: Intel(R) HD Graphics 4000 (IVB GT2)
PrimusVK: Type: 1
PrimusVK: Searching for render GPU:
PrimusVK: 0x57119bc0.
PrimusVK: 0x57325b30.
PrimusVK: Got discrete gpu!
PrimusVK: Device: GeForce GT 740M
PrimusVK: Type: 2
PrimusVK: fetching dispatch for 0x57327c90
PrimusVK: Creating display device finished!: 0
PrimusVK: fetching dispatch for 0x570bbe10
PrimusVK: CreateDevice done
[1002/211231.552044:INFO:crash_reporting.cc(270)] Crash reporting enabled for process: renderer
[1002/211231.687466:INFO:crash_reporting.cc(270)] Crash reporting enabled for process: renderer
[1002/211231.867036:INFO:crash_reporting.cc(270)] Crash reporting enabled for process: renderer
Installing breakpad exception handler for appid(steam)/version(1599174997)
Failed to init SteamVR because it isn't installed
ExecCommandLine: "'/home/zimudec/.local/share/Steam/ubuntu12_32/steam'"
System startup time: 13.78 seconds
Warning: failed to set thread priority: set failed for 4: -1: setpriority() failed
Warning: failed to set thread priority: set failed for priority 4
Warning: support for elevated priorities is most likely unavailable, suppressing future warnings
[1002/211233.129473:INFO:crash_reporting.cc(270)] Crash reporting enabled for process: renderer
[1002/211233.136881:INFO:crash_reporting.cc(270)] Crash reporting enabled for process: renderer
Warning: failed to set thread priority: set failed for 4: -1: setpriority() failed
Warning: failed to set thread priority: set failed for priority 4
Warning: support for elevated priorities is most likely unavailable, suppressing future warnings
BuildCompleteAppOverviewChange: 332
RegisterForAppOverview 1: 37ms
RegisterForAppOverview 2: 37ms
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)
Installing breakpad exception handler for appid(steam)/version(1599174997)

With that steam command it starts perfectly with the dedicated gpu! unlike with pvkrun steam (result shown above).

I tested sleeping dogs which requires vulkan to work, and it seems to run without any problems, without any launch parameters in properties.

With ENABLE_PRIMUS_LAYER=1 optirun -b primus steam same result.

@felixdoerre
Copy link
Owner

Yes, probably we need to get more debug output from prvkrun steam to see what's going on (maybe with LD_DEBUG=libs), and who messes around with the configuration that makes primus start the GPU. I've just upgraded to steam 1.0.0.66 (from debian experimental), and see a similar error message (indicating that vulkan didn't start), but steam seems to start successfully nevertheless (I probably wrongly assumed from your issue description that this error causes steam not to start). But steam seems to mess with the environment variables preventing the game from starting with primus-vk. I will try to understand this better later today.

Regarding adding pvkrun %command% to every game: That's what I am currently doing. As many games still require a few additional tweaks to their proton settings, I adjust the run command for most games in any case. (And the comfort of keeping steam running with the graphics card powered off and only activating it per-game is worth it for me :D ). I believe in lutris you can set this globally, to run games with pvkrun.

@felixdoerre
Copy link
Owner

Yes, this version of steam messes around with the LD_LIBRARY_PATH which breaks the activation of (OpenGL)-primus, which primus-vk relies on for powering on the gpu (this explains the "when I run another application with primus-vk in parallel, it works"). However this would mean that in that case only primus-vk works, but (OpenGL)-primus does not.

Here are my observations: When changing a game's run command to env > /tmp/steam-environ # %command%, I can observe that in the target environment ENABLE_PRIMUS_LAYER=1 is still set, but LD_LIBRARY_PATH is set to:

LD_LIBRARY_PATH=/home/user/.local/share/Steam/ubuntu12_32/steam-runtime/pinned_libs_32:/home/user/.local/share/Steam/ubuntu12_32/steam-runtime/pinned_libs_64:/usr/lib/x86_64-linux-gnu/libfakeroot:/lib/i386-linux-gnu:/usr/lib/i386-linux-gnu:/usr/local/lib:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib32:/usr/lib32:/libx32:/usr/libx32:/lib:/usr/lib:/usr/lib/i386-linux-gnu/i686:/usr/lib/i386-linux-gnu/sse2:/usr/lib/i386-linux-gnu/i686/sse2:/home/user/.local/share/Steam/ubuntu12_32/steam-runtime/lib/i386-linux-gnu:/home/user/.local/share/Steam/ubuntu12_32/steam-runtime/usr/lib/i386-linux-gnu:/home/user/.local/share/Steam/ubuntu12_32/steam-runtime/lib/x86_64-linux-gnu:/home/user/.local/share/Steam/ubuntu12_32/steam-runtime/usr/lib/x86_64-linux-gnu:/home/user/.local/share/Steam/ubuntu12_32/steam-runtime/lib:/home/user/.local/share/Steam/ubuntu12_32/steam-runtime/usr/lib:/usr/lib/x86_64-linux-gnu/primus:/usr/lib/i386-linux-gnu/primus

Running and vulkan application with that environment fails, as we don't use the libGL provided by primus (last path entries), but the libGL provided by the "normal" system library path, which the steam runtime explicitly adds in the middle of all this mess (and before the primus path entries). So this is pretty clearly a bug in the steam runtime, that is does not respect existing LD_LIBRARY_PATHs correctly. I will open a bug against the steam runtime.

@felixdoerre
Copy link
Owner

This is the issue, I opened against the steam-runtime: ValveSoftware/steam-runtime#274

@zimudec
Copy link
Author

zimudec commented Oct 3, 2020

I also opened this issue about a problem with libglvnd 1.3 and steam. It may be related to the LD_LIBRARY_PATH problem. This causes me other problems running certain games mentioned.

https://gitlab.freedesktop.org/glvnd/libglvnd/-/issues/211

This issue of pvkrun, primus and steam, I have always tested them with libglvnd 1.1, so as not to mix the 2 problems.

@zimudec
Copy link
Author

zimudec commented Oct 3, 2020

I add to the above:

Some time ago, rise of tomb raider native to linux worked fine, but recent tests (independent of the version of steam and libglvnd), it fails showing the following error:

Captura de pantalla de 2020-10-03 16-02-58

I sent the dump file delivered by tomb raider to Feral, and they tell me that the cause of the error seems to be related to the vulkan libraries of the operating system. They gave me possible solutions, but without success. They can't give me any more help because they don't support manjaro.

This may have some indirect bearing on this whole primus, steam and vulkan thing.

@felixdoerre
Copy link
Owner

... I also have both the tomb raiders (rise and shadow) and they both work flawlessly on my system. However I always add "pvkrun" to the individual games and not to steam as a whole. The crash message itself will not be really useful, you will probably have to start the game in a debugger to get a stack trace. "the errors seems to be related to the vulkan libraries" can mean anything (from "driver not found" to "segfault inside a vulkan driver"). Do you have standard output from that game starting?

@zimudec
Copy link
Author

zimudec commented Oct 3, 2020

... I also have both the tomb raiders (rise and shadow) and they both work flawlessly on my system. However I always add "pvkrun" to the individual games and not to steam as a whole. The crash message itself will not be really useful, you will probably have to start the game in a debugger to get a stack trace. "the errors seems to be related to the vulkan libraries" can mean anything (from "driver not found" to "segfault inside a vulkan driver"). Do you have standard output from that game starting?

Using that methodology, running steam, when running the game with pvkrun %command% in game properties, the terminal displays the following, and then displays the error mentioned above.

Opted-in Controller Mask for AppId 391220: 0
GameAction [AppID 391220, ActionID 1] : LaunchApp changed task to ProcessingInstallScript with ""
GameAction [AppID 391220, ActionID 1] : LaunchApp changed task to SynchronizingCloud with ""
GameAction [AppID 391220, ActionID 1] : LaunchApp changed task to ProcessingShaderCache with ""
Installing breakpad exception handler for appid(steam)/version(1599174997)
GameAction [AppID 391220, ActionID 1] : LaunchApp changed task to SiteLicenseSeatCheckout with ""
GameAction [AppID 391220, ActionID 1] : LaunchApp changed task to CreatingProcess with ""
GameAction [AppID 391220, ActionID 1] : LaunchApp waiting for user response to CreatingProcess ""
GameAction [AppID 391220, ActionID 1] : LaunchApp continues with user response "CreatingProcess"
Game update: AppID 391220 "", ProcID 12657, IP 0.0.0.0:0
ERROR: ld.so: object '/home/zimudec/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/zimudec/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/zimudec/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/zimudec/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
Starting app 391220
>>> Adding process 12657 for game ID 391220
GameAction [AppID 391220, ActionID 1] : LaunchApp changed task to WaitingGameWindow with ""
>>> Adding process 12658 for game ID 391220
GameAction [AppID 391220, ActionID 1] : LaunchApp changed task to Completed with ""
ERROR: ld.so: object '/home/zimudec/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
WARNING: Rise of the Tomb Raider launched with STEAM_RUNTIME=0
         We recommend using the steam runtime if possible
>>> Adding process 12675 for game ID 391220
ERROR: ld.so: object '/home/zimudec/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
>>> Adding process 12682 for game ID 391220
pid 12686 != 12682, skipping destruction (fork without exec?)
pid 12685 != 12682, skipping destruction (fork without exec?)
ERROR: ld.so: object '/home/zimudec/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/zimudec/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
>>> Adding process 12688 for game ID 391220
ERROR: ld.so: object '/home/zimudec/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/zimudec/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/zimudec/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
>>> Adding process 12689 for game ID 391220
>>> Adding process 12692 for game ID 391220
>>> Adding process 12694 for game ID 391220
>>> Adding process 12693 for game ID 391220
pid 12690 != 12658, skipping destruction (fork without exec?)
ERROR: ld.so: object '/home/zimudec/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
pid 12698 != 12658, skipping destruction (fork without exec?)
ERROR: ld.so: object '/home/zimudec/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
>>> Adding process 12697 for game ID 391220
ERROR: ld.so: object '/home/zimudec/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
>>> Adding process 12699 for game ID 391220
>>> Adding process 12700 for game ID 391220
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
PrimusVK: Searching for display GPU:
PrimusVK: 0x83adf0: 
PrimusVK: Got integrated gpu!
PrimusVK: Device: Intel(R) HD Graphics 4000 (IVB GT2)
PrimusVK:   Type: 1
PrimusVK: Searching for render GPU:
PrimusVK: 0x83adf0.
PrimusVK: 0x82cfa0.
PrimusVK: Got discrete gpu!
PrimusVK: Device: GeForce GT 740M
PrimusVK:   Type: 2
ERROR: ld.so: object '/home/zimudec/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/zimudec/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
>>> Adding process 12705 for game ID 391220
RiseOfTheTombRaider: crash reporter initialised with path "/home/zimudec/.local/share/feral-interactive/Rise of the Tomb Raider/crashes"
>>> Adding process 12706 for game ID 391220
SDL2 initialised [built against 2.0.7, running with 2.0.7]
Game update: AppID 391220 "", ProcID 12706, IP 0.0.0.0:0
RecordSteamInterfaceCreation (PID 12706): SteamUtils008 / Utils
Setting breakpad minidump AppID = 391220
RecordSteamInterfaceCreation (PID 12706): SteamUser019 / User
Steam_SetMinidumpSteamID:  Caching Steam ID:  76561198008468660 [API loaded no]
RecordSteamInterfaceCreation (PID 12706): SteamUser019 / User
RecordSteamInterfaceCreation (PID 12706): SteamFriends015 / Friends
RecordSteamInterfaceCreation (PID 12706): SteamUtils008 / Utils
RecordSteamInterfaceCreation (PID 12706): SteamMatchMaking009 / Matchmaking
RecordSteamInterfaceCreation (PID 12706): SteamMatchMakingServers002 / MatchmakingServers
RecordSteamInterfaceCreation (PID 12706): STEAMUSERSTATS_INTERFACE_VERSION011 / UserStats
RecordSteamInterfaceCreation (PID 12706): STEAMAPPS_INTERFACE_VERSION008 / Apps
RecordSteamInterfaceCreation (PID 12706): SteamNetworking005 / Networking
RecordSteamInterfaceCreation (PID 12706): STEAMREMOTESTORAGE_INTERFACE_VERSION013 / RemoteStorage
RecordSteamInterfaceCreation (PID 12706): STEAMSCREENSHOTS_INTERFACE_VERSION002 / Screenshots
RecordSteamInterfaceCreation (PID 12706): STEAMHTTP_INTERFACE_VERSION002 / HTTP
RecordSteamInterfaceCreation (PID 12706): STEAMUNIFIEDMESSAGES_INTERFACE_VERSION001 / UnifiedMessages
RecordSteamInterfaceCreation (PID 12706): SteamController003 / Controller
RecordSteamInterfaceCreation (PID 12706): STEAMUGC_INTERFACE_VERSION008 / UGC
RecordSteamInterfaceCreation (PID 12706): STEAMAPPLIST_INTERFACE_VERSION001 / AppList
RecordSteamInterfaceCreation (PID 12706): STEAMMUSIC_INTERFACE_VERSION001 / Music
RecordSteamInterfaceCreation (PID 12706): STEAMMUSICREMOTE_INTERFACE_VERSION001 / MusicRemote
RecordSteamInterfaceCreation (PID 12706): STEAMHTMLSURFACE_INTERFACE_VERSION_003 / HTMLSurface
RecordSteamInterfaceCreation (PID 12706): STEAMINVENTORY_INTERFACE_V001 / Inventory
RecordSteamInterfaceCreation (PID 12706): STEAMVIDEO_INTERFACE_V001 / Video
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
RiseOfTheTombRaider: dumped to "/home/zimudec/.local/share/feral-interactive/Rise of the Tomb Raider/crashes/01ee0f89-0698-1242-5ef09acd-22819308.dmp"
RiseOfTheTombRaider: crash reporter "/home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/feral_linux_crash_reporter" launching
Game crashed with signal 11
Game crashed with signal SIGSEGV(11): Segmentation fault.

You may be able to relaunch the game to send the crash log automatically.
You can also contact [email protected] directly with details of the crash, Steam System Info, and the dump file:
/home/zimudec/.local/share/feral-interactive/Rise of the Tomb Raider/crashes/01ee0f89-0698-1242-5ef09acd-22819308.dmp
primus: warning: dropping a frame to avoid deadlock
primus: warning: timeout waiting for display worker
Game removed: AppID 391220 "", ProcID 12706 
Game 391220 created interface STEAMAPPLIST_INTERFACE_VERSION001 / AppList
Game 391220 created interface STEAMAPPS_INTERFACE_VERSION008 / Apps
Game 391220 created interface STEAMHTMLSURFACE_INTERFACE_VERSION_003 / HTMLSurface
Game 391220 created interface STEAMHTTP_INTERFACE_VERSION002 / HTTP
Game 391220 created interface STEAMINVENTORY_INTERFACE_V001 / Inventory
Game 391220 created interface STEAMMUSICREMOTE_INTERFACE_VERSION001 / MusicRemote
Game 391220 created interface STEAMMUSIC_INTERFACE_VERSION001 / Music
Game 391220 created interface STEAMREMOTESTORAGE_INTERFACE_VERSION013 / RemoteStorage
Game 391220 created interface STEAMSCREENSHOTS_INTERFACE_VERSION002 / Screenshots
Game 391220 created interface STEAMUGC_INTERFACE_VERSION008 / UGC
Game 391220 created interface STEAMUNIFIEDMESSAGES_INTERFACE_VERSION001 / UnifiedMessages
Game 391220 created interface STEAMUSERSTATS_INTERFACE_VERSION011 / UserStats
Game 391220 created interface STEAMVIDEO_INTERFACE_V001 / Video
Game 391220 created interface SteamController003 / Controller
Game 391220 created interface SteamFriends015 / Friends
Game 391220 created interface SteamMatchMaking009 / Matchmaking
Game 391220 created interface SteamMatchMakingServers002 / MatchmakingServers
Game 391220 created interface SteamNetworking005 / Networking
Game 391220 created interface SteamUser019 / User
Game 391220 created interface SteamUtils008 / Utils
Game 391220 method call count for IClientUser::GetUserDataFolder : 1
Game 391220 method call count for IClientUser::GetSteamID : 1
Game 391220 method call count for IClientUtils::SetAPIDebuggingActive : 1
Game 391220 method call count for IClientUtils::GetAppID : 23
Game 391220 method call count for IClientUtils::RecordSteamInterfaceCreation : 22
Game 391220 method call count for IClientAppManager::GetCurrentLanguage : 1
Uploaded AppInterfaceStats to Steam
Exiting app 391220
No cached sticky mapping in ActivateActionSet.

How can I debug the .dmp file and deliver a readable result of what is inside?

@felixdoerre
Copy link
Owner

Ok, so this looks like, we don't even reach primus_vk from the game. I don't know how one would open .dmp files. That's a fileformat called minidump, which you would first need to convert into a regular coredump and then maybe inspect with gdb.

Luckily enough, Rise of the Tomb Raider is pretty easy to start manually, and the startscript has an option for inserting gdb right before the game launches:

.../steamapps/common/Rise of the Tomb Raider$ STEAM_RUNTIME=1 GAME_LAUNCH_PREFIX="gdb --args" pvkrun ./RiseOfTheTombRaider.sh

When the segfault hits, gdb will prevent the program from crashing and allow you to get a backtrace with the bt command. Additionally you can inspect the state during which the game crashed further, but I don't have any specific instructions on what to look for without seeing the backtrace.

@felixdoerre
Copy link
Owner

felixdoerre commented Oct 3, 2020

I believe I got an idea what could be wrong in your case. I have found the sources for manjaro's bumblebee here: https://gitlab.manjaro.org/packages/community/bumblebee, but I can't find the sources for the (OpenGL)-primus package. Can you show me where the source code for the manjaro package for (OpenGL)-primus is, so I can validate my theory?

@zimudec
Copy link
Author

zimudec commented Oct 5, 2020

Ok, so this looks like, we don't even reach primus_vk from the game. I don't know how one would open .dmp files. That's a fileformat called minidump, which you would first need to convert into a regular coredump and then maybe inspect with gdb.

Luckily enough, Rise of the Tomb Raider is pretty easy to start manually, and the startscript has an option for inserting gdb right before the game launches:

.../steamapps/common/Rise of the Tomb Raider$ STEAM_RUNTIME=1 GAME_LAUNCH_PREFIX="gdb --args" pvkrun ./RiseOfTheTombRaider.sh

When the segfault hits, gdb will prevent the program from crashing and allow you to get a backtrace with the bt command. Additionally you can inspect the state during which the game crashed further, but I don't have any specific instructions on what to look for without seeing the backtrace.

i ran the command and then typed bt, but nothing happens. Is that correct?

`[zimudec@zimudec Rise of the Tomb Raider]$ STEAM_RUNTIME=1 GAME_LAUNCH_PREFIX="gdb --args" pvkrun ./RiseOfTheTombRaider.sh
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
PrimusVK: Searching for display GPU:
PrimusVK: 0xba0e50:
PrimusVK: Got integrated gpu!
PrimusVK: Device: Intel(R) HD Graphics 4000 (IVB GT2)
PrimusVK: Type: 1
PrimusVK: Searching for render GPU:
PrimusVK: 0xba0e50.
PrimusVK: 0x9ee5d0.
PrimusVK: Got discrete gpu!
PrimusVK: Device: GeForce GT 740M
PrimusVK: Type: 2
GNU gdb (GDB) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./signalwrapper...
(No debugging symbols found in ./signalwrapper)
(gdb) bt
No stack.
(gdb)
`

@zimudec
Copy link
Author

zimudec commented Oct 5, 2020

I believe I got an idea what could be wrong in your case. I have found the sources for manjaro's bumblebee here: https://gitlab.manjaro.org/packages/community/bumblebee, but I can't find the sources for the (OpenGL)-primus package. Can you show me where the source code for the manjaro package for (OpenGL)-primus is, so I can validate my theory?

I do not understand, in what path can I find the source code? Is it any of these?

[zimudec@zimudec Rise of the Tomb Raider]$ locate primus
/usr/bin/primus_vk_diag
/usr/bin/primusrun
/usr/lib/libprimus_vk.so.1
/usr/lib/primus
/usr/lib/primus/libGL.so.1
/usr/lib32/libprimus_vk.so
/usr/lib32/libprimus_vk.so.1
/usr/lib32/primus
/usr/lib32/primus/libGL.so.1
/usr/share/bash-completion/completions/primusrun
/usr/share/licenses/lib32-primus
/usr/share/licenses/lib32-primus_vk
/usr/share/licenses/primus
/usr/share/licenses/primus_vk
/usr/share/licenses/lib32-primus/LICENSE
/usr/share/licenses/lib32-primus_vk/LICENSE
/usr/share/licenses/primus/LICENSE
/usr/share/licenses/primus_vk/LICENSE
/usr/share/man/man1/primusrun.1.gz
/usr/share/vulkan/implicit_layer.d/primus_vk.json

@felixdoerre
Copy link
Owner

When using gdb you first need to type run to launch the application, then wait for the segfault, and when it happens, the application will not crash but hang. Now switch back to gdb, which should show a prompt now, and type bt.

Regarding the sources of the primus package: No, these are files installed on your system by the primus package. What I wanted to know is where I can find information on how the primus package is built for your distribution (so, what source code variant goes in it? Are there special tweaks by the packager, ...). Does manjaro have all packages contained in archlinux or it it a totally separate package repository? E.g. for archlinux I can find the sources for the primus package here: https://github.com/archlinux/svntogit-community/tree/packages/primus/trunk these show me, that for archlinux there is a "register_cleanup"-hook inserted and additionally, a __GLVND_DISALLOW_PATCHING=1 is inserted into primusrun. I would like to know those "maintainer patches" for the manjaro package.

@zimudec
Copy link
Author

zimudec commented Oct 6, 2020

When using gdb you first need to type run to launch the application, then wait for the segfault, and when it happens, the application will not crash but hang. Now switch back to gdb, which should show a prompt now, and type bt.

I ran run using that command, but on the screen I got the error "Failed to load steamui.so". Apparently that error is triggered when using STEAM_RUNTIME = 1. However, if I wait a while, the game runs anyway, and shows the segfault error. So I press the button to make the error disappear, I go to the terminal, and it is not stopped. I type bt and it returns No Stack.

I tried the same procedure with STEAM_RUNTIME = 0, the game starts faster and does not give steamui.so error, but bt returns No Stack as well.

[zimudec@zimudec Rise of the Tomb Raider]$ STEAM_RUNTIME=1 GAME_LAUNCH_PREFIX="gdb --args" pvkrun ./RiseOfTheTombRaider.sh
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
PrimusVK: Searching for display GPU:
PrimusVK: 0x1c74530: 
PrimusVK: Got integrated gpu!
PrimusVK: Device: Intel(R) HD Graphics 4000 (IVB GT2)
PrimusVK:   Type: 1
PrimusVK: Searching for render GPU:
PrimusVK: 0x1c74530.
PrimusVK: 0x1ac1e10.
PrimusVK: Got discrete gpu!
PrimusVK: Device: GeForce GT 740M
PrimusVK:   Type: 2
GNU gdb (GDB) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./signalwrapper...
(No debugging symbols found in ./signalwrapper)
(gdb) run
Starting program: /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/signalwrapper /home/zimudec/.local/share/Steam/steamapps/common/Rise\ of\ the\ Tomb\ Raider/bin/RiseOfTheTombRaider
[Detaching after fork from child process 6180]
RiseOfTheTombRaider: crash reporter initialised with path "/home/zimudec/.local/share/feral-interactive/Rise of the Tomb Raider/crashes"
SDL2 initialised [built against 2.0.7, running with 2.0.7]
[S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed.
[S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
[Inferior 1 (process 6176) exited with code 013]
(gdb) RiseOfTheTombRaider: dumped to "/home/zimudec/.local/share/feral-interactive/Rise of the Tomb Raider/crashes/4372db18-83c7-6b87-471737d3-5971ed5f.dmp"
RiseOfTheTombRaider: crash reporter "/home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/feral_linux_crash_reporter" launching
Game crashed with signal 11
Game crashed with signal SIGSEGV(11): Segmentation fault.

You may be able to relaunch the game to send the crash log automatically.
You can also contact [email protected] directly with details of the crash, Steam System Info, and the dump file:
/home/zimudec/.local/share/feral-interactive/Rise of the Tomb Raider/crashes/4372db18-83c7-6b87-471737d3-5971ed5f.dmp
primus: warning: dropping a frame to avoid deadlock
primus: warning: timeout waiting for display worker
bt
No stack.
(gdb) bt
No stack.
(gdb) 

@zimudec
Copy link
Author

zimudec commented Oct 6, 2020

Regarding the sources of the primus package: No, these are files installed on your system by the primus package. What I wanted to know is where I can find information on how the primus package is built for your distribution (so, what source code variant goes in it? Are there special tweaks by the packager, ...). Does manjaro have all packages contained in archlinux or it it a totally separate package repository? E.g. for archlinux I can find the sources for the primus package here: https://github.com/archlinux/svntogit-community/tree/packages/primus/trunk these show me, that for archlinux there is a "register_cleanup"-hook inserted and additionally, a __GLVND_DISALLOW_PATCHING=1 is inserted into primusrun. I would like to know those "maintainer patches" for the manjaro package.

Maybe you mean this?

https://www.archlinux.org/packages/community/x86_64/primus/
https://github.com/amonakov/primus

@felixdoerre
Copy link
Owner

Thanks for the gdb output, ok I think we need to remove the signalwrapper and start gdb directly on the game. The relevant section of the launch script:

# Use the signalwrapper if it exists
if [ -e "signalwrapper" ]; then
        GAME_SIGNAL_WRAPPER="./signalwrapper"
fi

# Launch the game with all the arguments
${GAME_LAUNCH_PREFIX} ${GAME_SIGNAL_WRAPPER} "${GAMEROOT}/bin/${FERAL_GAME_NAME}" "$@"
RESULT=$?

So just moving the signalwrapper out of the way (e.g. by renaming it to signalwrapper.disabled), should remove it from the execution. So could you try moving the signal wrapper away, and then again the gdb command?

Regarding the 2 source links: The lower link is the "original" source repository. I already know that. I wanted to know, if there are manjaro-specific adjustments. The upper link shows me the archlinux package. That's where I got this svntogit-link from. Are you sure that this is also the source for manjaro? Does manjaro just take all packages from archlinux without modification, when there is not specific manjaro source?

@zimudec
Copy link
Author

zimudec commented Oct 8, 2020

I managed to run the procedure and got the trace. I don't know what the cause is:

[zimudec@zimudec Rise of the Tomb Raider]$ STEAM_RUNTIME=0 GAME_LAUNCH_PREFIX="gdb --args" pvkrun ./RiseOfTheTombRaider.sh
WARNING: Rise of the Tomb Raider launched with STEAM_RUNTIME=0
         We recommend using the steam runtime if possible
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
PrimusVK: Searching for display GPU:
PrimusVK: 0x1c78240: 
PrimusVK: Got integrated gpu!
PrimusVK: Device: Intel(R) HD Graphics 4000 (IVB GT2)
PrimusVK:   Type: 1
PrimusVK: Searching for render GPU:
PrimusVK: 0x1c78240.
PrimusVK: 0x1c5e340.
PrimusVK: Got discrete gpu!
PrimusVK: Device: GeForce GT 740M
PrimusVK:   Type: 2
GNU gdb (GDB) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider...
(No debugging symbols found in /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider)
(gdb) run
Starting program: /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
RiseOfTheTombRaider: crash reporter initialised with path "/home/zimudec/.local/share/feral-interactive/Rise of the Tomb Raider/crashes"
[New Thread 0x7fff3039d640 (LWP 3217)]
[New Thread 0x7fff27b9c640 (LWP 3218)]
[New Thread 0x7fff2f54e640 (LWP 3219)]
[New Thread 0x7fff2ed4d640 (LWP 3220)]
[New Thread 0x7fff2e54c640 (LWP 3221)]
[New Thread 0x7fff2c893640 (LWP 3238)]
[New Thread 0x7fff2739b640 (LWP 3239)]
[New Thread 0x7fff26b9a640 (LWP 3240)]
[New Thread 0x7fff26399640 (LWP 3241)]
[New Thread 0x7fff25714640 (LWP 3242)]
SDL2 initialised [built against 2.0.7, running with 2.0.7]
[Detaching after fork from child process 3243]
[New Thread 0x7fff25058640 (LWP 3244)]
[S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed.
[S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.
[Detaching after fork from child process 3245]
[Thread 0x7fff25058640 (LWP 3244) exited]
[New Thread 0x7fff25058640 (LWP 3443)]
[New Thread 0x7fff24857640 (LWP 3444)]
[Thread 0x7fff24857640 (LWP 3444) exited]
[New Thread 0x7fff24857640 (LWP 3445)]
[New Thread 0x7ffef6304640 (LWP 3446)]
[New Thread 0x7ffef5b03640 (LWP 3447)]
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
[New Thread 0x7ffedfa0a640 (LWP 3448)]
[New Thread 0x7ffedf209640 (LWP 3449)]
[New Thread 0x7ffedea08640 (LWP 3450)]
[New Thread 0x7ffede207640 (LWP 3451)]
--Type <RET> for more, q to quit, c to continue without paging--RET

Thread 1 "RiseOfTheTombRa" received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in  ()
#1  0x00007fff256ce19b in  () at /usr/lib/libVkLayer_MESA_device_select.so
#2  0x00007fff256cf5cf in  () at /usr/lib/libVkLayer_MESA_device_select.so
#3  0x00007ffef50d62e1 in InstanceInfo::searchDevices(VkLayerInstanceDispatchTable_&) () at /usr/lib/libprimus_vk.so.1
#4  0x00007ffef50cce55 in PrimusVK_CreateInstance(VkInstanceCreateInfo const*, VkAllocationCallbacks const*, VkInstance_T**) () at /usr/lib/libprimus_vk.so.1
#5  0x00007ffef59d3c69 in  () at /usr/lib/libvulkan.so.1
#6  0x00007ffef59d7ace in vkCreateInstance () at /usr/lib/libvulkan.so.1
#7  0x0000000001a1da9b in  ()
#8  0x0000000001a1f985 in  ()
#9  0x00000000019b30c7 in  ()
#10 0x00000000019b3868 in  ()
#11 0x00000000018f9844 in  ()
#12 0x00000000018f9c48 in  ()
#13 0x000000000047ef62 in  ()
#14 0x00000000004935f1 in  ()
#15 0x00000000004939ad in  ()
#16 0x00000000004aad61 in  ()
#17 0x00000000004aa281 in  ()
#18 0x000000000041d939 in  ()
#19 0x00007ffff209f152 in __libc_start_main () at /usr/lib/libc.so.6
#20 0x000000000046c3a1 in  ()
--Type <RET> for more, q to quit, c to continue without paging--RET
#21 0x00007fffffffe108 in  ()
#22 0x000000000000001c in  ()
#23 0x0000000000000001 in  ()
#24 0x00007fffffffe3e1 in  ()
#25 0x0000000000000000 in  ()
(gdb)

@zimudec
Copy link
Author

zimudec commented Oct 8, 2020

Regarding the 2 source links: The lower link is the "original" source repository. I already know that. I wanted to know, if there are manjaro-specific adjustments. The upper link shows me the archlinux package. That's where I got this svntogit-link from. Are you sure that this is also the source for manjaro? Does manjaro just take all packages from archlinux without modification, when there is not specific manjaro source?

I get it. The packages from the pacman repositories are, I understand, compiled only. I only know about the aur repository from non-compiled sources.

I also do not know if before being compiled and uploaded to the pacman repository, they are given special treatment.

@felixdoerre
Copy link
Owner

In the stack trace the source line numbers are missing, even for primus_vk. Could you compile primus-vk with debug symbols (and tell me the commit you are using), so we can see the line numbers of the two primus frames? Activating debug symbols is done with the -g or -g3 option, which is currently set by default in the Makefile. Some distributions strip the debug symbols when installing, so you would need to copy libprimus_vk.so.1 manually. (For further debugging, debug symbols for the mesa layer would be nice, too but I have no idea on how you would obtain them on manjaro or arch)

Even without line numbers, we can already see that the crash itself happens in the in the VkLayer_MESA_device_select-layer. I've never seen a crash there. You can try to disable the layer by setting the environment variable NODEVICE_SELECT=1. Could you try this and provide a new backtrace where the device_select layer is disabled.

@zimudec
Copy link
Author

zimudec commented Oct 9, 2020

In the stack trace the source line numbers are missing, even for primus_vk. Could you compile primus-vk with debug symbols (and tell me the commit you are using), so we can see the line numbers of the two primus frames? Activating debug symbols is done with the -g or -g3 option, which is currently set by default in the Makefile. Some distributions strip the debug symbols when installing, so you would need to copy libprimus_vk.so.1 manually. (For further debugging, debug symbols for the mesa layer would be nice, too but I have no idea on how you would obtain them on manjaro or arch)

Even without line numbers, we can already see that the crash itself happens in the in the VkLayer_MESA_device_select-layer. I've never seen a crash there. You can try to disable the layer by setting the environment variable NODEVICE_SELECT=1. Could you try this and provide a new backtrace where the device_select layer is disabled.

Regarding the first paragraph, I am very lost.

Regarding the second paragraph, I ran the same command above, prepending NODEVICE_SELECT=1, and the launcher started!

I added NODEVICE_SELECT=1 %command% to the launch parameters of rise of tomb raider, effectively the launcher starts, the game starts, I was able to resume my game without problems and it works correctly.

Questions:

  • How did you know that this variable exists and that it could be the solution?
  • This is a feasible temporary solution?
  • Do you have to correct something at the root?
  • Should we report this problem to feral?

@felixdoerre
Copy link
Owner

felixdoerre commented Oct 9, 2020

How did you know that this variable exists and that it could be the solution?

I've seen in the backtrace that there is a vulkan layer named VkLayer_MESA_device_select, which causes the crash. Layers are typically optional, so why not try to disable it. Such layers are registered under /usr/share/vulkan/implicit_layer.d. I have a similar-recent mesa driver installed, so I looked on my system in the config registering such layer, because for those layers, there always needs to be an environment variable registered to disable them. In /usr/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json I found:

    "disable_environment": {
      "NODEVICE_SELECT": "1"
    }

This is a feasible temporary solution?

Yes, I believe it is. As far as I know, this layer is intended to allow a user to sort a specific graphic device to the front to suggest to an application application to use it. With primus_vk you don't need this, as primus_vk only exposes on graphics device, the "hybrid"-graphics device, to the application. Primus_vk itself needs to see both the internal and the dedicated device, so having VkLayer_MESA_device_select below primus-vk (where is currently shows in the backtrace) isn't really useful at all. Even if you had multiple dedicated graphics cards and wanted to choose one from those, primus_vk let's you pass (via an environment variable) which one to use, and you don't need the mesa layer in any case.

Do you have to correct something at the root?

Yes, we should understand why the mesa layer crashes what the assumptions there are, why they are wrong and report a bug to mesa, if we are sill certain that this is a mesa bug. But for that we need the debug symbols. Without line numbers this back trace doesn't help us much further. I'll try to help you as much as I can being unfamiliar with arch. I found this wiki article which seems to fit what we want to do: https://wiki.archlinux.org/index.php/Debug_-_Getting_Traces (Currently: getting debug symbols for the package where libVkLayer_MESA_device_select.so is contained in, so probably mesa).
I can't seem to find mesa sources for manjaro, so I guess this is our best shot: https://github.com/archlinux/svntogit-packages/blob/packages/mesa/trunk/PKGBUILD
So I guess, you should download the PKGBUILD-file, and add somewhere at the top options=(debug !strip) and then run makepkg and install the package. I hope that helps (and is correct :-) )

Judging from the backtrace alone, we could be somewhere in this function: https://gitlab.freedesktop.org/mesa/mesa/-/blob/master/src/vulkan/device-select-layer/device_select_layer.c#L357
when something is null that is not expected, but without debug symbols, I am lost what that could be.

Should we report this problem to feral?

Right now, I don't think that this is a problem caused by the game and the game only has legitimate usage of the Vulkan API. If understanding why VkLayer_MESA_device_select leads to the result, that the game mis-uses the Vulkan API that would be a cause for a bug to feral. But right now I don't have an indication.

@zimudec
Copy link
Author

zimudec commented Oct 14, 2020

Yes, we should understand why the mesa layer crashes what the assumptions there are, why they are wrong and report a bug to mesa, if we are sill certain that this is a mesa bug. But for that we need the debug symbols. Without line numbers this back trace doesn't help us much further. I'll try to help you as much as I can being unfamiliar with arch. I found this wiki article which seems to fit what we want to do: https://wiki.archlinux.org/index.php/Debug_-_Getting_Traces (Currently: getting debug symbols for the package where libVkLayer_MESA_device_select.so is contained in, so probably mesa).
I can't seem to find mesa sources for manjaro, so I guess this is our best shot: https://github.com/archlinux/svntogit-packages/blob/packages/mesa/trunk/PKGBUILD
So I guess, you should download the PKGBUILD-file, and add somewhere at the top options=(debug !strip) and then run makepkg and install the package. I hope that helps (and is correct :-) )

Judging from the backtrace alone, we could be somewhere in this function: https://gitlab.freedesktop.org/mesa/mesa/-/blob/master/src/vulkan/device-select-layer/device_select_layer.c#L357
when something is null that is not expected, but without debug symbols, I am lost what that could be.

Sorry, I hadn't had time to review.

The truth is I am familiar with Linux, but not so advanced. I missed a lot at this point, especially on a conceptual level.

I'm going to test the package creation first, with the instructions given. Once the creation works, I will have to install it with pacman, right? as if it were a downloaded package ready to install?

If I install and something fails to boot, I assume that from terminal with F2 I could restore the package by installing the one I had previously, right?

I have not yet updated to the latest version of manjaro, therefore, not the latest version of table either. Will it cause problems if this version is more current than the one installed? as a test?

@felixdoerre
Copy link
Owner

Once the creation works, I will have to install it with pacman, right? as if it were a downloaded package ready to install?

Yes, you install the package exactly the same way you would install a manually downloaded one. Essentially, the packages that you download have most likely been created the same way using makepkg.

If I install and something fails to boot, I assume that from terminal with F2 I could restore the package by installing the one I had previously, right?

Yes, I doubt that changing something in mesa can prevent the system from booting completely (and thereby preventing access to the ttys). If the GUI fails, the ttys are the easiest way to restore your system.
You can use pacman to downgrade the package again. If you currently don't use the latest mesa package this might require obtaining the older version of the package, which you might use currently, manually.
Archlinux makes snapshots of the whole package database, which you can use to find, download and install the exact version of mesa which you currently have, again:
https://wiki.archlinux.org/index.php/Arch_Linux_Archive#How_to_downgrade_one_package

I'd suggest you download the mesa package that is currently installed from here: https://archive.archlinux.org/packages/m/mesa/
(or copy it out of the cache under /var/cache/pacman/pkg/) in advance, to make sure you can easily install the original package when needed.

I have not yet updated to the latest version of manjaro, therefore, not the latest version of table either. Will it cause problems if this version is more current than the one installed? as a test?

Probably not, upgrading mesa usually works very smoothly. However we want to reproduce the error that occurred with that version of mesa that is currently installed on your system, so it would be best if you would build exactly the version that is currently installed. I'd recommend that you go through the history (https://github.com/archlinux/svntogit-packages/commits/packages/mesa/trunk/PKGBUILD) and look for the exact mesa version that you are currently using and try to build debug symbols for that version.

@zimudec
Copy link
Author

zimudec commented Oct 17, 2020

... I had a typo in the instructions, there wrongly was a L before the line number, please try this:

b device_select_layer.c:249
y ( as confirmation to set a breakpoint on a library loaded in the future)
run
bt ( just to check that we got the same segfault)
p info

Can't find a file!

[zimudec@zimudec Rise of the Tomb Raider]$ STEAM_RUNTIME=0 GAME_LAUNCH_PREFIX="gdb --args" pvkrun ./RiseOfTheTombRaider.sh
WARNING: Rise of the Tomb Raider launched with STEAM_RUNTIME=0
         We recommend using the steam runtime if possible
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
PrimusVK: Searching for display GPU:
PrimusVK: 0x1902240: 
PrimusVK: Got integrated gpu!
PrimusVK: Device: Intel(R) HD Graphics 4000 (IVB GT2)
PrimusVK:   Type: 1
PrimusVK: Searching for render GPU:
PrimusVK: 0x1902240.
PrimusVK: 0x18e8340.
PrimusVK: Got discrete gpu!
PrimusVK: Device: GeForce GT 740M
PrimusVK:   Type: 2
GNU gdb (GDB) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider...
(No debugging symbols found in /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider)
(gdb) b device_select_layer.c:249
No symbol table is loaded.  Use the "file" command.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (device_select_layer.c:249) pending.
(gdb) run
Starting program: /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
RiseOfTheTombRaider: crash reporter initialised with path "/home/zimudec/.local/share/feral-interactive/Rise of the Tomb Raider/crashes"
[New Thread 0x7fff3039d640 (LWP 5316)]
[New Thread 0x7fff27b9c640 (LWP 5317)]
[New Thread 0x7fff2f54e640 (LWP 5318)]
[New Thread 0x7fff2ed4d640 (LWP 5319)]
[New Thread 0x7fff2e54c640 (LWP 5320)]
[New Thread 0x7fff2c893640 (LWP 5337)]
[New Thread 0x7fff2739b640 (LWP 5338)]
[New Thread 0x7fff26b9a640 (LWP 5339)]
[New Thread 0x7fff26399640 (LWP 5340)]
[New Thread 0x7fff25714640 (LWP 5341)]
SDL2 initialised [built against 2.0.7, running with 2.0.7]
[Detaching after fork from child process 5342]
[New Thread 0x7fff25058640 (LWP 5343)]
[S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed.
[S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.
[Detaching after fork from child process 5344]
Setting breakpad minidump AppID = 391220
Steam_SetMinidumpSteamID:  Caching Steam ID:  76561198008468660 [API loaded no]
[New Thread 0x7fff24857640 (LWP 5535)]
[S_API WARN] The loaded overlay DLL doesn't support ValveHookScreenshots
[S_API WARN] The loaded overlay DLL doesn't support ValveHookScreenshots
[New Thread 0x7ffee7fff640 (LWP 5536)]
[New Thread 0x7ffee77fe640 (LWP 5537)]
[New Thread 0x7ffee6ffd640 (LWP 5539)]
[New Thread 0x7ffee67fc640 (LWP 5544)]
[New Thread 0x7fff24469640 (LWP 5545)]
[New Thread 0x7ffee5ffb640 (LWP 5546)]
[Thread 0x7ffee77fe640 (LWP 5537) exited]
[Thread 0x7ffee5ffb640 (LWP 5546) exited]
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
[New Thread 0x7ffee5ffb640 (LWP 5582)]
[New Thread 0x7ffee77fe640 (LWP 5583)]
[New Thread 0x7ffee4f86640 (LWP 5584)]
[New Thread 0x7ffecb015640 (LWP 5585)]
--Type <RET> for more, q to quit, c to continue without paging--

Thread 1 "RiseOfTheTombRa" hit Breakpoint 1, fill_drm_device_info (
    info=info@entry=0x74dea90, drm_device=0x7fffffffbee0, 
    drm_device@entry=0x7336b30, device=0x7325fc0)
    at ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c:249
249	../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c: The file or directory does not exist.
(gdb) bt
#0  fill_drm_device_info
    (info=info@entry=0x74dea90, drm_device=0x7fffffffbee0, 
    drm_device@entry=0x7336b30, device=0x7325fc0)
    at ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c:249
#1  0x00007fff256cf5cf in get_default_device
    (pPhysicalDevices=0x6e650b0, physical_device_count=2, selection=0x0, info=0x74dea90)
    at ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c:347
#2  device_select_EnumeratePhysicalDevices
    (instance=<optimized out>, pPhysicalDeviceCount=0x7fffffffc36c, pPhysicalDevices=0x0)
    at ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c:419
#3  0x00007fff244b22e1 in InstanceInfo::searchDevices(VkLayerInstanceDispatchTable_&) () at /usr/lib/libprimus_vk.so.1
#4  0x00007fff244a8e55 in PrimusVK_CreateInstance(VkInstanceCreateInfo const*, VkAllocationCallbacks const*, VkInstance_T**) () at /usr/lib/libprimus_vk.so.1
#5  0x00007fff24339c69 in  () at /usr/lib/libvulkan.so.1
#6  0x00007fff2433dace in vkCreateInstance () at /usr/lib/libvulkan.so.1
#7  0x0000000001a1da9b in  ()
#8  0x0000000001a1f985 in  ()
#9  0x00000000019b30c7 in  ()
#10 0x00000000019b3868 in  ()
#11 0x00000000018f9844 in  ()
--Type <RET> for more, q to quit, c to continue without paging--
#12 0x00000000018f9c48 in  ()
#13 0x000000000047ef62 in  ()
#14 0x00000000004935f1 in  ()
#15 0x00000000004939ad in  ()
#16 0x00000000004aad61 in  ()
#17 0x00000000004aa281 in  ()
#18 0x000000000041d939 in  ()
#19 0x00007ffff209f152 in __libc_start_main () at /usr/lib/libc.so.6
#20 0x000000000046c3a1 in  ()
#21 0x00007fffffffe108 in  ()
#22 0x000000000000001c in  ()
#23 0x0000000000000001 in  ()
#24 0x00007fffffffe3e1 in  ()
#25 0x0000000000000000 in  ()
(gdb) p info
$1 = (const struct instance_info *) 0x74dea90
(gdb)

@felixdoerre
Copy link
Owner

felixdoerre commented Oct 17, 2020

... I would have needed p *info... Remote gdb is hard...

The ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c: The file or directory does not exist. is not that bad. You could configure gdb to find your mesa sources, so it would show you inline which line you are currently stepping through, however we do not require that. I will have to look up the corresponding lines in the source code anyways.

@zimudec
Copy link
Author

zimudec commented Oct 18, 2020

... I would have needed p *info... Remote gdb is hard...

The ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c: The file or directory does not exist. is not that bad. You could configure gdb to find your mesa sources, so it would show you inline which line you are currently stepping through, however we do not require that. I will have to look up the corresponding lines in the source code anyways.

Do you have the source code for that file?

So is it correct?:

[zimudec@zimudec Rise of the Tomb Raider]$ STEAM_RUNTIME=0 GAME_LAUNCH_PREFIX="gdb --args" pvkrun ./RiseOfTheTombRaider.sh
WARNING: Rise of the Tomb Raider launched with STEAM_RUNTIME=0
         We recommend using the steam runtime if possible
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
PrimusVK: Searching for display GPU:
PrimusVK: 0xe60240: 
PrimusVK: Got integrated gpu!
PrimusVK: Device: Intel(R) HD Graphics 4000 (IVB GT2)
PrimusVK:   Type: 1
PrimusVK: Searching for render GPU:
PrimusVK: 0xe60240.
PrimusVK: 0xe46340.
PrimusVK: Got discrete gpu!
PrimusVK: Device: GeForce GT 740M
PrimusVK:   Type: 2
GNU gdb (GDB) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider...
(No debugging symbols found in /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider)
(gdb) b device_select_layer.c:249
No symbol table is loaded.  Use the "file" command.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (device_select_layer.c:249) pending.
(gdb) run
Starting program: /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
RiseOfTheTombRaider: crash reporter initialised with path "/home/zimudec/.local/share/feral-interactive/Rise of the Tomb Raider/crashes"
[New Thread 0x7fff3039d640 (LWP 9208)]
[New Thread 0x7fff27b9c640 (LWP 9209)]
[New Thread 0x7fff2f54e640 (LWP 9210)]
[New Thread 0x7fff2ed4d640 (LWP 9211)]
[New Thread 0x7fff2e54c640 (LWP 9212)]
[New Thread 0x7fff2c893640 (LWP 9229)]
[New Thread 0x7fff2739b640 (LWP 9230)]
[New Thread 0x7fff26b9a640 (LWP 9231)]
[New Thread 0x7fff26399640 (LWP 9232)]
[New Thread 0x7fff25714640 (LWP 9233)]
SDL2 initialised [built against 2.0.7, running with 2.0.7]
[Detaching after fork from child process 9234]
[New Thread 0x7fff25058640 (LWP 9235)]
[S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed.
[S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.
[Detaching after fork from child process 9236]
Setting breakpad minidump AppID = 391220
Steam_SetMinidumpSteamID:  Caching Steam ID:  76561198008468660 [API loaded no]
[New Thread 0x7fff24857640 (LWP 9431)]
[S_API WARN] The loaded overlay DLL doesn't support ValveHookScreenshots
[S_API WARN] The loaded overlay DLL doesn't support ValveHookScreenshots
[New Thread 0x7ffee7fff640 (LWP 9432)]
[New Thread 0x7ffee77fe640 (LWP 9433)]
[New Thread 0x7ffee6ffd640 (LWP 9434)]
[New Thread 0x7fff24469640 (LWP 9435)]
[New Thread 0x7ffee67fc640 (LWP 9436)]
[New Thread 0x7ffee5ffb640 (LWP 9437)]
[Thread 0x7ffee77fe640 (LWP 9433) exited]
[Thread 0x7ffee67fc640 (LWP 9436) exited]
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
[New Thread 0x7ffee67fc640 (LWP 9458)]
[New Thread 0x7ffee77fe640 (LWP 9459)]
[New Thread 0x7ffee4f86640 (LWP 9460)]
[New Thread 0x7ffecb015640 (LWP 9461)]
--Type <RET> for more, q to quit, c to continue without paging--

Thread 1 "RiseOfTheTombRa" hit Breakpoint 1, fill_drm_device_info (
    info=info@entry=0x755ab40, drm_device=0x7fffffffbee0, 
    drm_device@entry=0x73d6870, device=0x754ace0)
    at ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c:249
249	../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c: No existe el fichero o el directorio.
(gdb) bt
#0  fill_drm_device_info
    (info=info@entry=0x755ab40, drm_device=0x7fffffffbee0, 
    drm_device@entry=0x73d6870, device=0x754ace0)
    at ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c:249
#1  0x00007fff256cf5cf in get_default_device
    (pPhysicalDevices=0x75460c0, physical_device_count=2, selection=0x0, info=0x755ab40)
    at ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c:347
#2  device_select_EnumeratePhysicalDevices
    (instance=<optimized out>, pPhysicalDeviceCount=0x7fffffffc36c, pPhysicalDevices=0x0)
    at ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c:419
#3  0x00007fff244b22e1 in InstanceInfo::searchDevices(VkLayerInstanceDispatchTable_&) () at /usr/lib/libprimus_vk.so.1
#4  0x00007fff244a8e55 in PrimusVK_CreateInstance(VkInstanceCreateInfo const*, VkAllocationCallbacks const*, VkInstance_T**) () at /usr/lib/libprimus_vk.so.1
#5  0x00007fff24339c69 in  () at /usr/lib/libvulkan.so.1
#6  0x00007fff2433dace in vkCreateInstance () at /usr/lib/libvulkan.so.1
#7  0x0000000001a1da9b in  ()
#8  0x0000000001a1f985 in  ()
#9  0x00000000019b30c7 in  ()
#10 0x00000000019b3868 in  ()
#11 0x00000000018f9844 in  ()
--Type <RET> for more, q to quit, c to continue without paging--
#12 0x00000000018f9c48 in  ()
#13 0x000000000047ef62 in  ()
#14 0x00000000004935f1 in  ()
#15 0x00000000004939ad in  ()
#16 0x00000000004aad61 in  ()
#17 0x00000000004aa281 in  ()
#18 0x000000000041d939 in  ()
#19 0x00007ffff209f152 in __libc_start_main () at /usr/lib/libc.so.6
#20 0x000000000046c3a1 in  ()
#21 0x00007fffffffe108 in  ()
#22 0x000000000000001c in  ()
#23 0x0000000000000001 in  ()
#24 0x00007fffffffe3e1 in  ()
#25 0x0000000000000000 in  ()
(gdb) p *info
$1 = {DestroyInstance = 0x7fff244c4ea0 <vkDestroyInstance>, 
  EnumeratePhysicalDevices = 0x7fff2433bb50, 
  EnumeratePhysicalDeviceGroups = 0x7fff2433c960, 
  GetInstanceProcAddr = 0x7fff244c6530 <vkGetInstanceProcAddr>, 
  GetPhysicalDeviceProcAddr = 0x7fff24339390, 
  EnumerateDeviceExtensionProperties = 0x7fff24334360, 
  GetPhysicalDeviceProperties = 0x7fff243200f0, 
  GetPhysicalDeviceProperties2KHR = 0x7fff24321c30, has_props2 = true, 
  has_pci_bus = true, has_wayland = false, has_xcb = true}
(gdb)

@felixdoerre
Copy link
Owner

Ok... so info->GetPhysicalDeviceProperties2KHR is not null, the first time the breakpoint hits. Could you, after these steps, execute the gdb command continue to see if we hit the segfault directly afterwards? If the program continues, just repeat the bt, p *info, continue until it hits the segfault. We need to see, how the situation looks directly before the segfault.

@zimudec
Copy link
Author

zimudec commented Oct 18, 2020

Ok... so info->GetPhysicalDeviceProperties2KHR is not null, the first time the breakpoint hits. Could you, after these steps, execute the gdb command continue to see if we hit the segfault directly afterwards? If the program continues, just repeat the bt, p *info, continue until it hits the segfault. We need to see, how the situation looks directly before the segfault.

I did the above, but after continue and bt, executing p * info returns No symbol "info" in current context.:

[zimudec@zimudec Rise of the Tomb Raider]$ STEAM_RUNTIME=0 GAME_LAUNCH_PREFIX="gdb --args" pvkrun ./RiseOfTheTombRaider.sh
WARNING: Rise of the Tomb Raider launched with STEAM_RUNTIME=0
         We recommend using the steam runtime if possible
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
PrimusVK: Searching for display GPU:
PrimusVK: 0x1cbb240: 
PrimusVK: Got integrated gpu!
PrimusVK: Device: Intel(R) HD Graphics 4000 (IVB GT2)
PrimusVK:   Type: 1
PrimusVK: Searching for render GPU:
PrimusVK: 0x1cbb240.
PrimusVK: 0x1ca05a0.
PrimusVK: Got discrete gpu!
PrimusVK: Device: GeForce GT 740M
PrimusVK:   Type: 2
GNU gdb (GDB) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider...
(No debugging symbols found in /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider)
(gdb) b device_select_layer.c:249
No symbol table is loaded.  Use the "file" command.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (device_select_layer.c:249) pending.
(gdb) run
Starting program: /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
RiseOfTheTombRaider: crash reporter initialised with path "/home/zimudec/.local/share/feral-interactive/Rise of the Tomb Raider/crashes"
[New Thread 0x7fff3039d640 (LWP 4534)]
[New Thread 0x7fff27b9c640 (LWP 4535)]
[New Thread 0x7fff2f54e640 (LWP 4536)]
[New Thread 0x7fff2ed4d640 (LWP 4537)]
[New Thread 0x7fff2e54c640 (LWP 4538)]
[New Thread 0x7fff2c893640 (LWP 4555)]
[New Thread 0x7fff2739b640 (LWP 4556)]
[New Thread 0x7fff26b9a640 (LWP 4557)]
[New Thread 0x7fff26399640 (LWP 4558)]
[New Thread 0x7fff25714640 (LWP 4559)]
SDL2 initialised [built against 2.0.7, running with 2.0.7]
[Detaching after fork from child process 4560]
[New Thread 0x7fff25058640 (LWP 4561)]
[S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed.
[S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.
[Detaching after fork from child process 4562]
[Thread 0x7fff25058640 (LWP 4561) exited]
Setting breakpad minidump AppID = 391220
Steam_SetMinidumpSteamID:  Caching Steam ID:  76561198008468660 [API loaded no]
[New Thread 0x7fff24857640 (LWP 4756)]
[S_API WARN] The loaded overlay DLL doesn't support ValveHookScreenshots
[S_API WARN] The loaded overlay DLL doesn't support ValveHookScreenshots
[New Thread 0x7fff25058640 (LWP 4757)]
[New Thread 0x7ffee7fff640 (LWP 4758)]
[Thread 0x7ffee7fff640 (LWP 4758) exited]
[New Thread 0x7ffee7fff640 (LWP 4759)]
[New Thread 0x7ffee77fe640 (LWP 4760)]
[New Thread 0x7fff24469640 (LWP 4761)]
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
[New Thread 0x7ffee579f640 (LWP 4788)]
[New Thread 0x7ffee4f9e640 (LWP 4789)]
[New Thread 0x7ffecbfff640 (LWP 4790)]
[New Thread 0x7ffecb7fe640 (LWP 4791)]
--Type <RET> for more, q to quit, c to continue without paging--

Thread 1 "RiseOfTheTombRa" hit Breakpoint 1, fill_drm_device_info (
    info=info@entry=0x7309b40, drm_device=0x7fffffffbee0, 
    drm_device@entry=0x72e1070, device=0x73855b0)
    at ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c:249
249	../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c: No existe el fichero o el directorio.
(gdb) bt
#0  fill_drm_device_info
    (info=info@entry=0x7309b40, drm_device=0x7fffffffbee0, 
    drm_device@entry=0x72e1070, device=0x73855b0)
    at ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c:249
#1  0x00007fff256cf5cf in get_default_device
    (pPhysicalDevices=0x7091140, physical_device_count=2, selection=0x0, info=0x7309b40)
    at ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c:347
#2  device_select_EnumeratePhysicalDevices
    (instance=<optimized out>, pPhysicalDeviceCount=0x7fffffffc36c, pPhysicalDevices=0x0)
    at ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c:419
#3  0x00007fff244b22e1 in InstanceInfo::searchDevices(VkLayerInstanceDispatchTable_&) () at /usr/lib/libprimus_vk.so.1
#4  0x00007fff244a8e55 in PrimusVK_CreateInstance(VkInstanceCreateInfo const*, VkAllocationCallbacks const*, VkInstance_T**) () at /usr/lib/libprimus_vk.so.1
#5  0x00007fff24339c69 in  () at /usr/lib/libvulkan.so.1
#6  0x00007fff2433dace in vkCreateInstance () at /usr/lib/libvulkan.so.1
#7  0x0000000001a1da9b in  ()
#8  0x0000000001a1f985 in  ()
#9  0x00000000019b30c7 in  ()
#10 0x00000000019b3868 in  ()
#11 0x00000000018f9844 in  ()
--Type <RET> for more, q to quit, c to continue without paging--
#12 0x00000000018f9c48 in  ()
#13 0x000000000047ef62 in  ()
#14 0x00000000004935f1 in  ()
#15 0x00000000004939ad in  ()
#16 0x00000000004aad61 in  ()
#17 0x00000000004aa281 in  ()
#18 0x000000000041d939 in  ()
#19 0x00007ffff209f152 in __libc_start_main () at /usr/lib/libc.so.6
#20 0x000000000046c3a1 in  ()
#21 0x00007fffffffe108 in  ()
#22 0x000000000000001c in  ()
#23 0x0000000000000001 in  ()
#24 0x00007fffffffe3e1 in  ()
#25 0x0000000000000000 in  ()
(gdb) p *info
$1 = {DestroyInstance = 0x7fff244c4ea0 <vkDestroyInstance>, 
  EnumeratePhysicalDevices = 0x7fff2433bb50, 
  EnumeratePhysicalDeviceGroups = 0x7fff2433c960, 
  GetInstanceProcAddr = 0x7fff244c6530 <vkGetInstanceProcAddr>, 
  GetPhysicalDeviceProcAddr = 0x7fff24339390, 
  EnumerateDeviceExtensionProperties = 0x7fff24334360, 
  GetPhysicalDeviceProperties = 0x7fff243200f0, 
  GetPhysicalDeviceProperties2KHR = 0x7fff24321c30, has_props2 = true, 
  has_pci_bus = true, has_wayland = false, has_xcb = true}
(gdb) continue
Continuing.

Thread 1 "RiseOfTheTombRa" received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in  ()
#1  0x00007fff256ce19b in fill_drm_device_info
    (info=info@entry=0x7309b40, drm_device=drm_device@entry=0x72e1070, device=<optimized out>)
    at ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c:249
#2  0x00007fff256cf5cf in get_default_device
    (pPhysicalDevices=0x7091140, physical_device_count=2, selection=0x0, info=0x7309b40)
    at ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c:347
#3  device_select_EnumeratePhysicalDevices
    (instance=<optimized out>, pPhysicalDeviceCount=0x7fffffffc36c, pPhysicalDevices=0x0)
    at ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c:419
#4  0x00007fff244b22e1 in InstanceInfo::searchDevices(VkLayerInstanceDispatchTable_&) () at /usr/lib/libprimus_vk.so.1
#5  0x00007fff244a8e55 in PrimusVK_CreateInstance(VkInstanceCreateInfo const*, VkAllocationCallbacks const*, VkInstance_T**) () at /usr/lib/libprimus_vk.so.1
#6  0x00007fff24339c69 in  () at /usr/lib/libvulkan.so.1
#7  0x00007fff2433dace in vkCreateInstance () at /usr/lib/libvulkan.so.1
#8  0x0000000001a1da9b in  ()
#9  0x0000000001a1f985 in  ()
#10 0x00000000019b30c7 in  ()
#11 0x00000000019b3868 in  ()
--Type <RET> for more, q to quit, c to continue without paging--
#12 0x00000000018f9844 in  ()
#13 0x00000000018f9c48 in  ()
#14 0x000000000047ef62 in  ()
#15 0x00000000004935f1 in  ()
#16 0x00000000004939ad in  ()
#17 0x00000000004aad61 in  ()
#18 0x00000000004aa281 in  ()
#19 0x000000000041d939 in  ()
#20 0x00007ffff209f152 in __libc_start_main () at /usr/lib/libc.so.6
#21 0x000000000046c3a1 in  ()
#22 0x00007fffffffe108 in  ()
#23 0x000000000000001c in  ()
#24 0x0000000000000001 in  ()
#25 0x00007fffffffe3e1 in  ()
#26 0x0000000000000000 in  ()
(gdb) p *info
No symbol "info" in current context.
(gdb) continue
Continuing.

Thread 1 "RiseOfTheTombRa" received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in  ()
#1  0x00007fff256ce19b in fill_drm_device_info
    (info=info@entry=0x7309b40, drm_device=drm_device@entry=0x72e1070, device=<optimized out>)
    at ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c:249
#2  0x00007fff256cf5cf in get_default_device
    (pPhysicalDevices=0x7091140, physical_device_count=2, selection=0x0, info=0x7309b40)
    at ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c:347
#3  device_select_EnumeratePhysicalDevices
    (instance=<optimized out>, pPhysicalDeviceCount=0x7fffffffc36c, pPhysicalDevices=0x0)
    at ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c:419
#4  0x00007fff244b22e1 in InstanceInfo::searchDevices(VkLayerInstanceDispatchTable_&) () at /usr/lib/libprimus_vk.so.1
#5  0x00007fff244a8e55 in PrimusVK_CreateInstance(VkInstanceCreateInfo const*, VkAllocationCallbacks const*, VkInstance_T**) () at /usr/lib/libprimus_vk.so.1
#6  0x00007fff24339c69 in  () at /usr/lib/libvulkan.so.1
#7  0x00007fff2433dace in vkCreateInstance () at /usr/lib/libvulkan.so.1
#8  0x0000000001a1da9b in  ()
#9  0x0000000001a1f985 in  ()
#10 0x00000000019b30c7 in  ()
#11 0x00000000019b3868 in  ()
--Type <RET> for more, q to quit, c to continue without paging--
#12 0x00000000018f9844 in  ()
#13 0x00000000018f9c48 in  ()
#14 0x000000000047ef62 in  ()
#15 0x00000000004935f1 in  ()
#16 0x00000000004939ad in  ()
#17 0x00000000004aad61 in  ()
#18 0x00000000004aa281 in  ()
#19 0x000000000041d939 in  ()
#20 0x00007ffff209f152 in __libc_start_main () at /usr/lib/libc.so.6
#21 0x000000000046c3a1 in  ()
#22 0x00007fffffffe108 in  ()
#23 0x000000000000001c in  ()
#24 0x0000000000000001 in  ()
#25 0x00007fffffffe3e1 in  ()
#26 0x0000000000000000 in  ()
(gdb) p *info
No symbol "info" in current context.
(gdb) continue
Continuing.
[Thread 0x7ffee77fe640 (LWP 4760) exited]
RiseOfTheTombRaider: crash reporter failed

Thread 1 "RiseOfTheTombRa" received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) p *info
No symbol "info" in current context.
(gdb)

@felixdoerre
Copy link
Owner

Ok, we hit the segfault directly after we hit our breakpoint, but the function is not null. I still don't understand why we segfault probably, we need to look at the disassembly:

b device_select_layer.c:249
y
r
bt
disassemble
c

.... sorry that it take so many roundtrips, but debugging is sadly kind-of interactive...

@zimudec
Copy link
Author

zimudec commented Oct 19, 2020

Ok, we hit the segfault directly after we hit our breakpoint, but the function is not null. I still don't understand why we segfault probably, we need to look at the disassembly:

b device_select_layer.c:249
y
r
bt
disassemble
c

.... sorry that it take so many roundtrips, but debugging is sadly kind-of interactive...

Don't worry, I understand perfectly. I still want to know the real cause of the problem instead of just looking for an alternative path.

[zimudec@zimudec Rise of the Tomb Raider]$ STEAM_RUNTIME=0 GAME_LAUNCH_PREFIX="gdb --args" pvkrun ./RiseOfTheTombRaider.sh
WARNING: Rise of the Tomb Raider launched with STEAM_RUNTIME=0
         We recommend using the steam runtime if possible
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
PrimusVK: Searching for display GPU:
PrimusVK: 0xf54e10: 
PrimusVK: Got integrated gpu!
PrimusVK: Device: Intel(R) HD Graphics 4000 (IVB GT2)
PrimusVK:   Type: 1
PrimusVK: Searching for render GPU:
PrimusVK: 0xf54e10.
PrimusVK: 0xf55a40.
PrimusVK: Got discrete gpu!
PrimusVK: Device: GeForce GT 740M
PrimusVK:   Type: 2
GNU gdb (GDB) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider...
(No debugging symbols found in /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider)
(gdb) b device_select_layer.c:249
No symbol table is loaded.  Use the "file" command.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (device_select_layer.c:249) pending.
(gdb) r
Starting program: /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
RiseOfTheTombRaider: crash reporter initialised with path "/home/zimudec/.local/share/feral-interactive/Rise of the Tomb Raider/crashes"
[New Thread 0x7fff3039d640 (LWP 12992)]
[New Thread 0x7fff27b9c640 (LWP 12993)]
[New Thread 0x7fff2f54e640 (LWP 12994)]
[New Thread 0x7fff2ed4d640 (LWP 12995)]
[New Thread 0x7fff2e54c640 (LWP 12996)]
[New Thread 0x7fff2c893640 (LWP 13013)]
[New Thread 0x7fff2739b640 (LWP 13014)]
[New Thread 0x7fff26b9a640 (LWP 13015)]
[New Thread 0x7fff26399640 (LWP 13016)]
[New Thread 0x7fff25714640 (LWP 13017)]
SDL2 initialised [built against 2.0.7, running with 2.0.7]
[Detaching after fork from child process 13018]
[New Thread 0x7fff25058640 (LWP 13019)]
[S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed.
[S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.
[Detaching after fork from child process 13020]
Setting breakpad minidump AppID = 391220
Steam_SetMinidumpSteamID:  Caching Steam ID:  76561198008468660 [API loaded no]
[New Thread 0x7fff24857640 (LWP 13211)]
[S_API WARN] The loaded overlay DLL doesn't support ValveHookScreenshots
[S_API WARN] The loaded overlay DLL doesn't support ValveHookScreenshots
[New Thread 0x7ffee7fff640 (LWP 13212)]
[New Thread 0x7ffee77fe640 (LWP 13213)]
[New Thread 0x7ffee6ffd640 (LWP 13214)]
[New Thread 0x7fff24469640 (LWP 13215)]
[New Thread 0x7ffee67fc640 (LWP 13216)]
[New Thread 0x7ffee5ffb640 (LWP 13217)]
[Thread 0x7ffee77fe640 (LWP 13213) exited]
[Thread 0x7ffee67fc640 (LWP 13216) exited]
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
[New Thread 0x7ffee67fc640 (LWP 13265)]
[New Thread 0x7ffee77fe640 (LWP 13266)]
[New Thread 0x7ffee4f86640 (LWP 13267)]
[New Thread 0x7ffecb015640 (LWP 13268)]
--Type <RET> for more, q to quit, c to continue without paging--

Thread 1 "RiseOfTheTombRa" hit Breakpoint 1, fill_drm_device_info (
    info=info@entry=0x73c0fe0, drm_device=0x7fffffffbb40, 
    drm_device@entry=0x72ff4d0, device=0x71e0330)
    at ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c:249
249	../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c: No existe el fichero o el directorio.
(gdb) bt
#0  fill_drm_device_info
    (info=info@entry=0x73c0fe0, drm_device=0x7fffffffbb40, 
    drm_device@entry=0x72ff4d0, device=0x71e0330)
    at ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c:249
#1  0x00007fff256cf5cf in get_default_device
    (pPhysicalDevices=0x74ce720, physical_device_count=2, selection=0x0, info=0x73c0fe0)
    at ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c:347
#2  device_select_EnumeratePhysicalDevices
    (instance=<optimized out>, pPhysicalDeviceCount=0x7fffffffbfcc, pPhysicalDevices=0x0)
    at ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c:419
#3  0x00007fff244b22e1 in InstanceInfo::searchDevices(VkLayerInstanceDispatchTable_&) () at /usr/lib/libprimus_vk.so.1
#4  0x00007fff244a8e55 in PrimusVK_CreateInstance(VkInstanceCreateInfo const*, VkAllocationCallbacks const*, VkInstance_T**) () at /usr/lib/libprimus_vk.so.1
#5  0x00007fff24339c69 in  () at /usr/lib/libvulkan.so.1
#6  0x00007fff2433dace in vkCreateInstance () at /usr/lib/libvulkan.so.1
#7  0x0000000001a1da9b in  ()
#8  0x0000000001a1f985 in  ()
#9  0x00000000019b30c7 in  ()
#10 0x00000000019b3868 in  ()
#11 0x00000000018f9844 in  ()
--Type <RET> for more, q to quit, c to continue without paging--
#12 0x00000000018f9c48 in  ()
#13 0x000000000047ef62 in  ()
#14 0x00000000004935f1 in  ()
#15 0x00000000004939ad in  ()
#16 0x00000000004aad61 in  ()
#17 0x00000000004aa281 in  ()
#18 0x000000000041d939 in  ()
#19 0x00007ffff209f152 in __libc_start_main () at /usr/lib/libc.so.6
#20 0x000000000046c3a1 in  ()
#21 0x00007fffffffdd68 in  ()
#22 0x000000000000001c in  ()
#23 0x0000000000000001 in  ()
#24 0x00007fffffffe0da in  ()
#25 0x0000000000000000 in  ()
(gdb) disassemble
Dump of assembler code for function fill_drm_device_info:
   0x00007fff256ce130 <+0>:	push   %rbp
   0x00007fff256ce131 <+1>:	mov    %rdi,%rbp
   0x00007fff256ce134 <+4>:	pxor   %xmm0,%xmm0
   0x00007fff256ce138 <+8>:	mov    $0x69,%ecx
   0x00007fff256ce13d <+13>:	push   %rbx
   0x00007fff256ce13e <+14>:	mov    %rsi,%rbx
   0x00007fff256ce141 <+17>:	mov    %rdx,%r8
   0x00007fff256ce144 <+20>:	sub    $0x378,%rsp
   0x00007fff256ce14b <+27>:	mov    %fs:0x28,%rax
   0x00007fff256ce154 <+36>:	mov    %rax,0x368(%rsp)
   0x00007fff256ce15c <+44>:	xor    %eax,%eax
   0x00007fff256ce15e <+46>:	lea    0x20(%rsp),%rsi
   0x00007fff256ce163 <+51>:	cmpb   $0x0,0x40(%rbp)
   0x00007fff256ce167 <+55>:	movups %xmm0,(%rsp)
   0x00007fff256ce16b <+59>:	mov    %rsi,%rdi
   0x00007fff256ce16e <+62>:	movl   $0x3b9e0620,(%rsp)
   0x00007fff256ce175 <+69>:	movups %xmm0,0x10(%rsp)
   0x00007fff256ce17a <+74>:	rep stos %rax,%es:(%rdi)
   0x00007fff256ce17d <+77>:	movl   $0x3b9bb079,0x20(%rsp)
   0x00007fff256ce185 <+85>:	je     0x7fff256ce18d <fill_drm_device_info+93>
   0x00007fff256ce187 <+87>:	cmpb   $0x0,0x41(%rbp)
   0x00007fff256ce18b <+91>:	jne    0x7fff256ce1f0 <fill_drm_device_info+192>--Type <RET> for more, q to quit, c to continue without paging--

   0x00007fff256ce18d <+93>:	mov    0x38(%rbp),%rax
   0x00007fff256ce191 <+97>:	test   %rax,%rax
   0x00007fff256ce194 <+100>:	je     0x7fff256ce201 <fill_drm_device_info+209>
=> 0x00007fff256ce196 <+102>:	mov    %r8,%rdi
   0x00007fff256ce199 <+105>:	callq  *%rax
   0x00007fff256ce19b <+107>:	mov    0x38(%rsp),%eax
   0x00007fff256ce19f <+111>:	cmpb   $0x0,0x41(%rbp)
   0x00007fff256ce1a3 <+115>:	mov    %ax,(%rbx)
   0x00007fff256ce1a6 <+118>:	mov    0x3c(%rsp),%eax
   0x00007fff256ce1aa <+122>:	mov    %ax,0x2(%rbx)
   0x00007fff256ce1ae <+126>:	je     0x7fff256ce1d1 <fill_drm_device_info+161>
   0x00007fff256ce1b0 <+128>:	mov    0x10(%rsp),%eax
   0x00007fff256ce1b4 <+132>:	movb   $0x1,0x10(%rbx)
   0x00007fff256ce1b8 <+136>:	mov    %ax,0xa(%rbx)
   0x00007fff256ce1bc <+140>:	mov    0x14(%rsp),%eax
   0x00007fff256ce1c0 <+144>:	mov    %al,0xc(%rbx)
   0x00007fff256ce1c3 <+147>:	mov    0x18(%rsp),%eax
   0x00007fff256ce1c7 <+151>:	mov    %al,0xd(%rbx)
   0x00007fff256ce1ca <+154>:	mov    0x1c(%rsp),%eax
   0x00007fff256ce1ce <+158>:	mov    %al,0xe(%rbx)
--Type <RET> for more, q to quit, c to continue without paging--
   0x00007fff256ce1d1 <+161>:	mov    0x368(%rsp),%rax
   0x00007fff256ce1d9 <+169>:	sub    %fs:0x28,%rax
   0x00007fff256ce1e2 <+178>:	jne    0x7fff256ce20e <fill_drm_device_info+222>
   0x00007fff256ce1e4 <+180>:	add    $0x378,%rsp
   0x00007fff256ce1eb <+187>:	pop    %rbx
   0x00007fff256ce1ec <+188>:	pop    %rbp
   0x00007fff256ce1ed <+189>:	retq   
   0x00007fff256ce1ee <+190>:	xchg   %ax,%ax
   0x00007fff256ce1f0 <+192>:	mov    %rsp,%rax
   0x00007fff256ce1f3 <+195>:	mov    %rax,0x28(%rsp)
   0x00007fff256ce1f8 <+200>:	mov    0x38(%rbp),%rax
   0x00007fff256ce1fc <+204>:	test   %rax,%rax
   0x00007fff256ce1ff <+207>:	jne    0x7fff256ce196 <fill_drm_device_info+102>
   0x00007fff256ce201 <+209>:	lea    0x30(%rsp),%rsi
   0x00007fff256ce206 <+214>:	mov    %r8,%rdi
   0x00007fff256ce209 <+217>:	callq  *0x30(%rbp)
   0x00007fff256ce20c <+220>:	jmp    0x7fff256ce19b <fill_drm_device_info+107>
   0x00007fff256ce20e <+222>:	callq  *0x4cd4(%rip)        # 0x7fff256d2ee8
End of assembler dump.
(gdb) c
Continuing.
[Thread 0x7fff25058640 (LWP 13019) exited]

Thread 1 "RiseOfTheTombRa" received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb)

@felixdoerre
Copy link
Owner

... Thanks for the next round:

   0x00007fff256ce194 <+100>:	je     0x7fff256ce201 <fill_drm_device_info+209>
=> 0x00007fff256ce196 <+102>:	mov    %r8,%rdi
   0x00007fff256ce199 <+105>:	callq  *%rax
   0x00007fff256ce19b <+107>:	mov    0x38(%rsp),%eax

in this disassembly section I can see, that there doesn't happen anything suspicious. Judging from the address in the segfault-backtrace, which ends with 19b I'd say that the segfault happens directly in the function specified by %rax. I'd guess we need to look into that function next:

b device_select_layer.c:249
y
r
bt
x/50i info->GetPhysicalDeviceProperties2KHR

I believe that the function that is pointed to here is terminator_GetPhysicalDeviceProperties2: https://github.com/KhronosGroup/Vulkan-Loader/blob/921ca6d992fca347396ee153bf1820a9f3b8d478/loader/loader.c#L7959 so the debugsymbols for libvulkan1 would be nice ( https://github.com/archlinux/svntogit-packages/blob/packages/vulkan-icd-loader/trunk/PKGBUILD ), but I continue the instructions that can be completed without re-compiling libvulkan with debugsymbols: When I disassemble the corresponding this is what the start of the disassembly looks like:

> 0x00007ffff748aef0 <+0>:	push   %r12
   0x00007ffff748aef2 <+2>:	push   %rbp
   0x00007ffff748aef3 <+3>:	mov    %rsi,%rbp
   0x00007ffff748aef6 <+6>:	push   %rbx
   0x00007ffff748aef7 <+7>:	mov    0x8(%rdi),%r12
   0x00007ffff748aefb <+11>:	mov    %rdi,%rbx
   0x00007ffff748aefe <+14>:	mov    0x8(%r12),%rdi
   0x00007ffff748af03 <+19>:	test   %rdi,%rdi
   0x00007ffff748af06 <+22>:	je     0x7ffff748af30 <terminator_GetPhysicalDeviceProperties2+64>
   0x00007ffff748af08 <+24>:	testb  $0x1,0x3f78(%rdi)
   0x00007ffff748af0f <+31>:	je     0x7ffff748af30 <terminator_GetPhysicalDeviceProperties2+64>
   0x00007ffff748af11 <+33>:	mov    0x1b0(%r12),%rax
   0x00007ffff748af19 <+41>:	test   %rax,%rax
   0x00007ffff748af1c <+44>:	je     0x7ffff748af50 <terminator_GetPhysicalDeviceProperties2+96>
   0x00007ffff748af1e <+46>:	mov    0x18(%rbx),%rdi
   0x00007ffff748af22 <+50>:	mov    %rbp,%rsi
   0x00007ffff748af25 <+53>:	pop    %rbx
   0x00007ffff748af26 <+54>:	pop    %rbp
   0x00007ffff748af27 <+55>:	pop    %r12
   0x00007ffff748af29 <+57>:	jmpq   *%rax
   0x00007ffff748af2b <+59>:	nopl   0x0(%rax,%rax,1)

I believe the jump that we will take (which leads to the segfault) is the one at address 0x00007ffff748af29:
So I would ask you to take the address that is shown in your disassembly (before the jmpq *%rax command ) and continue the gdb session with these commands (0x00007ffff748af29 replaced with the address shown in your disassembly):

b *0x00007ffff748af29
c
p/x $rax
x/50i $rax
i sh

This should allow us to determine, if the function is missing (in that case the nvidia driver might have misbehaved) or if there is a function where the segfault happens inside.

@zimudec
Copy link
Author

zimudec commented Oct 19, 2020

Let's see if what I understood is correct:

[zimudec@zimudec Rise of the Tomb Raider]$ STEAM_RUNTIME=0 GAME_LAUNCH_PREFIX="gdb --args" pvkrun ./RiseOfTheTombRaider.sh
WARNING: Rise of the Tomb Raider launched with STEAM_RUNTIME=0
         We recommend using the steam runtime if possible
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
PrimusVK: Searching for display GPU:
PrimusVK: 0x1235240: 
PrimusVK: Got integrated gpu!
PrimusVK: Device: Intel(R) HD Graphics 4000 (IVB GT2)
PrimusVK:   Type: 1
PrimusVK: Searching for render GPU:
PrimusVK: 0x1235240.
PrimusVK: 0x121b340.
PrimusVK: Got discrete gpu!
PrimusVK: Device: GeForce GT 740M
PrimusVK:   Type: 2
GNU gdb (GDB) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider...
(No debugging symbols found in /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider)
(gdb) b device_select_layer.c:249
No symbol table is loaded.  Use the "file" command.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (device_select_layer.c:249) pending.
(gdb) r
Starting program: /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
RiseOfTheTombRaider: crash reporter initialised with path "/home/zimudec/.local/share/feral-interactive/Rise of the Tomb Raider/crashes"
[New Thread 0x7fff3039d640 (LWP 1861)]
[New Thread 0x7fff27b9c640 (LWP 1862)]
[New Thread 0x7fff2f54e640 (LWP 1863)]
[New Thread 0x7fff2ed4d640 (LWP 1864)]
[New Thread 0x7fff2e54c640 (LWP 1865)]
[New Thread 0x7fff2c893640 (LWP 1882)]
[New Thread 0x7fff2739b640 (LWP 1883)]
[New Thread 0x7fff26b9a640 (LWP 1884)]
[New Thread 0x7fff26399640 (LWP 1885)]
[New Thread 0x7fff25714640 (LWP 1887)]
SDL2 initialised [built against 2.0.7, running with 2.0.7]
[Detaching after fork from child process 1888]
[New Thread 0x7fff25058640 (LWP 1889)]
[S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed.
[S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.
[Detaching after fork from child process 1890]
[Thread 0x7fff25058640 (LWP 1889) exited]
Setting breakpad minidump AppID = 391220
Steam_SetMinidumpSteamID:  Caching Steam ID:  76561198008468660 [API loaded no]
[New Thread 0x7fff24857640 (LWP 2211)]
[S_API WARN] The loaded overlay DLL doesn't support ValveHookScreenshots
[S_API WARN] The loaded overlay DLL doesn't support ValveHookScreenshots
[New Thread 0x7fff25058640 (LWP 2217)]
[New Thread 0x7ffee7fff640 (LWP 2218)]
[Thread 0x7ffee7fff640 (LWP 2218) exited]
[New Thread 0x7ffee7fff640 (LWP 2220)]
[New Thread 0x7ffee77fe640 (LWP 2221)]
[New Thread 0x7fff24469640 (LWP 2222)]
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
[New Thread 0x7ffee579f640 (LWP 2231)]
[New Thread 0x7ffee4f9e640 (LWP 2232)]
[New Thread 0x7ffecbfff640 (LWP 2233)]
[New Thread 0x7ffecb7fe640 (LWP 2234)]
--Type <RET> for more, q to quit, c to continue without paging--

Thread 1 "RiseOfTheTombRa" hit Breakpoint 1, fill_drm_device_info (
    info=info@entry=0x74aa0c0, drm_device=0x7fffffffbee0, 
    drm_device@entry=0x7479fd0, device=0x72e31d0)
    at ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c:249
249	../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c: No existe el fichero o el directorio.
(gdb) bt
#0  fill_drm_device_info
    (info=info@entry=0x74aa0c0, drm_device=0x7fffffffbee0, 
    drm_device@entry=0x7479fd0, device=0x72e31d0)
    at ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c:249
#1  0x00007fff256cf5cf in get_default_device
    (pPhysicalDevices=0x746e7e0, physical_device_count=2, selection=0x0, info=0x74aa0c0)
    at ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c:347
#2  device_select_EnumeratePhysicalDevices
    (instance=<optimized out>, pPhysicalDeviceCount=0x7fffffffc36c, pPhysicalDevices=0x0)
    at ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c:419
#3  0x00007fff244b22e1 in InstanceInfo::searchDevices(VkLayerInstanceDispatchTable_&) () at /usr/lib/libprimus_vk.so.1
#4  0x00007fff244a8e55 in PrimusVK_CreateInstance(VkInstanceCreateInfo const*, VkAllocationCallbacks const*, VkInstance_T**) () at /usr/lib/libprimus_vk.so.1
#5  0x00007fff24339c69 in  () at /usr/lib/libvulkan.so.1
#6  0x00007fff2433dace in vkCreateInstance () at /usr/lib/libvulkan.so.1
#7  0x0000000001a1da9b in  ()
#8  0x0000000001a1f985 in  ()
#9  0x00000000019b30c7 in  ()
#10 0x00000000019b3868 in  ()
#11 0x00000000018f9844 in  ()
--Type <RET> for more, q to quit, c to continue without paging--
#12 0x00000000018f9c48 in  ()
#13 0x000000000047ef62 in  ()
#14 0x00000000004935f1 in  ()
#15 0x00000000004939ad in  ()
#16 0x00000000004aad61 in  ()
#17 0x00000000004aa281 in  ()
#18 0x000000000041d939 in  ()
#19 0x00007ffff209f152 in __libc_start_main () at /usr/lib/libc.so.6
#20 0x000000000046c3a1 in  ()
#21 0x00007fffffffe108 in  ()
#22 0x000000000000001c in  ()
#23 0x0000000000000001 in  ()
#24 0x00007fffffffe3e1 in  ()
#25 0x0000000000000000 in  ()
(gdb) x/50i info->GetPhysicalDeviceProperties2KHR
   0x7fff24321c30:	push   %r12
   0x7fff24321c32:	push   %rbp
   0x7fff24321c33:	mov    %rsi,%rbp
   0x7fff24321c36:	push   %rbx
   0x7fff24321c37:	mov    0x8(%rdi),%r12
   0x7fff24321c3b:	mov    %rdi,%rbx
   0x7fff24321c3e:	mov    0x8(%r12),%rdi
   0x7fff24321c43:	test   %rdi,%rdi
   0x7fff24321c46:	je     0x7fff24321c70
   0x7fff24321c48:	testb  $0x1,0x3f78(%rdi)
   0x7fff24321c4f:	je     0x7fff24321c70
   0x7fff24321c51:	mov    0x1b0(%r12),%rax
   0x7fff24321c59:	test   %rax,%rax
   0x7fff24321c5c:	je     0x7fff24321c90
   0x7fff24321c5e:	mov    0x18(%rbx),%rdi
   0x7fff24321c62:	mov    %rbp,%rsi
   0x7fff24321c65:	pop    %rbx
   0x7fff24321c66:	pop    %rbp
   0x7fff24321c67:	pop    %r12
   0x7fff24321c69:	jmpq   *%rax
   0x7fff24321c6b:	nopl   0x0(%rax,%rax,1)
   0x7fff24321c70:	mov    0xb0(%r12),%rax
   0x7fff24321c78:	test   %rax,%rax
--Type <RET> for more, q to quit, c to continue without paging--
   0x7fff24321c7b:	jne    0x7fff24321c5e
   0x7fff24321c7d:	testb  $0x1,0x3f78(%rdi)
   0x7fff24321c84:	je     0x7fff24321c5e
   0x7fff24321c86:	nopw   %cs:0x0(%rax,%rax,1)
   0x7fff24321c90:	mov    (%r12),%rax
   0x7fff24321c94:	lea    0x31e15(%rip),%rcx        # 0x7fff24353ab0
   0x7fff24321c9b:	xor    %edx,%edx
   0x7fff24321c9d:	mov    $0x1,%esi
   0x7fff24321ca2:	mov    (%rax),%r8
   0x7fff24321ca5:	xor    %eax,%eax
   0x7fff24321ca7:	callq  0x7fff24321900
   0x7fff24321cac:	mov    0x18(%rbx),%rdi
   0x7fff24321cb0:	lea    0x10(%rbp),%rsi
   0x7fff24321cb4:	callq  *0x50(%r12)
   0x7fff24321cb9:	mov    0x8(%rbp),%rbx
   0x7fff24321cbd:	lea    0x31edc(%rip),%rbp        # 0x7fff24353ba0
   0x7fff24321cc4:	jmp    0x7fff24321cdd
   0x7fff24321cc6:	nopw   %cs:0x0(%rax,%rax,1)
   0x7fff24321cd0:	testb  $0x4,0x3f78(%rdi)
   0x7fff24321cd7:	jne    0x7fff24321d08
   0x7fff24321cd9:	mov    0x8(%rbx),%rbx
   0x7fff24321cdd:	test   %rbx,%rbx
   0x7fff24321ce0:	je     0x7fff24321d38
--Type <RET> for more, q to quit, c to continue without paging--
   0x7fff24321ce2:	cmpl   $0x3b9bdf5c,(%rbx)
   0x7fff24321ce8:	mov    0x8(%r12),%rdi
   0x7fff24321ced:	je     0x7fff24321cd0
   0x7fff24321cef:	mov    %rbp,%rcx
(gdb) b *0x7fff24321c69
Breakpoint 2 at 0x7fff24321c69
(gdb) c
Continuing.

Thread 1 "RiseOfTheTombRa" hit Breakpoint 2, 0x00007fff24321c69 in ?? ()
   from /usr/lib/libvulkan.so.1
(gdb) p/x $rax
$1 = 0x0
(gdb) x/50i $rax
   0x0:	Cannot access memory at address 0x0
(gdb) i sh
From                To                  Syms Read   Shared Object Library
0x00007ffff7fd2090  0x00007ffff7ff2746  Yes (*)     /lib64/ld-linux-x86-64.so.2
0x00007ffff7f7a210  0x00007ffff7f7b179  Yes (*)     /usr/lib/libdl.so.2
0x00007ffff7f62020  0x00007ffff7f6f270  Yes (*)     /usr/lib/libz.so.1
0x00007ffff7d0a320  0x00007ffff7d4a0dc  Yes (*)     /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/../lib/libcurl.so.4
0x00007ffff7abfe80  0x00007ffff7aed638  Yes (*)     /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/../lib/libssl.so.44
0x00007ffff771dc40  0x00007ffff781aa00  Yes (*)     /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/../lib/libcrypto.so.42
0x00007ffff769ba70  0x00007ffff76aa025  Yes (*)     /usr/lib/libpthread.so.0
0x00007ffff768a750  0x00007ffff768d8d0  Yes (*)     /usr/lib/librt.so.1
0x00007ffff734d920  0x00007ffff743a9e8  Yes (*)     /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/../lib/libSDL2-2.0.7.so
0x00007ffff7114320  0x00007ffff7122934  Yes (*)     /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/../lib/libSDL2_image-2.0.1.so
0x00007ffff3754e70  0x00007ffff63d95ba  Yes (*)     /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/../lib/libcef.so
0x00007ffff26458f0  0x00007ffff2dc2399  Yes (*)     /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/../lib/libpdf.so
0x00007ffff2541020  0x00007ffff255651b  Yes (*)     /usr/lib/libvorbis.so.0
0x00007ffff2475020  0x00007ffff24f926f  Yes (*)     /usr/lib/libfreetype.so.6
0x00007ffff2424020  0x00007ffff244a13e  Yes (*)     /usr/lib/libfontconfig.so.1
--Type <RET> for more, q to quit, c to continue without paging--
0x00007ffff23d5020  0x00007ffff2403203  Yes (*)     /usr/lib/libdbus-1.so.3
0x00007ffff22903b0  0x00007ffff232b658  Yes (*)     /usr/lib/libm.so.6
0x00007ffff2249420  0x00007ffff2272752  Yes         /usr/lib/libgomp.so.1
0x00007ffff209d650  0x00007ffff21e86bd  Yes (*)     /usr/lib/libc.so.6
0x00007ffff202b020  0x00007ffff2058bbc  Yes (*)     /usr/lib/libgobject-2.0.so.0
0x00007ffff1f10040  0x00007ffff1f94b92  Yes (*)     /usr/lib/libglib-2.0.so.0
0x00007ffff1ee8020  0x00007ffff1eee2a3  Yes (*)     /usr/lib/libpangocairo-1.0.so.0
0x00007ffff1dc9020  0x00007ffff1e9e2ff  Yes (*)     /usr/lib/libcairo.so.2
0x00007ffff1d74020  0x00007ffff1d9a365  Yes (*)     /usr/lib/libpango-1.0.so.0
0x00007ffff1c40020  0x00007ffff1cc97af  Yes (*)     /usr/lib/libX11.so.6
0x00007ffff1c12020  0x00007ffff1c1c989  Yes (*)     /usr/lib/libXi.so.6
0x00007ffff1af0020  0x00007ffff1bca19b  Yes (*)     /usr/lib/libnss3.so
0x00007ffff1ab1020  0x00007ffff1ac173d  Yes (*)     /usr/lib/libnssutil3.so
0x00007ffff1a83020  0x00007ffff1a98b97  Yes (*)     /usr/lib/libsmime3.so
0x00007ffff1a75020  0x00007ffff1a76773  Yes (*)     /usr/lib/libplc4.so
0x00007ffff1a3d050  0x00007ffff1a5f743  Yes (*)     /usr/lib/libnspr4.so
0x00007ffff1a2a020  0x00007ffff1a2aa55  Yes (*)     /usr/lib/libXcomposite.so.1
0x00007ffff1a18020  0x00007ffff1a2233e  Yes (*)     /usr/lib/libXext.so.6
0x00007ffff1963020  0x00007ffff19deab6  Yes (*)     /usr/lib/libasound.so.2
0x00007ffff1932020  0x00007ffff19329ab  Yes (*)     /usr/lib/libXdamage.so.1
0x00007ffff192a020  0x00007ffff192c446  Yes (*)     /usr/lib/libXfixes.so.3
--Type <RET> for more, q to quit, c to continue without paging--
0x00007ffff1922020  0x00007ffff1924a1c  Yes (*)     /usr/lib/libXtst.so.6
0x00007ffff18f5020  0x00007ffff190def6  Yes (*)     /usr/lib/libgconf-2.so.4
0x00007ffff18e2020  0x00007ffff18e6c3e  Yes (*)     /usr/lib/libXcursor.so.1
0x00007ffff18d4020  0x00007ffff18da3a3  Yes (*)     /usr/lib/libXrender.so.1
0x00007ffff18c7020  0x00007ffff18cd696  Yes (*)     /usr/lib/libXrandr.so.2
0x00007ffff1899020  0x00007ffff18b6f1a  Yes (*)     /usr/lib/libexpat.so.1
0x00007ffff1817020  0x00007ffff186b7f0  Yes (*)     /usr/lib/libcups.so.2
0x00007ffff17ef020  0x00007ffff17f20e6  Yes (*)     /usr/lib/libcap.so.2
0x00007ffff16a6040  0x00007ffff1791b52  Yes         /usr/lib/libstdc++.so.6
0x00007ffff15f9020  0x00007ffff1609ca5  Yes         /usr/lib/libgcc_s.so.1
0x00007ffff15ed020  0x00007ffff15ef3de  Yes (*)     /usr/lib/libogg.so.0
0x00007ffff15da020  0x00007ffff15e6b72  Yes (*)     /usr/lib/libbz2.so.1.0
0x00007ffff15a5020  0x00007ffff15c88da  Yes (*)     /usr/lib/libpng16.so.16
0x00007ffff14da040  0x00007ffff156a612  Yes (*)     /usr/lib/libharfbuzz.so.0
0x00007ffff142f040  0x00007ffff14a4750  Yes (*)     /usr/lib/libsystemd.so.0
0x00007ffff1413040  0x00007ffff141839e  Yes (*)     /usr/lib/libffi.so.7
0x00007ffff13a1020  0x00007ffff13f0b6d  Yes (*)     /usr/lib/libpcre.so.1
0x00007ffff138c020  0x00007ffff139593a  Yes (*)     /usr/lib/libpangoft2-1.0.so.0
0x00007ffff12e8020  0x00007ffff1369934  Yes (*)     /usr/lib/libpixman-1.so.0
0x00007ffff12d9020  0x00007ffff12d9b44  Yes (*)     /usr/lib/libxcb-shm.so.0
0x00007ffff12ba020  0x00007ffff12ccb86  Yes (*)     /usr/lib/libxcb.so.1
0x00007ffff12a4020  0x00007ffff12a8b7f  Yes (*)     /usr/lib/libxcb-render.so.0
--Type <RET> for more, q to quit, c to continue without paging--
0x00007ffff111c020  0x00007ffff1215a94  Yes (*)     /usr/lib/libgio-2.0.so.0
0x00007ffff10c9020  0x00007ffff10cd108  Yes (*)     /usr/lib/libfribidi.so.0
0x00007ffff10bc020  0x00007ffff10bfa24  Yes (*)     /usr/lib/libthai.so.0
0x00007ffff10b6020  0x00007ffff10b6d48  Yes (*)     /usr/lib/libplds4.so
0x00007ffff10b1020  0x00007ffff10b1fac  Yes (*)     /usr/lib/libgmodule-2.0.so.0
0x00007ffff1091020  0x00007ffff10a3d28  Yes (*)     /usr/lib/libdbus-glib-1.so.2
0x00007ffff103f020  0x00007ffff10765a9  Yes (*)     /usr/lib/libgssapi_krb5.so.2
0x00007ffff0f6e020  0x00007ffff0fd68b6  Yes (*)     /usr/lib/libkrb5.so.3
0x00007ffff0f1f020  0x00007ffff0f3a957  Yes (*)     /usr/lib/libk5crypto.so.3
0x00007ffff0f16020  0x00007ffff0f16c49  Yes (*)     /usr/lib/libcom_err.so.2
0x00007ffff0f09020  0x00007ffff0f0e34b  Yes (*)     /usr/lib/libavahi-common.so.3
0x00007ffff0ef6020  0x00007ffff0efe847  Yes (*)     /usr/lib/libavahi-client.so.3
0x00007ffff0d5c040  0x00007ffff0e77f54  Yes (*)     /usr/lib/libgnutls.so.30
0x00007ffff0cf2020  0x00007ffff0d03689  Yes (*)     /usr/lib/libcrypt.so.2
0x00007ffff0cce020  0x00007ffff0ce7462  Yes (*)     /usr/lib/libgraphite2.so.3
0x00007ffff0ca6020  0x00007ffff0cbce73  Yes (*)     /usr/lib/liblzma.so.5
0x00007ffff0bd6020  0x00007ffff0c8e786  Yes (*)     /usr/lib/libzstd.so.1
0x00007ffff0bb2020  0x00007ffff0bcb6a7  Yes (*)     /usr/lib/liblz4.so.1
--Type <RET> for more, q to quit, c to continue without paging--
0x00007ffff0a98040  0x00007ffff0b68eb8  Yes (*)     /usr/lib/libgcrypt.so.20
0x00007ffff0a88040  0x00007ffff0a88d52  Yes (*)     /usr/lib/libXau.so.6
0x00007ffff0a81020  0x00007ffff0a82882  Yes (*)     /usr/lib/libXdmcp.so.6
0x00007ffff0a2d040  0x00007ffff0a68c42  Yes (*)     /usr/lib/libmount.so.1
0x00007ffff0a0b710  0x00007ffff0a186fc  Yes (*)     /usr/lib/libresolv.so.2
0x00007ffff09fd020  0x00007ffff0a005a1  Yes (*)     /usr/lib/libdatrie.so.1
0x00007ffff09ef020  0x00007ffff09f5f64  Yes (*)     /usr/lib/libkrb5support.so.0
0x00007ffff09e7020  0x00007ffff09e8123  Yes (*)     /usr/lib/libkeyutils.so.1
0x00007ffff08d9040  0x00007ffff0976330  Yes (*)     /usr/lib/libp11-kit.so.0
0x00007ffff0891020  0x00007ffff0894cd5  Yes (*)     /usr/lib/libidn2.so.0
0x00007ffff071c020  0x00007ffff0750609  Yes (*)     /usr/lib/libunistring.so.2
0x00007ffff06f8020  0x00007ffff070354f  Yes (*)     /usr/lib/libtasn1.so.6
0x00007ffff06c2020  0x00007ffff06dfeef  Yes (*)     /usr/lib/libnettle.so.8
0x00007ffff0678020  0x00007ffff0689c59  Yes (*)     /usr/lib/libhogweed.so.6
0x00007ffff05df080  0x00007ffff0653271  Yes (*)     /usr/lib/libgmp.so.10
0x00007ffff05ac040  0x00007ffff05c08d2  Yes (*)     /usr/lib/libgpg-error.so.0
0x00007ffff055c040  0x00007ffff058e942  Yes (*)     /usr/lib/libblkid.so.1
0x00007fff2f560f50  0x00007fff2f67cf38  Yes (*)     /usr/lib/libnvidia-ml.so
0x00007fff3051c020  0x00007fff3051c9a3  Yes (*)     /usr/lib/libXinerama.so.1
0x00007fff30517020  0x00007fff30517cfd  Yes (*)     /usr/lib/libXss.so.1
0x00007fff30510020  0x00007fff3051282b  Yes (*)     /usr/lib/libXxf86vm.so.1
0x00007ffff7f9b040  0x00007ffff7fb2d22  Yes (*)     /usr/lib/primus/libGL.so.1
--Type <RET> for more, q to quit, c to continue without paging--
0x00007fff30498020  0x00007fff304a52f1  Yes (*)     /usr/lib/libglapi.so.0
0x00007fff2da21020  0x00007fff2da23a1d  Yes (*)     /usr/lib/libGL.so.1
0x00007fff2d968020  0x00007fff2d969f87  Yes (*)     /usr/lib/libGLdispatch.so.0
0x00007fff2d8f8020  0x00007fff2d911bb1  Yes (*)     /usr/lib/libGLX.so.0
0x00007fff2d890040  0x00007fff2d8d6a72  Yes (*)     /usr/lib/libGLX_mesa.so.0
0x00007fff3047c020  0x00007fff30485616  Yes (*)     /usr/lib/libdrm.so.2
0x00007fff2d865020  0x00007fff2d86d6a6  Yes (*)     /usr/lib/libxcb-glx.so.0
0x00007ffff7f84020  0x00007ffff7f8410b  Yes (*)     /usr/lib/libX11-xcb.so.1
0x00007fff30472020  0x00007fff304731a6  Yes (*)     /usr/lib/libxcb-dri2.so.0
0x00007fff3046c020  0x00007fff3046ce34  Yes (*)     /usr/lib/libxcb-dri3.so.0
0x00007fff30466020  0x00007fff304668a6  Yes (*)     /usr/lib/libxcb-present.so.0
0x00007fff2d852020  0x00007fff2d8541b2  Yes (*)     /usr/lib/libxcb-sync.so.1
0x00007fff30461020  0x00007fff304612ec  Yes (*)     /usr/lib/libxshmfence.so.1
0x00007fff2cb12040  0x00007fff2d3b42d2  Yes (*)     /usr/lib/dri/i965_dri.so
0x00007fff2ca11020  0x00007fff2ca27a45  Yes (*)     /usr/lib/libdrm_intel.so.1
0x00007fff2ca01020  0x00007fff2ca07975  Yes (*)     /usr/lib/libdrm_radeon.so.1
0x00007fff2c9f7020  0x00007fff2c9fac37  Yes (*)     /usr/lib/libdrm_nouveau.so.2
0x00007fff2c9ec020  0x00007fff2c9f0593  Yes (*)     /usr/lib/libpciaccess.so.0
0x00007fff2c9d8550  0x00007fff2c9de17c  Yes (*)     /usr/lib/libnss_files.so.2
0x00007fff27d34ab0  0x00007fff27d95c4f  Yes (*)     /usr/lib/libGLX_nvidia.so.0
0x00007fff259959a0  0x00007fff25997673  Yes (*)     /usr/lib/libnvidia-tls.so.43--Type <RET> for more, q to quit, c to continue without paging--
0.64
0x00007fff065a4110  0x00007fff07594877  Yes (*)     /usr/lib/libnvidia-glcore.so.430.64
0x00007fff27bbe020  0x00007fff27bbf287  Yes (*)     /usr/lib/libpulse-simple.so.0
0x00007fff25683020  0x00007fff256b11b0  Yes (*)     /usr/lib/libpulse.so.0
0x00007fff25606040  0x00007fff2564b402  Yes (*)     /usr/lib/pulseaudio/libpulsecommon-13.0.so
0x00007fff2557d020  0x00007fff255ce358  Yes (*)     /usr/lib/libsndfile.so.1
0x00007fff27bb6020  0x00007fff27bb867a  Yes (*)     /usr/lib/libasyncns.so.0
0x00007fff25540020  0x00007fff2556879b  Yes (*)     /usr/lib/libFLAC.so.8
0x00007fff254a0020  0x00007fff254a2677  Yes (*)     /usr/lib/libvorbisenc.so.2
0x00007ffef4739900  0x00007ffef591ee7f  Yes (*)     /home/zimudec/.local/share/Steam/linux64/steamclient.so
0x00007fff244e6030  0x00007fff24525bdf  Yes (*)     /home/zimudec/.local/share/Steam/linux64/crashhandler.so
0x00007fff27baf020  0x00007fff27bb048e  Yes (*)     /usr/lib/libnss_mdns_minimal.so.2
0x00007fff27ba7310  0x00007fff27baa312  Yes (*)     /usr/lib/libnss_dns.so.2
0x00007fff2446e040  0x00007fff24484fe0  Yes (*)     /usr/lib/libudev.so.1
0x00007fff2431f020  0x00007fff243508c9  Yes (*)     /usr/lib/libvulkan.so.1
0x00007fff27ba1020  0x00007fff27ba16b8  Yes (*)     /usr/lib/libnv_vulkan_wrapper.so.1
--Type <RET> for more, q to quit, c to continue without paging--
0x00007ffee6841040  0x00007ffee6ccec12  Yes (*)     /usr/lib/libvulkan_intel.so
0x00007fff242ff020  0x00007fff24303e10  Yes (*)     /usr/lib/libwayland-client.so.0
0x00007fff242ee020  0x00007fff242f2c41  Yes (*)     /usr/lib/libxcb-randr.so.0
0x00007fff242c0020  0x00007fff242db253  Yes (*)     /usr/lib/libpng12.so.0
0x00007fff244be700  0x00007fff244cfd6a  Yes (*)     /home/zimudec/.local/share/Steam/ubuntu12_64/steamoverlayvulkanlayer.so
0x00007fff256ce020  0x00007fff256cfe7c  Yes         /usr/lib/libVkLayer_MESA_device_select.so
0x00007fff244a6020  0x00007fff244b512f  Yes (*)     /usr/lib/libprimus_vk.so.1
0x00007ffee58113e0  0x00007ffee618eff4  Yes (*)     /usr/lib/libnvidia-glvkspirv.so.430.64
0x00007fff24012a20  0x00007fff24048bd8  Yes (*)     /usr/lib/libnvidia-cbl.so.430.64
0x00007ffef420fbe0  0x00007ffef423f748  Yes (*)     /usr/lib/libnvidia-fatbinaryloader.so.430.64
(*): Shared library is missing debugging information.
(gdb)

@felixdoerre
Copy link
Owner

felixdoerre commented Oct 20, 2020

Thanks for the gdb output. I believe this confirms the theory that at least one ICD is not returning GetPhysicalDeviceProperties2, so that it is null, when the loader tries to invoke it. I've checked and my mesa does return null for this function. So
fpGetPhysicalDeviceProperties2 is null here:
https://github.com/KhronosGroup/Vulkan-Loader/blob/921ca6d992fca347396ee153bf1820a9f3b8d478/loader/loader.c#L7975

I believe this is mesa's fault, as in this case mesa is not compatible with vulkan 1.1. Vulkan ICDs compatible with Vulkan 1.1 need to implement vkGetPhysicalDeviceProperties2 and not "just" vkGetPhysicalDeviceProperties2KHR. This fix should not be required for what we are observing here, however I will probably "solve" the issue and it would be good in general to fix this behavior in mesa.

However there is still something that I don't understand: the mesa device select layer has to see that the extension VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME is enabled (otherwise it wouldn't try to call vkGetPhysicalDeviceProperties2KHR) and the loader has to see this extension disabled (otherwise it would not try to call the null-function). By the way: what is your vulkan-loader version?

So next gdb, let's validate the theory that the vulkan-loader thinks the extension is disabled. The memory-addresses I see from your output seem stable, so assuming that you didn't recompile anything, I can just specify literal addresses which seems easier to me. If the addresses changed, you would need to update the address in the commands accordingly.

b fill_drm_device_info
y
r
b *0x7fff24321c5e
c
p/x $rdi
x/b 0x3f78 + $rdi

EDIT:
... maybe I was confused, with when which functions should work, but looking at it again seems mesa behaves correctly. It depends on the requested extension/vulkan versions which functions mesa exposes. If the application requests vulkan 1.0 without the extension, both are not available, if the application requests vulkan 1.1, the non-KHR-variant is (only) available. If the application additionally requests the extension, in both cases the KHR-variant becomes available.

So it would be nice, if you run also this, so we can check which functions mesa returns on your system, with the extensions/api version requested by the game:

b anv_GetInstanceProcAddr if _instance != 0
y
r
p instance->physical_device_dispatch.entrypoints[anv_get_physical_device_entrypoint_index("vkGetPhysicalDeviceProperties2KHR")]
p instance->physical_device_dispatch.entrypoints[anv_get_physical_device_entrypoint_index("vkGetPhysicalDeviceProperties2")]

@zimudec
Copy link
Author

zimudec commented Oct 21, 2020

However there is still something that I don't understand: the mesa device select layer has to see that the extension VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME is enabled (otherwise it wouldn't try to call vkGetPhysicalDeviceProperties2KHR) and the loader has to see this extension disabled (otherwise it would not try to call the null-function). By the way: what is your vulkan-loader version?

I have the following version installed, both in 64 and 32 bits: vulkan-icd-loader 1.2.151-1

I don't know if it is related, but I have the following content in the file /usr/share/vulkan/icd.d/nv_vulkan_wrapper.json:

{
    "file_format_version" : "1.0.0",
    "ICD": {
        "library_path": "libnv_vulkan_wrapper.so.1",
        "api_version" : "1.1.84"
    }
}

So next gdb, let's validate the theory that the vulkan-loader thinks the extension is disabled. The memory-addresses I see from your output seem stable, so assuming that you didn't recompile anything, I can just specify literal addresses which seems easier to me. If the addresses changed, you would need to update the address in the commands accordingly.

b fill_drm_device_info
y
r
b *0x7fff24321c5e
c
p/x $rdi
x/b 0x3f78 + $rdi

This right?:

[zimudec@zimudec Rise of the Tomb Raider]$ STEAM_RUNTIME=0 GAME_LAUNCH_PREFIX="gdb --args" pvkrun ./RiseOfTheTombRaider.sh
WARNING: Rise of the Tomb Raider launched with STEAM_RUNTIME=0
         We recommend using the steam runtime if possible
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
PrimusVK: Searching for display GPU:
PrimusVK: 0x218b240: 
PrimusVK: Got integrated gpu!
PrimusVK: Device: Intel(R) HD Graphics 4000 (IVB GT2)
PrimusVK:   Type: 1
PrimusVK: Searching for render GPU:
PrimusVK: 0x218b240.
PrimusVK: 0x2171340.
PrimusVK: Got discrete gpu!
PrimusVK: Device: GeForce GT 740M
PrimusVK:   Type: 2
GNU gdb (GDB) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider...
(No debugging symbols found in /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider)
(gdb) b fill_drm_device_info
Function "fill_drm_device_info" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (fill_drm_device_info) pending.
(gdb) r
Starting program: /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
RiseOfTheTombRaider: crash reporter initialised with path "/home/zimudec/.local/share/feral-interactive/Rise of the Tomb Raider/crashes"
[New Thread 0x7fff3039d640 (LWP 1987)]
[New Thread 0x7fff27fff640 (LWP 1988)]
[New Thread 0x7fff2f54e640 (LWP 1989)]
[New Thread 0x7fff2ed4d640 (LWP 1990)]
[New Thread 0x7fff2e54c640 (LWP 1991)]
[New Thread 0x7fff2c893640 (LWP 2008)]
[New Thread 0x7fff277fe640 (LWP 2009)]
[New Thread 0x7fff26ffd640 (LWP 2010)]
[New Thread 0x7fff267fc640 (LWP 2011)]
[New Thread 0x7fff2573a640 (LWP 2012)]
SDL2 initialised [built against 2.0.7, running with 2.0.7]
[Detaching after fork from child process 2013]
[New Thread 0x7fff2506f640 (LWP 2014)]
[S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed.
[S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.
[Detaching after fork from child process 2015]
[Thread 0x7fff2506f640 (LWP 2014) exited]
Setting breakpad minidump AppID = 391220
Steam_SetMinidumpSteamID:  Caching Steam ID:  76561198008468660 [API loaded no]
[New Thread 0x7fff2486e640 (LWP 2212)]
[S_API WARN] The loaded overlay DLL doesn't support ValveHookScreenshots
[S_API WARN] The loaded overlay DLL doesn't support ValveHookScreenshots
[New Thread 0x7fff2506f640 (LWP 2213)]
[New Thread 0x7ffee7fff640 (LWP 2214)]
[New Thread 0x7ffee77fe640 (LWP 2217)]
[New Thread 0x7ffee6ffd640 (LWP 2218)]
[Thread 0x7ffee7fff640 (LWP 2214) exited]
[New Thread 0x7fff24477640 (LWP 2219)]
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
[New Thread 0x7ffee7fff640 (LWP 2227)]
[New Thread 0x7ffee4f9e640 (LWP 2228)]
[New Thread 0x7ffecbfff640 (LWP 2229)]
[New Thread 0x7ffecb7fe640 (LWP 2230)]
--Type <RET> for more, q to quit, c to continue without paging--

Thread 1 "RiseOfTheTombRa" hit Breakpoint 1, fill_drm_device_info (
    info=info@entry=0x7536050, drm_device=drm_device@entry=0x750f040, 
    device=0x737eab0)
    at ../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c:237
237	../mesa-20.1.7/src/vulkan/device-select-layer/device_select_layer.c: No existe el fichero o el directorio.
(gdb) x/50i info->GetPhysicalDeviceProperties2KHR
   0x7fff2432fc30:	push   %r12
   0x7fff2432fc32:	push   %rbp
   0x7fff2432fc33:	mov    %rsi,%rbp
   0x7fff2432fc36:	push   %rbx
   0x7fff2432fc37:	mov    0x8(%rdi),%r12
   0x7fff2432fc3b:	mov    %rdi,%rbx
   0x7fff2432fc3e:	mov    0x8(%r12),%rdi
   0x7fff2432fc43:	test   %rdi,%rdi
   0x7fff2432fc46:	je     0x7fff2432fc70
   0x7fff2432fc48:	testb  $0x1,0x3f78(%rdi)
   0x7fff2432fc4f:	je     0x7fff2432fc70
   0x7fff2432fc51:	mov    0x1b0(%r12),%rax
   0x7fff2432fc59:	test   %rax,%rax
   0x7fff2432fc5c:	je     0x7fff2432fc90
   0x7fff2432fc5e:	mov    0x18(%rbx),%rdi
   0x7fff2432fc62:	mov    %rbp,%rsi
   0x7fff2432fc65:	pop    %rbx
   0x7fff2432fc66:	pop    %rbp
   0x7fff2432fc67:	pop    %r12
   0x7fff2432fc69:	jmpq   *%rax
   0x7fff2432fc6b:	nopl   0x0(%rax,%rax,1)
   0x7fff2432fc70:	mov    0xb0(%r12),%rax
   0x7fff2432fc78:	test   %rax,%rax
--Type <RET> for more, q to quit, c to continue without paging--
   0x7fff2432fc7b:	jne    0x7fff2432fc5e
   0x7fff2432fc7d:	testb  $0x1,0x3f78(%rdi)
   0x7fff2432fc84:	je     0x7fff2432fc5e
   0x7fff2432fc86:	nopw   %cs:0x0(%rax,%rax,1)
   0x7fff2432fc90:	mov    (%r12),%rax
   0x7fff2432fc94:	lea    0x31e15(%rip),%rcx        # 0x7fff24361ab0
   0x7fff2432fc9b:	xor    %edx,%edx
   0x7fff2432fc9d:	mov    $0x1,%esi
   0x7fff2432fca2:	mov    (%rax),%r8
   0x7fff2432fca5:	xor    %eax,%eax
   0x7fff2432fca7:	callq  0x7fff2432f900
   0x7fff2432fcac:	mov    0x18(%rbx),%rdi
   0x7fff2432fcb0:	lea    0x10(%rbp),%rsi
   0x7fff2432fcb4:	callq  *0x50(%r12)
   0x7fff2432fcb9:	mov    0x8(%rbp),%rbx
   0x7fff2432fcbd:	lea    0x31edc(%rip),%rbp        # 0x7fff24361ba0
   0x7fff2432fcc4:	jmp    0x7fff2432fcdd
   0x7fff2432fcc6:	nopw   %cs:0x0(%rax,%rax,1)
   0x7fff2432fcd0:	testb  $0x4,0x3f78(%rdi)
   0x7fff2432fcd7:	jne    0x7fff2432fd08
   0x7fff2432fcd9:	mov    0x8(%rbx),%rbx
   0x7fff2432fcdd:	test   %rbx,%rbx
   0x7fff2432fce0:	je     0x7fff2432fd38
--Type <RET> for more, q to quit, c to continue without paging--
   0x7fff2432fce2:	cmpl   $0x3b9bdf5c,(%rbx)
   0x7fff2432fce8:	mov    0x8(%r12),%rdi
   0x7fff2432fced:	je     0x7fff2432fcd0
   0x7fff2432fcef:	mov    %rbp,%rcx
(gdb) b *0x7fff2432fc5e
Breakpoint 2 at 0x7fff2432fc5e
(gdb) c
Continuing.
[New Thread 0x7ffecaffd640 (LWP 2415)]

Thread 1 "RiseOfTheTombRa" hit Breakpoint 2, 0x00007fff2432fc5e in ?? ()
   from /usr/lib/libvulkan.so.1
(gdb) p/x $rdi
$1 = 0x7540e00
(gdb) x/b 0x3f78 + $rdi
0x7544d78:	0x00
(gdb)

... maybe I was confused, with when which functions should work, but looking at it again seems mesa behaves correctly. It depends on the requested extension/vulkan versions which functions mesa exposes. If the application requests vulkan 1.0 without the extension, both are not available, if the application requests vulkan 1.1, the non-KHR-variant is (only) available. If the application additionally requests the extension, in both cases the KHR-variant becomes available.

So it would be nice, if you run also this, so we can check which functions mesa returns on your system, with the extensions/api version requested by the game:

b anv_GetInstanceProcAddr if _instance != 0
y
r
p instance->physical_device_dispatch.entrypoints[anv_get_physical_device_entrypoint_index("vkGetPhysicalDeviceProperties2KHR")]
p instance->physical_device_dispatch.entrypoints[anv_get_physical_device_entrypoint_index("vkGetPhysicalDeviceProperties2")]
[zimudec@zimudec Rise of the Tomb Raider]$ STEAM_RUNTIME=0 GAME_LAUNCH_PREFIX="gdb --args" pvkrun ./RiseOfTheTombRaider.sh
WARNING: Rise of the Tomb Raider launched with STEAM_RUNTIME=0
         We recommend using the steam runtime if possible
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
PrimusVK: Searching for display GPU:
PrimusVK: 0x14db240: 
PrimusVK: Got integrated gpu!
PrimusVK: Device: Intel(R) HD Graphics 4000 (IVB GT2)
PrimusVK:   Type: 1
PrimusVK: Searching for render GPU:
PrimusVK: 0x14db240.
PrimusVK: 0x130ee00.
PrimusVK: Got discrete gpu!
PrimusVK: Device: GeForce GT 740M
PrimusVK:   Type: 2
GNU gdb (GDB) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider...
(No debugging symbols found in /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider)
(gdb) b anv_GetInstanceProcAddr if _instance != 0
Function "anv_GetInstanceProcAddr" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (anv_GetInstanceProcAddr if _instance != 0) pending.
(gdb) r
Starting program: /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
RiseOfTheTombRaider: crash reporter initialised with path "/home/zimudec/.local/share/feral-interactive/Rise of the Tomb Raider/crashes"
[New Thread 0x7fff3039d640 (LWP 2539)]
[New Thread 0x7fff27fff640 (LWP 2540)]
[New Thread 0x7fff2f54e640 (LWP 2541)]
[New Thread 0x7fff2ed4d640 (LWP 2542)]
[New Thread 0x7fff2e54c640 (LWP 2543)]
[New Thread 0x7fff2c893640 (LWP 2560)]
[New Thread 0x7fff277fe640 (LWP 2561)]
[New Thread 0x7fff26ffd640 (LWP 2562)]
[New Thread 0x7fff267fc640 (LWP 2563)]
[New Thread 0x7fff2573a640 (LWP 2564)]
SDL2 initialised [built against 2.0.7, running with 2.0.7]
[Detaching after fork from child process 2565]
[New Thread 0x7fff2506f640 (LWP 2566)]
[S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed.
[S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.
[Detaching after fork from child process 2567]
Setting breakpad minidump AppID = 391220
Steam_SetMinidumpSteamID:  Caching Steam ID:  76561198008468660 [API loaded no]
[New Thread 0x7fff2486e640 (LWP 2755)]
[S_API WARN] The loaded overlay DLL doesn't support ValveHookScreenshots
[S_API WARN] The loaded overlay DLL doesn't support ValveHookScreenshots
[New Thread 0x7ffee7fff640 (LWP 2756)]
[New Thread 0x7ffee77fe640 (LWP 2757)]
[New Thread 0x7ffee6ffd640 (LWP 2758)]
[New Thread 0x7fff24477640 (LWP 2759)]
[New Thread 0x7ffee67fc640 (LWP 2760)]
[New Thread 0x7ffee5ffb640 (LWP 2761)]
[Thread 0x7ffee77fe640 (LWP 2757) exited]
[Thread 0x7ffee67fc640 (LWP 2760) exited]
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
[New Thread 0x7ffee67fc640 (LWP 2768)]
[New Thread 0x7ffee77fe640 (LWP 2769)]
[New Thread 0x7ffee4f86640 (LWP 2770)]
[New Thread 0x7ffecb015640 (LWP 2771)]
--Type <RET> for more, q to quit, c to continue without paging--

Thread 1 "RiseOfTheTombRa" received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) p instance->physical_device_dispatch.entrypoints[anv_get_physical_device_entrypoint_index("vkGetPhysicalDeviceProperties2KHR")]
No symbol "instance" in current context.
(gdb) p instance->physical_device_dispatch.entrypoints[anv_get_physical_device_entrypoint_index("vkGetPhysicalDeviceProperties2")]
No symbol "instance" in current context.
(gdb)

@felixdoerre
Copy link
Owner

Thanks for the gdb output. I believe I was able to reproduce the problem locally. The problem occurs when the mesa layer is inserted "below" primus-vk. On my system it was always inserted above primus-vk, so I didn't experience any problems. I forced the layer ordering and could reproduce the segfault.

Short story what is happens (with annotations about what happens with the fix):

  • When a Vulkan Instance is created, the application first calls the loader's VkCreateInstance function, enabling the extension in question
    • primus_vk's CreateInstance is invoked
      • mesa_device_select's CreateInstance is invoked, and recognizes the enabled extension
        • the call reaches the loader again in terminator_CreateInstance
          • The loader forwards this call to the drivers
    • primus_vk want to detect devices and calls EnumeratePhysicalDevices
      • mesa_device_select takes over this call and searches for the correct devices, trying to invoke GetPhysicalDeviceProperties2KHR (as it has seen that the extension is enabled)
        • the loader crashes, as it does not have the extension enabled yet
    • primus_vk would finish its CreateInstance method
  • the loader would countinue vkCreateInstance and enable the extension here
  • the application would call EnumeratePhysicalDevices
    • ( with the fix, primus_vk detects devices here, where the extension in the loader is enabled )
    • primus_vk would only return the dedicated GPU

Could you please try out the fix, I have pushed here: https://github.com/felixdoerre/primus_vk/tree/mesa_layer_fix ?

@zimudec
Copy link
Author

zimudec commented Oct 21, 2020

Thanks for the gdb output. I believe I was able to reproduce the problem locally. The problem occurs when the mesa layer is inserted "below" primus-vk. On my system it was always inserted above primus-vk, so I didn't experience any problems. I forced the layer ordering and could reproduce the segfault.

Short story what is happens (with annotations about what happens with the fix):

  • When a Vulkan Instance is created, the application first calls the loader's VkCreateInstance function, enabling the extension in question

    • primus_vk's CreateInstance is invoked

      • mesa_device_select's CreateInstance is invoked, and recognizes the enabled extension

        • the call reaches the loader again in terminator_CreateInstance

          • The loader forwards this call to the drivers
    • primus_vk want to detect devices and calls EnumeratePhysicalDevices

      • mesa_device_select takes over this call and searches for the correct devices, trying to invoke GetPhysicalDeviceProperties2KHR (as it has seen that the extension is enabled)

        • the loader crashes, as it does not have the extension enabled yet
    • primus_vk would finish its CreateInstance method

  • the loader would countinue vkCreateInstance and enable the extension here

  • the application would call EnumeratePhysicalDevices

    • ( with the fix, primus_vk detects devices here, where the extension in the loader is enabled )
    • primus_vk would only return the dedicated GPU

Could you please try out the fix, I have pushed here: https://github.com/felixdoerre/primus_vk/tree/mesa_layer_fix ?

Great! how can i test this fix? primus I installed it (and install or update it) normally by pacman. The current version I have of pacman is: primus_vk 1.5-1

Should I download that version and compile to install the modified package like I did with mesa?

Why in your system are the layers loaded in a different order from mine?

@felixdoerre
Copy link
Owner

The layers are loaded in the order the the filesystem lists the corresponding json files. So this could be anything, from the order we installed packages in to filesystems structuring the on-disk layout of the directory contents differently.

Great! how can i test this fix?

I'd suggest the "quick and dirty" way: just clone this repository and checkout the corresponding branch, run make and copy libprimus_vk.so.1 to its system-wide place. (Probably /usr/lib/x86_64-linux-gnu/libprimus_vk.so.1). If you want to use the fix also for 32-bit application you would need to compile it for 32-bit as well.

If you really want a package I guess you could download https://github.com/archlinux/svntogit-community/blob/packages/primus_vk/trunk/PKGBUILD and adjust the versions/hashes in that file, but I don't really know how arch packaging works so I will probably only be of little help. The difference between this package and the mesa package, is that you want to really change the contents of the package and not just the configuration options, so it might be more difficult.

@zimudec
Copy link
Author

zimudec commented Oct 21, 2020

The layers are loaded in the order the the filesystem lists the corresponding json files. So this could be anything, from the order we installed packages in to filesystems structuring the on-disk layout of the directory contents differently.

Great! how can i test this fix?

I'd suggest the "quick and dirty" way: just clone this repository and checkout the corresponding branch, run make and copy libprimus_vk.so.1 to its system-wide place. (Probably /usr/lib/x86_64-linux-gnu/libprimus_vk.so.1). If you want to use the fix also for 32-bit application you would need to compile it for 32-bit as well.

If you really want a package I guess you could download https://github.com/archlinux/svntogit-community/blob/packages/primus_vk/trunk/PKGBUILD and adjust the versions/hashes in that file, but I don't really know how arch packaging works so I will probably only be of little help. The difference between this package and the mesa package, is that you want to really change the contents of the package and not just the configuration options, so it might be more difficult.

I downloaded the zip from the url, entered and ran by terminal make, and it returned the following:

[zimudec@zimudec primus_vk-mesa_layer_fix]$ make
g++  --std=gnu++11 -g3 -I/usr/include/vulkan -shared -fPIC primus_vk.cpp -o libprimus_vk.so -Wl,-soname,libprimus_vk.so.1 -ldl -lpthread 
primus_vk.cpp:4:10: error fatal: vulkan.h: The file or directory does not exist
    4 | #include "vulkan.h"
      |          ^~~~~~~~~~
compilation finished.
make: *** [Makefile:19: libprimus_vk.so] Error 1

I installed some vulkan libraries for developers, and was able to compile. Now I do the tests.

EDIT:

When compiling it generated the file libprimus_vk.so instead of the mentioned libprimus_vk.so.1

How I should proceed?

@felixdoerre
Copy link
Owner

felixdoerre commented Oct 22, 2020

That's ok, copy libprimus_vk.so over /usr/lib/x86_64-linux-gnu/libprimus_vk.so.1. (The numbers behind those .so-files are just for versioning, so if primus_vk would introduce a "breaking change" you could have primus_vk version 1 and primus_vk version 2 installed at the same time)

@zimudec
Copy link
Author

zimudec commented Oct 22, 2020

That's ok, copy libprimus_vk.so over /usr/lib/x86_64-linux-gnu/libprimus_vk.so.1. (The numbers behind those .so-files are just for versioning, so if primus_vk would introduce a "breaking change" you could have primus_vk version 1 and primus_vk version 2 installed at the same time)

haha I'm learning a lot here.

I copied the compiled file to /usr/lib/libprimus_vk.so.1

I ran the game command again, and it threw me the following:

[zimudec@zimudec Rise of the Tomb Raider]$ STEAM_RUNTIME=0 GAME_LAUNCH_PREFIX="gdb --args" pvkrun ./RiseOfTheTombRaider.sh
WARNING: Rise of the Tomb Raider launched with STEAM_RUNTIME=0
         We recommend using the steam runtime if possible
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
PrimusVK: Searching for display GPU:
PrimusVK: 0x1fd1700: 
PrimusVK: Got integrated gpu!
PrimusVK: Device: Intel(R) HD Graphics 4000 (IVB GT2)
PrimusVK:   Type: 1
PrimusVK: Searching for render GPU:
PrimusVK: 0x1fd1700.
PrimusVK: 0x1fb7800.
PrimusVK: Got discrete gpu!
PrimusVK: Device: GeForce GT 740M
PrimusVK:   Type: 2
GNU gdb (GDB) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider...
(No debugging symbols found in /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider)
(gdb) r
Starting program: /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
RiseOfTheTombRaider: crash reporter initialised with path "/home/zimudec/.local/share/feral-interactive/Rise of the Tomb Raider/crashes"
[New Thread 0x7fff3039c640 (LWP 2367)]
[New Thread 0x7fff27b9b640 (LWP 2368)]
[New Thread 0x7fff2f54d640 (LWP 2369)]
[New Thread 0x7fff2ed4c640 (LWP 2370)]
[New Thread 0x7fff2e54b640 (LWP 2371)]
[New Thread 0x7fff2c892640 (LWP 2372)]
[New Thread 0x7fff2739a640 (LWP 2373)]
[New Thread 0x7fff26b99640 (LWP 2374)]
[New Thread 0x7fff26398640 (LWP 2375)]
[New Thread 0x7fff25713640 (LWP 2376)]
SDL2 initialised [built against 2.0.7, running with 2.0.7]
[Detaching after fork from child process 2377]
[New Thread 0x7fff25056640 (LWP 2378)]
Setting breakpad minidump AppID = 391220
Steam_SetMinidumpSteamID:  Caching Steam ID:  76561198008468660 [API loaded no]
[New Thread 0x7fff24855640 (LWP 2379)]
[S_API WARN] The loaded overlay DLL doesn't support ValveHookScreenshots
[S_API WARN] The loaded overlay DLL doesn't support ValveHookScreenshots
[New Thread 0x7ffee7fff640 (LWP 2380)]
[New Thread 0x7ffee77fe640 (LWP 2381)]
[Thread 0x7ffee77fe640 (LWP 2381) exited]
[New Thread 0x7ffee77fe640 (LWP 2382)]
[New Thread 0x7fff24466640 (LWP 2383)]
[New Thread 0x7ffee6ffd640 (LWP 2384)]
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
[New Thread 0x7ffee4d50640 (LWP 2386)]
[New Thread 0x7ffecffff640 (LWP 2387)]
[New Thread 0x7ffecf7fe640 (LWP 2388)]
[New Thread 0x7ffeceffd640 (LWP 2389)]
PrimusVK: Searching for display GPU:
PrimusVK: 0x6e50fd0: 
PrimusVK: Got integrated gpu!
PrimusVK: Device: Intel(R) HD Graphics 4000 (IVB GT2)
PrimusVK:   Type: 1
PrimusVK: Searching for render GPU:
PrimusVK: 0x6e50fd0.
PrimusVK: 0x74cc210.
PrimusVK: Got discrete gpu!
PrimusVK: Device: GeForce GT 740M
PrimusVK:   Type: 2
free(): invalid pointer
--Type <RET> for more, q to quit, c to continue without paging--

Thread 1 "RiseOfTheTombRa" received signal SIGABRT, Aborted.
0x00007ffff20b3615 in raise () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff20b3615 in raise () at /usr/lib/libc.so.6
#1  0x00007ffff209c862 in abort () at /usr/lib/libc.so.6
#2  0x00007ffff20f55e8 in __libc_message () at /usr/lib/libc.so.6
#3  0x00007ffff20fd27a in  () at /usr/lib/libc.so.6
#4  0x00007ffff20fe64c in _int_free () at /usr/lib/libc.so.6
#5  0x00007fff243384c6 in  () at /usr/lib/libvulkan.so.1
#6  0x00007fff2433ad38 in vkEnumeratePhysicalDevices ()
    at /usr/lib/libvulkan.so.1
#7  0x00000000019b315e in  ()
#8  0x00000000019b3868 in  ()
#9  0x00000000018f9844 in  ()
#10 0x00000000018f9c48 in  ()
#11 0x000000000047ef62 in  ()
#12 0x00000000004935f1 in  ()
#13 0x00000000004939ad in  ()
#14 0x00000000004aad61 in  ()
#15 0x00000000004aa281 in  ()
#16 0x000000000041d939 in  ()
#17 0x00007ffff209e152 in __libc_start_main () at /usr/lib/libc.so.6
#18 0x000000000046c3a1 in  ()
#19 0x00007fffffffe108 in  ()
#20 0x000000000000001c in  ()
#21 0x0000000000000001 in  ()
--Type <RET> for more, q to quit, c to continue without paging--
#22 0x00007fffffffe3e1 in  ()
#23 0x0000000000000000 in  ()
(gdb) c
Continuing.
[Thread 0x7fff25056640 (LWP 2378) exited]

Thread 1 "RiseOfTheTombRa" received signal SIGABRT, Aborted.
0x00007ffff20b3615 in raise () from /usr/lib/libc.so.6
(gdb) c
Continuing.
[Thread 0x7ffee6ffd640 (LWP 2384) exited]
RiseOfTheTombRaider: crash reporter failed

Thread 1 "RiseOfTheTombRa" received signal SIGABRT, Aborted.
0x00007ffff20b3615 in raise () from /usr/lib/libc.so.6
(gdb) c
Continuing.
Couldn't get registers: No existe el proceso.
Couldn't get registers: No existe el proceso.
(gdb) [Thread 0x7ffeceffd640 (LWP 2389) exited]
[Thread 0x7ffecf7fe640 (LWP 2388) exited]
[Thread 0x7ffecffff640 (LWP 2387) exited]
[Thread 0x7ffee4d50640 (LWP 2386) exited]
[Thread 0x7fff24466640 (LWP 2383) exited]
[Thread 0x7ffee77fe640 (LWP 2382) exited]
[Thread 0x7ffee7fff640 (LWP 2380) exited]
[Thread 0x7fff24855640 (LWP 2379) exited]
[Thread 0x7fff25713640 (LWP 2376) exited]
[Thread 0x7fff26398640 (LWP 2375) exited]
[Thread 0x7fff26b99640 (LWP 2374) exited]
[Thread 0x7fff2739a640 (LWP 2373) exited]
[Thread 0x7fff2c892640 (LWP 2372) exited]
[Thread 0x7fff2e54b640 (LWP 2371) exited]
[Thread 0x7fff2ed4c640 (LWP 2370) exited]
[Thread 0x7fff2f54d640 (LWP 2369) exited]
[Thread 0x7fff27b9b640 (LWP 2368) exited]
[Thread 0x7fff3039c640 (LWP 2367) exited]

Program terminated with signal SIGABRT, Aborted.
The program no longer exists.

The launcher did not start

@felixdoerre
Copy link
Owner

I don't really understand what goes wrong here. Probably we will need line numbers/debug symbols in libvulkan, to understand better why here an invalid call to free happens. So could you please choose the corresponding version for libvulkan from here: https://github.com/archlinux/svntogit-packages/commits/packages/vulkan-icd-loader/trunk and compile your vulkan-loader with debug symbols?

@zimudec
Copy link
Author

zimudec commented Oct 30, 2020

I did the following:

1- I downloaded the same version that I have installed
2- I added options=(debug !strip) to the beginning of the PKGBUILD file
3- I ran makepkg to compile
4- I installed the compiled package

I ran the command to test tomb rider and I have the following:

[zimudec@zimudec Rise of the Tomb Raider]$ STEAM_RUNTIME=0 GAME_LAUNCH_PREFIX="gdb --args" pvkrun ./RiseOfTheTombRaider.sh
WARNING: Rise of the Tomb Raider launched with STEAM_RUNTIME=0
         We recommend using the steam runtime if possible
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
PrimusVK: Searching for display GPU:
PrimusVK: 0x16e9700: 
PrimusVK: Got integrated gpu!
PrimusVK: Device: Intel(R) HD Graphics 4000 (IVB GT2)
PrimusVK:   Type: 1
PrimusVK: Searching for render GPU:
PrimusVK: 0x16e9700.
PrimusVK: 0x16cea60.
PrimusVK: Got discrete gpu!
PrimusVK: Device: GeForce GT 740M
PrimusVK:   Type: 2
GNU gdb (GDB) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider...
(No debugging symbols found in /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider)
(gdb) run
Starting program: /home/zimudec/.local/share/Steam/steamapps/common/Rise of the Tomb Raider/bin/RiseOfTheTombRaider 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
RiseOfTheTombRaider: crash reporter initialised with path "/home/zimudec/.local/share/feral-interactive/Rise of the Tomb Raider/crashes"
[New Thread 0x7fff3039c640 (LWP 1651)]
[New Thread 0x7fff27b9b640 (LWP 1652)]
[New Thread 0x7fff2f54d640 (LWP 1653)]
[New Thread 0x7fff2ed4c640 (LWP 1654)]
[New Thread 0x7fff2e54b640 (LWP 1655)]
[New Thread 0x7fff2c892640 (LWP 1686)]
[New Thread 0x7fff2739a640 (LWP 1687)]
[New Thread 0x7fff26b99640 (LWP 1688)]
[New Thread 0x7fff26398640 (LWP 1689)]
[New Thread 0x7fff25713640 (LWP 1690)]
SDL2 initialised [built against 2.0.7, running with 2.0.7]
[Detaching after fork from child process 1692]
[New Thread 0x7fff25056640 (LWP 1705)]
[S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed.
[S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.
[Detaching after fork from child process 1706]
[Thread 0x7fff25056640 (LWP 1705) exited]
Setting breakpad minidump AppID = 391220
Steam_SetMinidumpSteamID:  Caching Steam ID:  76561198008468660 [API loaded no]
[New Thread 0x7fff24855640 (LWP 2020)]
[S_API WARN] The loaded overlay DLL doesn't support ValveHookScreenshots
[S_API WARN] The loaded overlay DLL doesn't support ValveHookScreenshots
[New Thread 0x7fff25056640 (LWP 2021)]
[New Thread 0x7ffee7fff640 (LWP 2022)]
[New Thread 0x7ffee77fe640 (LWP 2023)]
[New Thread 0x7ffee6ffd640 (LWP 2024)]
[New Thread 0x7fff24466640 (LWP 2025)]
[New Thread 0x7ffee67fc640 (LWP 2026)]
[Thread 0x7ffee7fff640 (LWP 2022) exited]
[Thread 0x7ffee67fc640 (LWP 2026) exited]
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
[New Thread 0x7ffee67fc640 (LWP 2047)]
[New Thread 0x7ffee7fff640 (LWP 2048)]
[New Thread 0x7ffecbfff640 (LWP 2049)]
[New Thread 0x7ffec3fff640 (LWP 2050)]
PrimusVK: Searching for display GPU:
PrimusVK: 0x71a0fd0: 
PrimusVK: Got integrated gpu!
PrimusVK: Device: Intel(R) HD Graphics 4000 (IVB GT2)
PrimusVK:   Type: 1
PrimusVK: Searching for render GPU:
PrimusVK: 0x71a0fd0.
PrimusVK: 0x70c6480.
PrimusVK: Got discrete gpu!
PrimusVK: Device: GeForce GT 740M
PrimusVK:   Type: 2
free(): invalid pointer
--Type <RET> for more, q to quit, c to continue without paging--

Thread 1 "RiseOfTheTombRa" received signal SIGABRT, Aborted.
0x00007ffff20b3615 in raise () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff20b3615 in raise () at /usr/lib/libc.so.6
#1  0x00007ffff209c862 in abort () at /usr/lib/libc.so.6
#2  0x00007ffff20f55e8 in __libc_message () at /usr/lib/libc.so.6
#3  0x00007ffff20fd27a in  () at /usr/lib/libc.so.6
#4  0x00007ffff20fe64c in _int_free () at /usr/lib/libc.so.6
#5  0x00007fff243384c6 in loader_instance_heap_free
    (pMemory=<optimized out>, instance=0x75e6920)
    at /usr/src/debug/Vulkan-Loader-1.2.151/loader/loader.c:169
#6  setupLoaderTrampPhysDevs (instance=instance@entry=0x75e6920)
    at /usr/src/debug/Vulkan-Loader-1.2.151/loader/loader.c:7039
#7  0x00007fff2433ad38 in vkEnumeratePhysicalDevices
    (instance=0x75e6920, pPhysicalDeviceCount=0x7fffffffd2ec, pPhysicalDevices=0x74cc170) at /usr/src/debug/Vulkan-Loader-1.2.151/loader/trampoline.c:694
#8  0x00000000019b315e in  ()
#9  0x00000000019b3868 in  ()
#10 0x00000000018f9844 in  ()
#11 0x00000000018f9c48 in  ()
#12 0x000000000047ef62 in  ()
#13 0x00000000004935f1 in  ()
#14 0x00000000004939ad in  ()
#15 0x00000000004aad61 in  ()
#16 0x00000000004aa281 in  ()
#17 0x000000000041d939 in  ()
--Type <RET> for more, q to quit, c to continue without paging--
#18 0x00007ffff209e152 in __libc_start_main () at /usr/lib/libc.so.6
#19 0x000000000046c3a1 in  ()
#20 0x00007fffffffe108 in  ()
#21 0x000000000000001c in  ()
#22 0x0000000000000001 in  ()
#23 0x00007fffffffe3e1 in  ()
#24 0x0000000000000000 in  ()
(gdb)

Is it correct?

@felixdoerre
Copy link
Owner

Yes, perfectly. However I still don't understand what's wrong. I think the loader should never go into loader.c:7039, because this line is used when physical devices were present in a previous invocation, but are missing now. This shouldn't be the case, as primus_vk should always consistently output the same single physical device. So we go into the next round. Could you please perform these gdb commands:

b loader.c:7029
run
bt
p total_count
p *new_phys_devs[0]
p local_phys_devs[0]
c
bt
p total_count
p *new_phys_devs[0]
p local_phys_devs[0]
c
... <repeat until crash>

@felixdoerre
Copy link
Owner

Good news! I had a hunch on what could be different on your setup vs. my setup and changed the order the drivers where loaded in. This allowed me to reproduce the new problem locally. This might be a vulkan-loader bug. I will open an issue there and ask about it.

Understanding the problem allowed me to create a workaround. I pushed it here: https://github.com/felixdoerre/primus_vk/tree/mesa_layer_fix
Can you download the updated version and compile and test it?

@zimudec
Copy link
Author

zimudec commented Nov 3, 2020

Good news! I had a hunch on what could be different on your setup vs. my setup and changed the order the drivers where loaded in. This allowed me to reproduce the new problem locally. This might be a vulkan-loader bug. I will open an issue there and ask about it.

Understanding the problem allowed me to create a workaround. I pushed it here: https://github.com/felixdoerre/primus_vk/tree/mesa_layer_fix
Can you download the updated version and compile and test it?

I did the following:

  • I compiled following the same procedure as above with make.
  • I first tried running the game with steam if the command NODEVICE_SELECT = 1 %command%, using the current library, and triggered the error without problems
  • Then I closed steam, copied and renamed the compiled libprimus_vk.so file (should I do something with the other compiled file? Libnv_vulkan_wrapper.so)
  • I tried to open steam and run the game again, and both the launcher and the game start!

Sure, starting steam with optirun, just with steam and adding the pvkrun parameter to the game. Both work :D

In this thread we apparently discovered a couple of bugs in libraries external to primus_vk, right?

@felixdoerre
Copy link
Owner

should I do something with the other compiled file? libnv_vulkan_wrapper.so
You can install that file to /usr/lib/x86_64-linux-gnu/libnv_vulkan_wrapper.so.1, however I didn't change anything in that component so it shouldn't make a difference.

Regarding bugs in other components:

  • The behavior of the vulkan loader to override the gpu count. I've already opened an issue for the vulkan loader:
    Possible out-of-memory access by setupLoaderTrampPhysDevs KhronosGroup/Vulkan-Loader#510
  • The behavior of the mesa layer seems totally reasonable, so there is not bug there. The "lesson learned" could probably be documented somewhere, it is: "the function replacing vkCreateInstance must not call any vulkan functions except vkCreateInstance. This is caused by any vulkan-extensions activated through vkCreateInstance are only activated once the call to vkCreateInstance finishes." Maybe this could be seen as a bug in the vulkan loader, but I doubt that they will make any according adjustments. Maybe I will open a second issue after the first one got at least a bit of attention.

In any case, I will merge the "mesa_layer_fix"-branch into master, so these problems should not occur anymore, even if the vulkan loader does not fix anything.

@zimudec
Copy link
Author

zimudec commented Nov 4, 2020

should I do something with the other compiled file? libnv_vulkan_wrapper.so
You can install that file to /usr/lib/x86_64-linux-gnu/libnv_vulkan_wrapper.so.1, however I didn't change anything in that component so it shouldn't make a difference.

Regarding bugs in other components:

  • The behavior of the vulkan loader to override the gpu count. I've already opened an issue for the vulkan loader:
    KhronosGroup/Vulkan-Loader#510
  • The behavior of the mesa layer seems totally reasonable, so there is not bug there. The "lesson learned" could probably be documented somewhere, it is: "the function replacing vkCreateInstance must not call any vulkan functions except vkCreateInstance. This is caused by any vulkan-extensions activated through vkCreateInstance are only activated once the call to vkCreateInstance finishes." Maybe this could be seen as a bug in the vulkan loader, but I doubt that they will make any according adjustments. Maybe I will open a second issue after the first one got at least a bit of attention.

In any case, I will merge the "mesa_layer_fix"-branch into master, so these problems should not occur anymore, even if the vulkan loader does not fix anything.

Well, this was an extra setting for better compatibility :)

well, in addition to the above, with the steam-manjaro update, due to the primus problem (if I remember correctly), you cannot start steam with pvkrun directly, since it does not detect the dedicated gpu. But with optirun it works without problem, if not, start without optirun or pvkrun, and use pvkrun in the launch parameters for each game separately.

@felixdoerre
Copy link
Owner

well, in addition to the above, with the steam-manjaro update, due to the primus problem (if I remember correctly), you cannot start steam with pvkrun directly, since it does not detect the dedicated gpu. But with optirun it works without problem, if not, start without optirun or pvkrun, and use pvkrun in the launch parameters for each game separately.

I think we are mixing 3 different things here:

  • enabling power to the GPU. This is done either by activating (OpenGL)-primus (through primusrun) or by launching optirun.
  • activating (OpenGL)-primus. This is done by setting the LD_LIBRARY_PATH to contain primus' libGL.so.1. It requires "enabling power to the GPU" to work.
  • activating primus-vk. This is done by setting ENABLE_PRIMUS_LAYER=1. It requires at least "power to the GPU" to work.

I believe the state for steam is that it breaks the activation of (OpenGL)-primus. When launching steam with ENABLE_PRIMUS_LAYER=1 primusrun, this consequently breaks powering on the GPU for primus_vk and both primus and primus_vk will not work. When launching steam with ENABLE_PRIMUS_LAYER=1 optirun, powering on the GPU is successful, as optirun does that "manually", however steam still breaks the activation of (OpenGL)-primus. So you should end up with primus_vk working, but (OpenGL)-primus broken.

And from the discussion in the steam-runtime repository I got that it only will get worse: When Steam (or individual games) will run inside a "pressure vessel" (a container) both (OpenGL)-primus and primus-vk can not work, as they both will not be installed/available from within the container. Additionally, also bumblebee is not available from within the container, so powering on the gpu from within the container is not possible. Getting that to work will require active work from the steam-runtime repository to "copy/install" primus and primus_vk inside the container and mount the bumblebee socket when it is detected outside, which will be hard. Also they seem to be very reluctant to fix (I'd sill call this behavior a bug, with or without primus and primus-vk) the situation for the current runtime-variant.

@zimudec
Copy link
Author

zimudec commented Nov 4, 2020

well, in addition to the above, with the steam-manjaro update, due to the primus problem (if I remember correctly), you cannot start steam with pvkrun directly, since it does not detect the dedicated gpu. But with optirun it works without problem, if not, start without optirun or pvkrun, and use pvkrun in the launch parameters for each game separately.

I think we are mixing 3 different things here:

  • enabling power to the GPU. This is done either by activating (OpenGL)-primus (through primusrun) or by launching optirun.
  • activating (OpenGL)-primus. This is done by setting the LD_LIBRARY_PATH to contain primus' libGL.so.1. It requires "enabling power to the GPU" to work.
  • activating primus-vk. This is done by setting ENABLE_PRIMUS_LAYER=1. It requires at least "power to the GPU" to work.

I believe the state for steam is that it breaks the activation of (OpenGL)-primus. When launching steam with ENABLE_PRIMUS_LAYER=1 primusrun, this consequently breaks powering on the GPU for primus_vk and both primus and primus_vk will not work. When launching steam with ENABLE_PRIMUS_LAYER=1 optirun, powering on the GPU is successful, as optirun does that "manually", however steam still breaks the activation of (OpenGL)-primus. So you should end up with primus_vk working, but (OpenGL)-primus broken.

And from the discussion in the steam-runtime repository I got that it only will get worse: When Steam (or individual games) will run inside a "pressure vessel" (a container) both (OpenGL)-primus and primus-vk can not work, as they both will not be installed/available from within the container. Additionally, also bumblebee is not available from within the container, so powering on the gpu from within the container is not possible. Getting that to work will require active work from the steam-runtime repository to "copy/install" primus and primus_vk inside the container and mount the bumblebee socket when it is detected outside, which will be hard. Also they seem to be very reluctant to fix (I'd sill call this behavior a bug, with or without primus and primus-vk) the situation for the current runtime-variant.

What does it mean that ENABLE_PRIMUS_LAYER=1 optirun runs with vulkan without problems but with broken (OpenGL)-primus?

@felixdoerre
Copy link
Owner

What does it mean that ENABLE_PRIMUS_LAYER=1 optirun runs with vulkan without problems but with broken (OpenGL)-primus?

That means that applications that use Vulkan as graphics API will be accelerated through primus-vk (modern games or directx9/10/11/12 emulated through dxvk), and applications that use OpenGL (older applications or directx9/10/11 emulated through the implementation provided by wine) will run only on the integrated graphics card.

@zimudec
Copy link
Author

zimudec commented Nov 5, 2020

What does it mean that ENABLE_PRIMUS_LAYER=1 optirun runs with vulkan without problems but with broken (OpenGL)-primus?

That means that applications that use Vulkan as graphics API will be accelerated through primus-vk (modern games or directx9/10/11/12 emulated through dxvk), and applications that use OpenGL (older applications or directx9/10/11 emulated through the implementation provided by wine) will run only on the integrated graphics card.

Interesting, I think I have not come across that case. But it is clear then that this can happen to me with optirun.

After this journey, what do we do with this issue? do we consider it solved?

@felixdoerre
Copy link
Owner

I think we have understood all behavior and have tried to report that to the corresponding repositories. I am not sure if they will fix/improve anything, but I think from primus_vk nothing more can be done and we should consider this ticket solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants