VR on CentOS 7
Tom Goddard
October 23, 2018
How to setup an HTC Vive virtual reality headset and SteamVR on the CentOS 7 operating system.
This was to help two labs at UC San Francisco (Matt Jacobson and Adam Frost) try ChimeraX VR to visualize
molecular structures and electron microscopy density maps on their CentOS 7 desktop systems.
Results
ChimeraX VR had equal performance on all molecular and cellular visualization
examples worked as well on CentOS 7 as on Windows 10 using the same hardware (Nvidia GTX 1080, CPU i7-4790K 4.0Ghz, 4 cores, 16 Gbytes memory).
Installing and running SteamVR and ChimeraX VR is substantially more difficult with numerous pitfalls on CentOS 7 compared to Windows 10. I would not recommend using SteamVR on Linux if Windows 10 is an option.
Linux versions
Although I got ChimeraX VR to work with smooth rendering I would not recommend
CentOS 7 linux distribution because the SteamVR is compiled for a newer version of libstdc++.so.6
(requires GLIBCXX_3.4.20) than the current CentOS 7 system library (GLIBCXX_3.4.19 in CentOS 7.5.1804 core).
Most efforts to use SteamVR on Linux have used Ubuntu 16.04 or 18.04 and I think it would function
better on those distributions.
99% of VR is on Windows 10. So using any Linux system for VR is likely to have many problems
and is not advised unless other constraints make it essential to use the linux.
Components
- CentOS 7.5.1804 core
- Nvidia GTX 1080, proprietary driver version 410.66 (Oct 16, 2018).
- Steam installed from negativo17.org
- SteamVR beta, version 1540280036 (October 23, 2018)
- ChimeraX daily build (October 23, 2018)
Setup Steps
There was a lot of trial and error. These instructions distill the basics. I don't know which steps are
essential.
- Setting up a test CentOS 7 system:
- Opened case of computer, disconnected Windows 10 system disk, connected new SSD drive for testing. Aim was not to dual boot, just set up a temporary test CentOS 7 system.
- Downloaded the Minimal ISO for CentOS 7.
- Made a bootable CentOS USB drive on a Mac using these instructions.
- Installed graphical desktop: sudo yum groupinstall "GNOME Desktop"
- Installed development tools: sudo yum groupinstall "Development Tools"
- Install Nvidia graphics drivers.
I actually tried SteamVR with Mesa drivers but did not get it to work.
- Obtain current Nvidia driver for 64-bit Linux (version 410.66) directly from Nvidia.
- I followed these instructions
to install the Nvidia driver.
- The installer asks whether to install 32-bit drivers, say yes. Info online suggests SteamVR is 32-bit -- not sure this is true.
- Installed Vulkan graphics loader "sudo yum install vulkan". SteamVR uses Vulkan. Not sure if this step is needed.
- Install Steam and SteamVR
- Install Steam using instructions from negativo17.org.
- Start Steam, go to the store tab, search for SteamVR and install.
- Right click on SteamVR within Steam, select Properties, go to Betas tab and subscribe to StreamVR beta.
(I believe the non-beta SteamVR started, but did not work, and everything on the web about SteamVR on Linux
suggested the SteamVR beta was necessary.)
- Use newer libstdc++.so.6
- SteamVR beta will fail to start. Error logs say system /lib64/libstdc++.so.6 provides GLIBCXX_3.4.19 and SteamVR beta requires GLIBCXX_3.4.20.
- I tried installing a newer gcc but it did not provide a newer libstdc++.so.6. Appears the system library cannot be updated since the entire OS depends on it.
- I located a copy of 64-bit libstdc++.so.6 from gcc 4.9 on the web, and put it in ~/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/libstdc++.so.6. I used that location because the error log that showed the failure to load the library showed the load path and this directory was the first on the path.
- Start SteamVR
- Can start "steam" from a terminal, or from GNOME desktop menu Applications / Games / Steam.
- Within Steam go to Library tab and start SteamVR.
Problems using SteamVR
- Room setup crashes
- SteamVR beta starts, it shows the small window with headset, hand controllers and base stations in green.
The headset display shows a room and tracking of head and hand controllers is working.
- A window above the SteamVR window says room setup is needed. Running room setup always crashes
at some point when trying to setup Room Scale.
Usually I can get through calibrate floor, and sometimes start tracing room bounds, then it spontaneously
crashes.
- Room setup for Seated (not room scale) worked without crashing.
- To use room scale I copied the chaperone_info.vrchap file from Windows 10 after SteamVR room setup using the same base stations. On Windows this file is in C:/Program Files (x86)/Steam/config/chaperone_info.vrchap and on Linux it is ~/.local/share/Steam/config/chaperone_info.vrchap. The Windows 10 chaperone file needs to have the "universeID" in the file changed to Linux file value otherwise SteamVR will not use the file and will ask the user to run room setup.
- SteamVR does not start automatically
- When a VR app is started SteamVR must already be started by hand.
- On Windows SteamVR starts automatically when a VR app starts.
- In ChimeraX when the "vr on" command is issued without first
starting SteamVR it gives an error "VRInitError_IPC_ConnectFailed (error number 301)". Same error if Steam is running but SteamVR is not.
- SteamVR failed to initialize warning
- When SteamVR starts it sometimes shows an error "SteamVR failed to initialized for unknown reasons. (Error: vrclient Shared Lib not found (102))."
- Despite this error the SteamVR small window also comes up and it works correctly.
- I did not figure out how to fix this vrclient.so problem.
- This problem did not interfere with ChimeraX VR and I found not way to prevent the warning.
- Extended Mode warning
- When SteamVR starts it sometimes says it is in Extended mode and says this gives poorer performance and
the warning dialog offers "Direct Mode" and Dismiss buttons. Pressing Direct Mode says it will restart SteamVR.
Then it does not restart, and restarting StreamVR manually it gives the same warning.
- The Steam log file vrcompositor.txt shows that SteamVR is actually using direct mode. Posts online
suggest that SteamVR on Linux does not know whether it is using Extended Mode or Direct Mode.
- This problem did not interfere with ChimeraX VR and I found not way to prevent the warning.
Problems using ChimeraX VR
- Python openvr needs new libstdc++.so.6
- Using command "vr on" in ChimeraX gives a message about failing to load the SteamVR DLL.
This is because the Python openvr module cannot load libopenvr_api.so from SteamVR because it can't find
new enough libstdc++.so.6.
- Start ChimeraX from a terminal setting the LD_LIBRARY_PATH environment variable to find the newer libstdc++.so.6.
"LD_LIBRARY_PATH=~/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/libstdc++.so.6 chimerax-daily"
- Now opening an atomic model (e.g. "open 1grl") and using command "vr on" starts VR.
- Flickering due to desktop mirroring
- The VR flickers because mirroring to the desktop display. Although ChimeraX requests the desktop mirror
window not to wait for vertical sync (vsync) this apparently is not honored.
- Start ChimeraX VR with command "vr on display blank" to suppress mirroring to the desktop display.
This eliminates all flickering in the VR headset.
- Hand controller buttons don't work
- Hand controller buttons don't work to move / scale molecules and control VR user interface.
- This is a bug in the Python openvr package (version 1.0.1301) that the VREvent_t class uses
the wrong C packing. Modify openvr/__init__.py adding the line _pack_ = 4 above the _fields_=...
line in the VREvent_t class definition. This file is found in the ChimeraX distribution in
chimerax/lib/python3.6/site-packages/openvr.
- ChimeraX does not exit
- Quiting ChimeraX when running VR closes its window but the process is still running.
- Have to ctrl-c in the shell where ChimeraX started to exit the process.
Performance of ChimeraX VR
Performance of ChimeraX VR was perfectly smooth on the following
four systems, identical to performance on Windows 10 using the
exact same hardware.
- Opioids demo: Performance was smooth and as good as Windows showing 24 small protein structures with a button user interface to switch between them.
- Ribosome demo: Large molecular system. Worked smoothly as good as on Windows.
- Translation initiation factor and cryoEM map.
Atomic model PDB 6caj and EMDB density map 7442. Zones, map contour level changes, bond rotation. All worked smoothly, same as Windows 10.
- 3D light microscopy crawling neutrophil.
About 4 Gbytes of 3D lightsheet microscopy, time series of about 200 time points, shown as surfaces. Worked smoothly as in Windows.
Guides
Installing SteamVR on Linux
Installing Steam on Linux