Q100455: Enabling VR headsets on Linux for Nuke and CaraVR

Follow

SUMMARY

This article provides guidance on how to enable the VR headsets on Linux. This includes how to configure newer Nvidia drivers to work with Nuke and CaraVR, and how to configure the headsets to work without having to launch Nuke as sudo/root.


MORE INFORMATION

Headsets on Linux, such as the HTC Vive and Oculus Rift CV1 require drivers like the OpenHMD third-party library, which is installed as part of the Nuke/CaraVR installation process. However, due to how the Nvidia drivers are set up by default, the configuration file for Nvidia needs to be adjusted in order to allow the headset to be used as a Monitor Out display device.

NOTE: The CaraVR plug-in is now included in Nuke versions 12.0+

Before you enable your VR headset, please ensure that the Nvidia GPU drivers are up-to-date. To update them, please check the Nvidia website linked below:

https://www.nvidia.com/Download/index.aspx?lang=en-in

 

Enabling VR Headset on Rocky 9

To enable your VR headset in Nuke and CaraVR you will need to install the EPEL repository, along with some extra libraries and udev rules.

1) Open a terminal window

2) Install the EPEL repository by running sudo dnf install epel-release

3) Install hidapi to allow Nuke to interface with your device by running sudo dnf install hidapi hidapi-devel

4) Install cmake by running: sudo dnf install cmake

5) Next install OpenHMD by browsing to your download folder in your terminal window and running: sudo git clone --recursive https://github.com/thaytan/OpenHMD.git

6) Open the OpenHMD folder by typing cd OpenHMD and run the following commands to compile and install OpenHMD.

Please note you can compile OpenHMD with specific drivers, further information on the available drivers can be found on the official github, you can also use “..” after the cmake command to install detected devices.

1. Mkdir build
2. Cd build
3. Cmake..
4. Make
5. Sudo make install

7) If you have a controller with your VR headset, you can setup the required udev rules required to enable it by installing xr-hardware. You can install this by browsing to your download folder in your terminal session and running: sudo git clone --recursive https://gitlab.freedesktop.org/monado/utilities/xr-hardware.git

8) Then open the xr-hardware folder by typing cd xr-hardware and run the following commands to build and install xr-hardware.

1. Make
2. Sudo make install

 

Enabling VR Headset on CentOS 7

CONFIGURING NVIDIA DRIVERS

Below are the steps that need following in order to adjust the configuration file:

1) As sudo or root, open the following file in a text editor:

 /etc/X11/xorg.conf

Note: If the xorg.conf file doesn't exist, then you can create it by using the following command:

sudo nvidia-xconfig

2) Find the section of the configuration file that says Section "Device"

3) Add the following line to the section, as shown in the example image below:

 Option     "AllowHMD" "yes"


4) Save the updated file and connect the headset device.

5) Reboot the machine.

Now that the Nvidia configuration file has been adjusted you can test that your VR headset works by launching Nuke and CaraVR. Please note that Nuke must be launched as sudo or root, and the option to use the headset should now appear in the Device knob of Monitor Out advanced settings.

To open the Viewer Monitor Out panel, right-click any Pane and select Windows > Viewer Monitor Out to add it. Then click the cog  icon at the left of the Viewer Monitor Out panel to display the advanced settings in the Properties panel, as shown in the images below:

viewerMonitorOut.png

mceclip0.png


NOTE:
You can also check our documentation at the following link for more information about using the headset with CaraVR:
 Reviewing Your Work

 

USING HEADSETS WITHOUT LAUNCHING NUKE AS ROOT OR SUDO

When launching Nuke without sudo/root and trying to enable the headset in the Viewer node, the headset may not work and the message below will be displayed:



This issue is due to how Linux manages its permissions for the USB devices plugged into the system. The simplest way to overcome this issue is to launch Nuke as root/sudo, as all the permissions are granted, however running Nuke as root/sudo can interfere with existing pipelines.

Headsets can be used without needing to launch Nuke as sudo or root, however this requires additional setup, which is detailed below:

 

