This article documents the process of resolving graphics-related errors encountered while isntalling the Kinect 2 driver on an Intel NUC system running Ubuntu. The primary symptom was the inability to display the camera feed, despite the device being successfully detected by the system.
Initial attempts to run the Protonect example from libfreenect2 resulted in two distinct errors: vaDisplayIsValid(display) failed when using the CPU backend, and GLFW errors (X11: RandR gamma ramp support seems broken, The requested client API version is unavailable) when using the OpenGL backend.
The investigation began by examining the libva (Video Acceleration API) library, as the Intel integrated graphics on the NUC relies on it for hardware aceleration. The vainfo utility, used to query VA capabilities, failed to execute, suggesting a misconfiguration or missing dependency in the graphics stack.
Multiple attempts were made to reinstall and reconfigure libva and its utilities from source, following guides from the Intel GitHub repository and community blogs. However, these efforts were unsuccessful, often leading to new configuration errors or failures in the configure step due to incompatible libtool versions.
Subsequent issues with OpenGL and GLFW emerged, preventing the creation of an OpenGL window. This was traced back to a potential corruption of the OpenGL libraries, possibly caused by an autoremove operation. Reinstalling OpenGL proved problematic due to cascading dependencies.
As a workaround, the OPENNI2 driver was considered. While NiViewer2 could successfully open the camera, the primary goal of using the iai_kinect2 ROS package required the libfreenect2 backend, bringing the original OpenGL problem back into focus. Compiling libfreenect2 with OpenGL support continued to produce GLFW errors, even when the GLFW library was detected by CMake.
The resolution came unexpectedly while attempting to install the librealsense driver for an Intel RealSense camera. The process of updating the system kernel and installing the RealSense dependencies implicitly updated the underlying graphics drivers.
The following steps were performed, which ultimately resolved the libfreenect2 display issue:
- Update the system kernel and related Xorg packages to the long-term support (LTS) version: ```
sudo apt-get install --install-recommends linux-generic-lts-xenial xserver-xorg-core-lts-xenial xserver-xorg-lts-xenial xserver-xorg-video-all-lts-xenial xserver-xorg-input-all-lts-xenial libwayland-egl1-mesa-lts-xenial
- Clone the
librealsenserepository: ``` git clone https://github.com/IntelRealSense/librealsense - Install the required dependencies and the GLFW3 library as specified in the
librealsenseinstallation script: ``` cd librealsense ./scripts/install_glfw3.sh
With the libfreenect2 display issue resolved, the iai_kinect2 package now encounters problems related to OpenCL. The next step is to investigate whether installing the appropriate OpenCL drivers or disabling OpenCL support will resolve this final hurdle.