After a good deal of experimentation, I was able to get SteamVR to run.
My laptop has an integrated intel GPU as well as an nvidia discrete GPU.
The difficulty in making this work has to do with exactly what vulkaninfo reports, as well as how the vrcompositor handles the detection of direct mode vs extended mode.
If vulkaninfo reports GPU 0 as the intel GPU, the error described above occurs.
By removing the intel json files from my vulkan/icd.d directory, I coerced vulkan to only report the NV gpu. This resolved the segfault, but vrcompositor still hangs, due to trying to enable direct mode on a screen that is not attached to the NV gpu.
In the end, here is what is needed to make steamVR work:
First, make sure the HMD is enabled as a second desktop screen.
You may need to do something like:
xrandr --output HDMI-1-2 --set non-desktop 0
When vrcompositor starts up, it needs to see zero vulkan-enabled GPUs.
This causes it to skip the direct mode attempts, and immediately fall back to extended mode (HMD is on desktop).
As soon as it DOES fall back to extended mode, the nv GPU needs to be vulkan-enabled so that the compositor can draw to it.
I was able to accomplish this with the following bash script:
#!/bin/bash
####
## WARNING! Don't use this script.
## In all likelihood it will damage your vulkan capabilities, and may do far worse things.
## Be your own sysadmin, and fully understand any script before executing it.
####
if [ ! -d /usr/share/vulkan/icd.disabled ]
then
echo "Disabling intel GPUs"
mv /usr/share/vulkan/icd.d /usr/share/vulkan/icd.disabled
mkdir /usr/share/vulkan/icd.d
fi
if [ ! -d /etc/vulkan/icd.disabled ]
then
echo "Disabling nvidia GPUs"
mv /etc/vulkan/icd.d /etc/vulkan/icd.disabled
mkdir /etc/vulkan/icd.d
fi
echo "Removing old files if necessary"
rm /etc/vulkan/icd.d/*
echo "Creating pipe"
mkfifo /etc/vulkan/icd.d/pipe.json
for x in {1..2}
do
echo $(echo $x > /etc/vulkan/icd.d/pipe.json)
echo "Read $x times"
done
echo "enabling nv"
cp /etc/vulkan/icd.disabled/nvidia_icd.json /etc/vulkan/icd.d/
echo "Removing pipe"
cat /etc/vulkan/icd.disabled/nvidia_icd.json > /etc/vulkan/icd.d/pipe.json
rm /etc/vulkan/icd.d/pipe.json
Run the script as root immediately before launching steamVR.
The script works by moving around the icd json files to enable and disable GPUs for vulkan, and handles timing by using a fifo to catch attempts to read icd json files. Experimentation found that if all GPUs were disabled for the first two reads, and the nv GPU was enabled for the third and subsequent reads, it allowed steamvr to launch using extended mode, rendering with the discrete gpu.
The compositor window did initially appear on the wrong screen, and I needed to manually send it to the HMD screen.
Final thoughts:
This setup is of course not supported by Valve.
It could be, however, with two fairly small configuration options.
First, allow a configuration option to completely disable attempts at using direct mode.
Second, when enumerating vulkan-enabled GPUs, either intelligently choose the nv GPU over the intel GPU, or allow a configuration override to select which GPU to use.
Thanks,
John Hanely
Nothing extracted yet.
Your system information
Steam client version (build number or date):
Jan 4 2019, at 23:23:48
Distribution (e.g. Ubuntu):
Gentoo
Graphics driver version (run nvidia-settings):
415.22.05
Gist for SteamVR System Information:
https://gist.github.com/JohnCalin/39430f887588684667995a960fc5d27b
Opted into Steam client beta?: [Yes/No]
Yes
Opted into SteamVR beta?: [Yes/No]
Yes
Have you checked for system updates?: [Yes/No]
Yes
Please describe your issue in as much detail as possible:
When launching SteamVR, the following messages are shown:
Main SteamVR Status window: Not Ready
Notice window above status window: Connect Failed - A key component of SteamVR isn't working properly - (306)
Error alert pop-up: Error Starting SteamVR - SteamVR failed to initialize for unknown reasons. (Error: Shared IPC Compositor Connect Failed (306))
dmesg shows the following:
[ 1823.168695] vrcompositor[7036]: segfault at 10 ip 00007fb170d6e684 sp 00007fffb2646120 error 4 in libpthread-2.27.so[7fb170d64000+1b000]
[ 1823.168699] Code: b2 fa ff ff 48 8d 0d fb c0 00 00 48 8d 35 89 bf 00 00 48 8d 3d bd bf 00 00 ba a6 01 00 00 e8 83 b1 ff ff 0f 1f 00 48 83 ec 18 <8b> 57 10 49 89 f8 64 48 8b 04 25 28 00 00 00 48 89 44 24 08 31 c0
Is it expected that vrcompositor is compatible with libpthread 2.27?
Any other thoughts on what might cause this?
Thanks,
John Hanely