USING OCULUS RIFT CV1 WITHOUT ROOT OR SUDO

The following steps should add the Oculus Rift CV1 to the 83-hmd.rules udev file, which should prevent the “Rift (CV1)” is already in use message from occurring:

NOTE:  Do not plug the CV1 headset in or start Nuke before performing these steps.


1) Make sure the user ID of the user who wants to use the headset belongs to the group plugdev, creating a permission group called plugdev if needed. Please review the Linux distribution documentation for information about how to create permission groups and add user IDs to the groups.

2) As sudo or root, open or create and open /etc/udev/rules.d/83-hmd.rules in a text editor.

3) Add the following line to the file:

    SUBSYSTEM=="usb", ATTR{idVendor}=="2833", MODE="0666", GROUP="plugdev"

4) Save the file

5) As sudo or Root, run the below command:

      sudo udevadm control --reload-rules

6) Restart the machine.

7) Plug in the CV1 headset and start Nuke.

NOTE: When using the CV1 headset on Linux, please be aware that the CV1 displays black until it is enabled in the Monitor Out advanced settings Device knob.

 

USING HTC VIVE WITHOUT ROOT OR SUDO

The following steps should add the HTC Vive to the 83-hmd.rules udev file, which should prevent the “HTC Vive” is already in use message from occurring:

1) Make sure the user ID belongs to the group plugdev, creating a group called plugdev if needed. Please review the Linux distribution's documentation for information about how to create groups and add user IDs to groups. 

2) As sudo or root, open or create and open /etc/udev/rules.d/83-hmd.rules in a text editor 

3) Add the below lines of code to the file, they were derived from the SteamVR GitHub page, https://github.com/ValveSoftware/SteamVR-for-Linux#usb-device-requirements: 

# HTC Vive HID Sensor naming and permissioning

KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="2c87", MODE="0666", GROUP="plugdev"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="2101", MODE="0666", GROUP="plugdev"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="2000", MODE="0666", GROUP="plugdev"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="1043", MODE="0666", GROUP="plugdev"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="2050", MODE="0666", GROUP="plugdev"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="2011", MODE="0666", GROUP="plugdev"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="2012", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="2c87", MODE="0666", GROUP="plugdev"

# HTC Camera USB Node

SUBSYSTEM=="usb", ATTRS{idVendor}=="114d", ATTRS{idProduct}=="8328", MODE="0666", GROUP="plugdev"

# HTC Mass Storage Node

SUBSYSTEM=="usb", ATTRS{idVendor}=="114d", ATTRS{idProduct}=="8200", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="114d", ATTRS{idProduct}=="8a12", MODE="0666", GROUP="plugdev"

4) Save the file 

5) As sudo or Root, run the below command: 

sudo udevadm control --reload-rules

6) Restart the machine.

7) Plug the headset in, if it is already plugged in, then it may need re-plugging so you can see the desktop background on the headset.

8) Launch Nuke and test if the headset can be used without the “HTC Vive” is already in use message.

 

If you continue to get the “HTC Vive” is already in use message, then the headset may have a different device/vendor IDs, so custom rules will need to be added to the 83-hmd.rules file for those IDs. This can be done using the steps below: 

1) Open Terminal and run: 

lsusb

2) This will give you a result like below: 

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 0bda:0181 Realtek Semiconductor Corp.
Bus 002 Device 055: ID 0bb4:2744 HTC (High Tech Computer Corp.)
Bus 002 Device 003: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 002 Device 056: ID 0bb4:0306 HTC (High Tech Computer Corp.)
Bus 002 Device 057: ID 0424:274d Standard Microsystems Corp.
Bus 002 Device 058: ID 0bb4:2134 HTC (High Tech Computer Corp.)
Bus 002 Device 007: ID 0d3d:0040 Tangtop Technology Co., Ltd PS/2 Adapter
Bus 002 Device 059: ID 0bb4:2c87 HTC (High Tech Computer Corp.)
Bus 002 Device 060: ID 28de:2101  
Bus 002 Device 061: ID 28de:2101  
Bus 002 Device 062: ID 28de:2000  
Bus 002 Device 063: ID 0bb4:2c87 HTC (High Tech Computer Corp.)

