Can't get Vulkan to work on a new erent user through sudo

Scenario and the problem:

I’m running two instances of the same Steam game on my main user X. To do that, I’m launching first instance on my main user and the other instance on another user. This works as I intended, but I can’t get Vulkan to work on my second instance.

I’m running a second Steam instance from a different user with:

xhost local:remoto && sudo -u remoto /usr/games/steam -applaunch 1041320

. -> This works great using WINED3D. I’m trying to run it with Vulkan, because the game process will consumption about 50% less CPU with it.

Troubleshooting:

To state that vulkan isn’t working running through another user with sudo, I do:

xhost local:remoto && sudo -u remoto `VK_LOADER_DEBUG=all vulkaninfo`

The output:

error: XDG_RUNTIME_DIR not set in the environment. ERROR: setupLoaderTermPhysDevs: Failed to detect any valid GPUs in the current config ERROR: setupLoaderTrampPhysDevs: Failed during dispatch call of 'vkEnumeratePhysicalDevices' to lower layers or load er to get count.

I tried to do the scenario above with SSH X11 Forwarding instead of sudo, but I got the exact same result.

The problem isn’t Direct Rendering, since I’m running the game just fine with WINED3D with the above scenario.

Output of

xhost local:remoto && sudo -u remoto glxinfo | grep "OpenGL renderer string"

:

non-network local connections being added to access control list OpenGL renderer string: Mesa DRI Intel(R) Haswell Desktop

Vulkan works fine if I run VK_LOADER_DEBUG=all vulkaninfo at the ‘remoto’ user Xsession.