felixdoerre / primus_vk

Vulkan GPU-offloading layer
BSD 2-Clause "Simplified" License
229 stars 17 forks source link

Nvidia driver could not be loaded from '/usr/lib/libGLX_nvidia.so.0'. #85

Open LichGirl opened 3 years ago

LichGirl commented 3 years ago

PrimusVK: ERROR! Nvidia driver could not be loaded from '/usr/lib/libGLX_nvidia.so.0'.

Problem occurs when launching steam games with pvkrun, full log from start to finish is here.

archlinux 5.9.11-arch2-1

Using arch packages here and here.

vkcube runs with pvkrun but oddly will not on intel:

INTEL-MESA: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0

Can't find our preferred formats... Falling back to first exposed format. Rendering may be incorrect.
Segmentation fault (core dumped)

Note that the file does exist as a link to a shared library (application/x-sharedlib)

Can someone advise fix

felixdoerre commented 3 years ago

I am not using archlinux so I don't really know/can experiment with the way graphics drivers are installed on archlinux. Therefore the best I can do is start guessing a bit in the hope that it might help. /usr/lib/libGLX_nvidia.so.0 is the path that the 64-bit primus_vk-package configures on arch: https://github.com/archlinux/svntogit-community/blob/packages/primus_vk/trunk/PKGBUILD#L43, so you are trying to launch a 64-bit application through steam. You say that /usr/lib/libGLX_nvidia.so.0 exists and is a symlink of which the target also exists, right? The error message is caused by dlopen failing to load the shared library: https://github.com/felixdoerre/primus_vk/blob/0411d00f3e3a7051c4148c1995d0615a13c08fe2/nv_vulkan_wrapper.cpp#L43 So if the file exists, ld.so probably fails to find all the necessary dependencies and fails because of that. I am not sure why the non-pvkrun of vkcube crashes, because primus_vk should not influence such a run at all.

My best guess is that the steam environment is breaking primus_vk. You could try the following: Set the steam-launch command of the target-game to pvkrun vkcube # %command% and try to launch vkcube from within the steam environment for that game. I guess that this will fail as well, but it would be good to try out.

If this command also fails, we need to identify which library is really missing/can not be resolved. I would suggest that you set the steam-launch-command to LD_DEBUG=libs pvkrun vkcube # %command% and post the output. That way we should be able to observe the library that is not fitting.

LichGirl commented 3 years ago

@felixdoerre vkcube actually will run in steam on the game, but the game will still throw the same error message. Vkcube not running on intel gpu was resolved because there was a rogue amd vulkan package on my system. Here's a full log of pvkrun vkcube # %command%: https://pastebin.com/h9XAN9fU

felixdoerre commented 3 years ago

It is interesting that the error that you opened the ticket for also appears in the vkcube-output, line 145:

PrimusVK: ERROR! Nvidia driver could not be loaded from '/usr/lib/libGLX_nvidia.so.0'.

So this does not seem to be caused by the game but by something that runs before the game. The actual output from the game starts in line 228 after this error message, so I begin to suspect that the reason the game does not start is something else. Does the game launch when you start it without pvkrun?

LichGirl commented 3 years ago

@felixdoerre Yes, it will open without pvkrun. Additionally, pvkrun functions on everything except steam, dolphin-emu with vulkan shaders, etc, will run with pvkrun. It's possible the error is not related or perhaps only steam causes a fatal error because of the error. Not sure how to diagnose further.

felixdoerre commented 3 years ago

I suppose this game runs with proton, so the usual proton-debugging hints can be used. So here is a suggestion how we might get more output from the game:

(I don't own the game, so I can't say if its a problem with the game or just setup on your system, but as you say pvkrun runs with with other games, it might be something specific to this game)

heyrict commented 3 years ago

Pardon here. I'm having a similar problem on another game. Using the patched run file described in https://github.com/felixdoerre/primus_vk/issues/85#issuecomment-743744508 works for me, while starting directly from steam play don't.

Another thing I noticed is that, I started the game with LD_DEBUG=libs pvkrun %command%, but /proc/acpi/bbswitch equals to OFF when the game starts.

It seems that steam calls /bin/sh -c LD_DEBUG=libs pvkrun '~/.steam/steam/steamapps/common/SteamLinuxRuntime_soldier'/_v2-entry-point --deploy=soldier --suite=soldier --verb=waitforexitandrun -- /path/to/game.exe rather than starting the game directly, which does not pass pvkrun to the run command.

Should we report it to the proton developers?

felixdoerre commented 3 years ago

From that commandline it seems that you are using pressure vessels, the new isolated steam runtime. In this runtime the games are launched in a new mount namespace, where steam automatically tries to copy all graphics drivers into manually. Naturally it misses all the config that is required for primus (including the bumblebee socket and others). I've discussed this already on the steam runtime repository: https://github.com/ValveSoftware/steam-runtime/issues/274#issuecomment-704461683 and currently there seems to be little interest to invest much effort into making primus and/or primus_vk working inside those pressure vessels. So I guess this would count as "reported" and there is not much that you can do except from going back to the older, scout, runtime.

felixdoerre commented 3 years ago

Hi, @heyrict @fxthomas

In case you still want to run games with modern proton inside pressure vessels. It seems the steam runtime increased compatibility in the meantime and I was able to run a game with primus_vk with Proton 6.3-7 inside a pressure vessel.

It seems that the primus_vk layer and its corresponding libraries are now correctly copied into the container. We just need to start bumblebee outside and only enable primus_vk and skip initializing primus (for which I still don't see an easy solution).

So the command/configuration that I used inside steam:

ENABLE_PRIMUS_LAYER=1 optirun -b none %command%

This command activates bumblebee outside, without enabling primus (optirun -b none) and activates the primus_vk layer (ENABLE_PRIMUS_LAYER=1). With this command I was able to run a game with primus_vk inside a pressure vessel! Note that launching this way does not accelerate OpenGL graphics calls, as we don't activate primus. For that we would need to link more libraries and fiddle around with LD_LIBRARY_PATH.