Bus 002 Device 036: ID 0c45:6340 Microdia Camera

The ID section can be read as idVendor:idProduct, using these values, additional rules for the /etc/udev/rules.d/83-hmd.rules file can be created. 

3) As sudo or root, open the /etc/udev/rules.d/83-hmd.rules in a text editor 

4) Add the below line, replacing <missingVendor> and <missingProduct> with any devices listed in the lsusb result, which are not already in the 83-hmd.rules file: 

SUBSYSTEM=="usb", ATTRS{idVendor}=="<missingVendor>", ATTRS{idProduct}=="<missingProduct>", MODE="0666", GROUP="plugdev"

In this example, the below three lines were added in order to allow Nuke and CaraVR permissions: 

# Extra rules

SUBSYSTEM=="usb", ATTRS{idVendor}=="
0bb4", ATTRS{idProduct}=="0306", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="2134", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="2744", MODE="0666", GROUP="plugdev"

5) Save the file

6) As sudo or Root, run the below command:

 sudo udevadm control --reload-rules

7) Restart the machine. 

8) Plug the headset in, if it is already plugged in, then it may need re-plugging so you can see the desktop background on the headset.

9) Launch Nuke and the headset should now be usable when enabling it in the Viewer Monitor Out advanced settings Device knob.

 

ADDITIONAL TROUBLESHOOTING 

1) Installing another version of OpenHMD may interfere with the one that ships with CaraVR. If  you encounter problems with the headset, please try uninstalling any other versions of OpenHMD or other headset drivers you may have installed on your machine.

2) On occasion, the AllowHMD process will not function automatically. In this case, to correct the headset not being detected in Nuke, open the NVidia settings where the headset is being detected as a second monitor but disabled, then enable it. This should correct this issue and when re-launching Nuke, the headset should appear in the Viewer Monitor Out advanced settings Device knob.

 

ADDITIONAL NOTES ABOUT THE OCULUS RIFT CV1

  • The Oculus CV1 displays black until you turn it on inside Nuke's Viewer settings.
  • The CV1 does not appear in the list of available screens in Gnome/Kde, it is displayed with the supported devices in the Viewer Monitor Output Device knob.
  • When you initially turn on Viewer Monitor Output, all available monitors display black for a few seconds as the OS adjusts to the new configuration.
  • The CV1 remains on until you close Nuke, which causes all available monitors to display black for a few seconds as the OS adjusts to the new configuration.

 

FURTHER READING 

It is also possible to use SteamVR on Linux as the headset driver, rather than OpenHMD. However, Valve has limited support for SteamVR on CentOS 7. Additionally, specific driver versions will be necessary to run the software, which can be found below:

Nvidia:

AMD:

    • SteamVR requires a minimum of Mesa 17.3 compiled with vulkan support and Linux kernel 4.13.

 

Additional information for drivers can be found in their SteamVR for Linux documentation.

 

If you are able to install CaraVR, Nuke and Steam VR on a Linux distribution other than Centos 7, then using the below steps might allow the headset to work. 

  1. Ensure that SteamVR is installed and updated, performing all the necessary configuration steps in SteamVR until any SteamVR application can be run successfully
     - Steam installation files can be found here.
  2. Close SteamVR, but keep Steam running
  3. Open a Terminal and in the same session, run the two lines below, adjusting them as needed for the system’s specific install: 

/home/username/.steam/steam/ubuntu20_04/steam-runtime/run.sh

/usr/local/Nuke14.0v6/Nuke14.0

NOTE: As there is no single Linux distribution which is officially supported by Nuke/CaraVR and SteamVR, using Nuke with SteamVR has not been fully tested and may not work as expected. However, it may provide better performance in terms of framerate, distortion correction and field of view settings for SteamVR Supported headsets rather than OpenHMD. 

    We're sorry to hear that

    Please tell us why