Create a ticket
Follow

Q100455: Enabling VR headsets on Linux for CaraVR

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 CaraVR and how to configure the headsets to work without having to launch Nuke as sudo/root.


MORE INFORMATION

Linux support for headsets like the HTC Vive and the Oculus Rift CV1 requires drivers like the OpenHMD third-party library, which is installed as part of the CaraVR installation process. However, due to a change in the NVidia drivers, the configuration file for NVidia needs to be adjusted in order to allow all CaraVR versions to use the headset as a monitor out display device.

NOTE: Before adjusting the configuration file 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

 

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

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

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

 Option     "AllowHMD" "yes"


4) Save the updated file and plug in 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 MonitorOutDevice knob of the Viewer node

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 Nuke Viewer’s enable monitor output 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’s enable monitor out 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) Sometimes the AllowHMD process doesn’t work fully 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 MonitorOutDevice knob of the Viewer node.

3) Currently, when previewing the Viewer on the Headset, the Viewer may only appear  in the top left corner showing the desktop background behind it, as CaraVR doesn't seem to make the Viewer full screen by default. 

We have logged this as a bug with our development team, and you can track the state of the bug using the link below:

TP 370526 - Headsets do not display the output Viewer from Nuke in full screen on Linux.

You can work around this issue by moving the mouse cursor onto the headset screen and double clicking the Viewport, which should make it fullscreen on the headset.



FURTHER READING 

It is also possible to use SteamVR on Linux as the headset driver, rather than OpenHMD, however at the time of writing, this is officially unsupported as Valve does not support SteamVR on CentOS 6/7, which are the supported Linux distributions for CaraVR and Nuke.

If you are able to install CaraVR, Nuke and Steam VR on a Linux distribution other than Centos 6/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
  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/ubuntu12_32/steam-runtime/run.sh

/usr/local/Nuke11.2v5/Nuke11.2

NOTE: As there is no single Linux distribution which is officially supported by both CaraVR and SteamVR, using CaraVR 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.

Was this article helpful?
/

We're sorry to hear that!

Please tell us why.
0 out of 0 found this helpful

Comments