microsoft / Azure-Kinect-Sensor-SDK

A cross platform (Linux and Windows) user mode SDK to read data from your Azure Kinect device.
https://Azure.com/Kinect
MIT License
1.5k stars 620 forks source link

Body tracking with OpenGL not working on Ubuntu #1278

Closed Umarbi closed 4 years ago

Umarbi commented 4 years ago

I am trying to run Kinect DK with an Nvidia GPU Quadro P1000 on ubuntu 18.04. I am running into an issue with the body tracking API where the OpenGL context is not getting created for the body tracking API. I haven't found the right solution yet of what I need to do to resolve the issue. Below is Nvidia-sim output as well as the output when I run k4abt_simple_3d_viewer. Anyone has run into similar issues or has suggestions what I should try next?

Thanks

$ nvidia-smi Wed Jul 8 20:44:46 2020
+-----------------------------------------------------------------------------+ | NVIDIA-SMI 440.100 Driver Version: 440.100 CUDA Version: 10.2 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 Quadro P1000 Off | 00000000:01:00.0 Off | N/A | | 0% 46C P8 N/A / N/A | 17MiB / 4040MiB | 0% Default | +-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=============================================================================| | 0 1289 G /usr/lib/xorg/Xorg 9MiB | | 0 1342 G /usr/bin/gnome-shell 4MiB | +-----------------------------------------------------------------------------+

$ k4abt_simple_3d_viewer

Basic Navigation:

Rotate: Rotate the camera by moving the mouse while holding mouse left button Pan: Translate the scene by holding Ctrl key and drag the scene with mouse left button Zoom in/out: Move closer/farther away from the scene center by scrolling the mouse scroll wheel Select Center: Center the scene based on a detected joint by right clicking the joint with mouse

Key Shortcuts

ESC: quit h: help b: body visualization mode k: 3d window layout

libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast Error: OpenGL 4.4 not supported. Please install latest graphics drivers. [2020-07-08 20:42:58.463] [error] [t=1995] /w/1/s/extern/Azure-Kinect-Sensor-SDK/src/dewrapper/dewrapper.c (154): depth_engine_start_helper(). Depth engine create and initialize failed with error code: 207. [2020-07-08 20:42:58.463] [error] [t=1995] /__w/1/s/extern/Azure-Kinect-Sensor-SDK/src/dewrapper/dewrapper.c (157): depth_engine_start_helper(). OpenGL 4.4 context creation failed. You could try updating your graphics drivers. [2020-07-08 20:42:58.463] [error] [t=1995] /w/1/s/extern/Azure-Kinect-Sensor-SDK/src/dewrapper/dewrapper.c (160): deresult == K4A_DEPTH_ENGINE_RESULT_SUCCEEDED returned failure in depth_engine_start_helper() [2020-07-08 20:42:58.463] [error] [t=1995] /w/1/s/extern/Azure-Kinect-Sensor-SDK/src/dewrapper/dewrapper.c (194): depth_engine_start_helper(dewrapper, dewrapper->fps, dewrapper->depth_mode, &depth_engine_max_compute_time_ms, &depth_engine_output_buffer_size) returned failure in depth_engine_thread() [2020-07-08 20:42:58.464] [error] [t=1986] /__w/1/s/extern/Azure-Kinect-Sensor-SDK/src/dewrapper/dewrapper.c (552): dewrapper_start(). Depth Engine thread failed to start [2020-07-08 20:42:58.464] [error] [t=1986] /w/1/s/extern/Azure-Kinect-Sensor-SDK/src/depth/depth.c (451): dewrapper_start(depth->dewrapper, config, depth->calibration_memory, depth->calibration_memory_size) returned failure in depth_start() [2020-07-08 20:42:58.464] [error] [t=1986] /w/1/s/extern/Azure-Kinect-Sensor-SDK/src/depth_mcu/depth_mcu.c (359): cmd_status == CMD_STATUS_PASS returned failure in depthmcu_depth_stop_streaming() [2020-07-08 20:42:58.464] [error] [t=1986] /w/1/s/extern/Azure-Kinect-Sensor-SDK/src/depth_mcu/depth_mcu.c (362): depthmcu_depth_stop_streaming(). ERROR: cmd_status=0x00000063 [2020-07-08 20:42:58.464] [error] [t=1986] /__w/1/s/extern/Azure-Kinect-Sensor-SDK/src/sdk/k4a.c (891): depth_start(device->depth, config) returned failure in k4a_device_start_cameras() Start K4A cameras failed!

qm13 commented 4 years ago

Looking at the error log your graphics driver is not compatible with OpenGL 4.4. Have you updated to the latest graphics driver?

Umarbi commented 4 years ago

The nvidia-driver-440 was showing up as the recommended version and that's what I have. Should I be installing a different one?

$ ubuntu-drivers devices

== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==

modalias : pci:v000010DEd00001CB1sv000010DEsd000011BCbc03sc00i00

vendor : NVIDIA Corporation

model : GP107GL [Quadro P1000]

driver : nvidia-driver-440 - distro non-free recommended

driver : nvidia-driver-435 - distro non-free

driver : nvidia-driver-390 - distro non-free

driver : xserver-xorg-video-nouveau - distro free builtin

== /sys/devices/pci0000:00/0000:00:14.3 ==

modalias : pci:v00008086d0000A370sv00008086sd00000030bc02sc80i00

vendor : Intel Corporation

manual_install: True

driver : backport-iwlwifi-dkms - distro free

$ nvidia-smi

Fri Jul 10 08:26:52 2020

+-----------------------------------------------------------------------------+

NVIDIA-SMI 440.100 Driver Version: 440.100 CUDA Version: 10.2

|-------------------------------+----------------------+----------------------+

On Thu, Jul 9, 2020 at 3:58 PM qm13 notifications@github.com wrote:

Looking at the error log your graphics driver is not compatible with OpenGL 4.4. Have you updated to the latest graphics driver?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/microsoft/Azure-Kinect-Sensor-SDK/issues/1278#issuecomment-656348180, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQHLZL6NMAKA6HC3MNZ3DWLR2YVQZANCNFSM4OVY3KZQ .

--

The content of this email and attachment(s) are confidential and intended solely for the recipient(s) specified in the message. If you received this email by error, please alert the sender by replying to this email and follow with its deletion, so that we can ensure such an error does not occur in future. If you are not the intended recipient, you are strictly prohibited to use, copy, disseminate or store this email or its attachment(s).

Umarbi commented 4 years ago

Here is my Xorg.conf file which was generated using nvidia-xconfig.

$ cat /etc/X11/xorg.conf

nvidia-xconfig: X configuration file generated by nvidia-xconfig

nvidia-xconfig: version 440.100

Section "ServerLayout" Identifier "Default Layout" Screen "Default Screen" 0 0 InputDevice "Keyboard0" "CoreKeyboard" InputDevice "Mouse0" "CorePointer" EndSection

Section "InputDevice"

generated from default

Identifier     "Keyboard0"
Driver         "kbd"

EndSection

Section "InputDevice"

generated from default

Identifier     "Mouse0"
Driver         "mouse"
Option         "Protocol" "auto"
Option         "Device" "/dev/psaux"
Option         "Emulate3Buttons" "no"
Option         "ZAxisMapping" "4 5"

EndSection

Section "Device" Identifier "nvidia" Driver "nvidia" VendorName "NVIDIA Corporation" EndSection

Section "Screen" Identifier "Default Screen" Device "nvidia" DefaultDepth 24 Option "AllowEmptyInitialConfiguration" SubSection "Display" Depth 24 Modes "nvidia-auto-select" EndSubSection EndSection

Here is the relevant part of my Xorg log. There is no EE line.

[ 6.450] (II) LoadModule: "nvidia" [ 6.450] (II) Loading /usr/lib/x86_64-linux-gnu/nvidia/xorg/nvidia_drv.so [ 6.453] (II) Module nvidia: vendor="NVIDIA Corporation" [ 6.453] compiled for 1.6.99.901, module version = 1.0.0 [ 6.453] Module class: X.Org Video Driver [ 6.453] (II) NVIDIA dlloader X Driver 440.100 Fri May 29 08:21:27 UTC 2020 [ 6.453] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs [ 6.454] (II) systemd-logind: releasing fd for 226:1 [ 6.454] (II) Loading sub module "fb" [ 6.455] (II) LoadModule: "fb" [ 6.455] (II) Loading /usr/lib/xorg/modules/libfb.so [ 6.455] (II) Module fb: vendor="X.Org Foundation" [ 6.455] compiled for 1.20.8, module version = 1.0.0 [ 6.455] ABI class: X.Org ANSI C Emulation, version 0.4 [ 6.455] (II) Loading sub module "wfb" [ 6.455] (II) LoadModule: "wfb" [ 6.455] (II) Loading /usr/lib/xorg/modules/libwfb.so [ 6.456] (II) Module wfb: vendor="X.Org Foundation" [ 6.456] compiled for 1.20.8, module version = 1.0.0 [ 6.456] ABI class: X.Org ANSI C Emulation, version 0.4 [ 6.456] (II) Loading sub module "ramdac" [ 6.456] (II) LoadModule: "ramdac" [ 6.456] (II) Module "ramdac" already built-in [ 6.457] () NVIDIA(0): Depth 24, (--) framebuffer bpp 32 [ 6.457] (==) NVIDIA(0): RGB weight 888 [ 6.457] (==) NVIDIA(0): Default visual is TrueColor [ 6.457] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0) [ 6.457] (II) Applying OutputClass "nvidia" options to /dev/dri/card1 [ 6.457] () NVIDIA(0): Option "AllowEmptyInitialConfiguration" [ 6.457] (**) NVIDIA(0): Enabling 2D acceleration [ 6.457] (II) Loading sub module "glxserver_nvidia" [ 6.457] (II) LoadModule: "glxserver_nvidia" [ 6.457] (II) Loading /usr/lib/x86_64-linux-gnu/nvidia/xorg/libglxserver_nvidia.so [ 6.477] (II) Module glxserver_nvidia: vendor="NVIDIA Corporation" [ 6.477] compiled for 1.6.99.901, module version = 1.0.0 [ 6.477] Module class: X.Org Server Extension [ 6.477] (II) NVIDIA GLX Module 440.100 Fri May 29 08:19:01 UTC 2020 [ 6.478] (II) NVIDIA: The X server supports PRIME Render Offload. [ 7.013] (--) NVIDIA(0): Valid display device(s) on GPU-0 at PCI:1:0:0 [ 7.013] (--) NVIDIA(0): DFP-0 [ 7.013] (--) NVIDIA(0): DFP-1 [ 7.013] (--) NVIDIA(0): DFP-2 [ 7.013] (--) NVIDIA(0): DFP-3 [ 7.013] (--) NVIDIA(0): DFP-4 [ 7.013] (--) NVIDIA(0): DFP-5 [ 7.013] (--) NVIDIA(0): DFP-6 [ 7.013] (--) NVIDIA(0): DFP-7 [ 7.013] (II) NVIDIA(0): NVIDIA GPU Quadro P1000 (GP107GL-A) at PCI:1:0:0 (GPU-0) [ 7.013] (--) NVIDIA(0): Memory: 4194304 kBytes [ 7.013] (--) NVIDIA(0): VideoBIOS: 86.07.6d.00.01 [ 7.013] (II) NVIDIA(0): Detected PCI Express Link width: 16X [ 7.013] (--) NVIDIA(GPU-0): DFP-0: disconnected [ 7.013] (--) NVIDIA(GPU-0): DFP-0: Internal DisplayPort [ 7.013] (--) NVIDIA(GPU-0): DFP-0: 1440.0 MHz maximum pixel clock [ 7.013] (--) NVIDIA(GPU-0): [ 7.014] (--) NVIDIA(GPU-0): DFP-1: disconnected [ 7.014] (--) NVIDIA(GPU-0): DFP-1: Internal TMDS [ 7.014] (--) NVIDIA(GPU-0): DFP-1: 165.0 MHz maximum pixel clock [ 7.014] (--) NVIDIA(GPU-0): [ 7.014] (--) NVIDIA(GPU-0): DFP-2: disconnected [ 7.014] (--) NVIDIA(GPU-0): DFP-2: Internal DisplayPort [ 7.014] (--) NVIDIA(GPU-0): DFP-2: 1440.0 MHz maximum pixel clock [ 7.014] (--) NVIDIA(GPU-0): [ 7.014] (--) NVIDIA(GPU-0): DFP-3: disconnected [ 7.014] (--) NVIDIA(GPU-0): DFP-3: Internal TMDS [ 7.014] (--) NVIDIA(GPU-0): DFP-3: 165.0 MHz maximum pixel clock [ 7.014] (--) NVIDIA(GPU-0): [ 7.014] (--) NVIDIA(GPU-0): DFP-4: disconnected [ 7.014] (--) NVIDIA(GPU-0): DFP-4: Internal DisplayPort [ 7.014] (--) NVIDIA(GPU-0): DFP-4: 1440.0 MHz maximum pixel clock [ 7.014] (--) NVIDIA(GPU-0): [ 7.014] (--) NVIDIA(GPU-0): DFP-5: disconnected [ 7.014] (--) NVIDIA(GPU-0): DFP-5: Internal TMDS [ 7.014] (--) NVIDIA(GPU-0): DFP-5: 165.0 MHz maximum pixel clock [ 7.014] (--) NVIDIA(GPU-0): [ 7.014] (--) NVIDIA(GPU-0): DFP-6: disconnected [ 7.014] (--) NVIDIA(GPU-0): DFP-6: Internal DisplayPort [ 7.014] (--) NVIDIA(GPU-0): DFP-6: 1440.0 MHz maximum pixel clock [ 7.014] (--) NVIDIA(GPU-0): [ 7.014] (--) NVIDIA(GPU-0): DFP-7: disconnected [ 7.014] (--) NVIDIA(GPU-0): DFP-7: Internal TMDS [ 7.014] (--) NVIDIA(GPU-0): DFP-7: 165.0 MHz maximum pixel clock [ 7.014] (--) NVIDIA(GPU-0): [ 7.014] (--) NVIDIA(0): No enabled display devices found; starting anyway because [ 7.014] (--) NVIDIA(0): AllowEmptyInitialConfiguration is enabled [ 7.014] (II) NVIDIA(0): Validated MetaModes: [ 7.014] (II) NVIDIA(0): "NULL" [ 7.014] (II) NVIDIA(0): Virtual screen size determined to be 640 x 480 [ 7.014] (WW) NVIDIA(0): Unable to get display device for DPI computation. [ 7.014] (==) NVIDIA(0): DPI set to (75, 75); computed from built-in default [ 7.014] (II) NVIDIA: Using 24576.00 MB of virtual memory for indirect memory [ 7.014] (II) NVIDIA: access. [ 7.028] (II) NVIDIA(0): Setting mode "NULL" [ 7.033] (==) NVIDIA(0): Disabling shared memory pixmaps [ 7.033] (==) NVIDIA(0): Backing store enabled [ 7.033] (==) NVIDIA(0): Silken mouse enabled [ 7.034] (==) NVIDIA(0): DPMS enabled [ 7.034] (II) Loading sub module "dri2" [ 7.034] (II) LoadModule: "dri2" [ 7.034] (II) Module "dri2" already built-in [ 7.034] (II) NVIDIA(0): [DRI2] Setup complete [ 7.034] (II) NVIDIA(0): [DRI2] VDPAU driver: nvidia [ 7.034] (II) Initializing extension Generic Event Extension [ 7.034] (II) Initializing extension SHAPE [ 7.034] (II) Initializing extension MIT-SHM [ 7.034] (II) Initializing extension XInputExtension [ 7.034] (II) Initializing extension XTEST [ 7.034] (II) Initializing extension BIG-REQUESTS [ 7.034] (II) Initializing extension SYNC [ 7.034] (II) Initializing extension XKEYBOARD [ 7.034] (II) Initializing extension XC-MISC [ 7.034] (II) Initializing extension SECURITY [ 7.035] (II) Initializing extension XFIXES [ 7.035] (II) Initializing extension RENDER [ 7.035] (II) Initializing extension RANDR [ 7.035] (II) Initializing extension COMPOSITE [ 7.035] (II) Initializing extension DAMAGE [ 7.035] (II) Initializing extension MIT-SCREEN-SAVER [ 7.035] (II) Initializing extension DOUBLE-BUFFER [ 7.035] (II) Initializing extension RECORD [ 7.035] (II) Initializing extension DPMS [ 7.035] (II) Initializing extension Present [ 7.035] (II) Initializing extension DRI3 [ 7.035] (II) Initializing extension X-Resource [ 7.035] (II) Initializing extension XVideo [ 7.035] (II) Initializing extension XVideo-MotionCompensation [ 7.035] (II) Initializing extension SELinux [ 7.035] (II) SELinux: Disabled on system [ 7.035] (II) Initializing extension GLX [ 7.035] (II) Initializing extension GLX [ 7.035] (II) Indirect GLX disabled. [ 7.035] (II) GLX: Another vendor is already registered for screen 0 [ 7.035] (II) Initializing extension XFree86-VidModeExtension [ 7.036] (II) Initializing extension XFree86-DGA [ 7.036] (II) Initializing extension XFree86-DRI [ 7.036] (II) Initializing extension DRI2 [ 7.036] (II) Initializing extension NV-GLX [ 7.036] (II) Initializing extension NV-CONTROL

jmicho commented 4 years ago

If you're running over ssh, try setting the DISPLAY environment variable.

https://github.com/microsoft/Azure-Kinect-Sensor-SDK/issues/810

Umarbi commented 4 years ago

I am doing it over ssh and DISPLAY is set and x forwarding etc. is working. Thanks

wes-b commented 4 years ago

What Version of OpenGL is reported when you run glxinfo | grep "OpenGL". Our error message is saying you need version 4.4.

Umarbi commented 4 years ago

It doesn't even go that far. $ glxinfo name of display: localhost:10.0 libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast X Error of failed request: GLXBadContext Major opcode of failed request: 149 (GLX) Minor opcode of failed request: 6 (X_GLXIsDirect) Serial number of failed request: 31 Current serial number in output stream: 30

Do these look incorrect? I am not sure which numbers I should be seeing here. $ dpkg -l | grep ^ii | grep -i glx ii libgl1-mesa-dev:amd64 19.2.8-0ubuntu0~18.04.3 amd64 free implementation of the OpenGL API -- GLX development files ii libgl1-mesa-glx:amd64 19.2.8-0ubuntu0~18.04.3 amd64 transitional dummy package ii libglx-mesa0:amd64 19.2.8-0ubuntu0~18.04.3 amd64 free implementation of the OpenGL API -- GLX vendor library ii libglx-mesa0:i386 19.2.8-0ubuntu0~18.04.3 i386 free implementation of the OpenGL API -- GLX vendor library ii libglx0:amd64 1.0.0-2ubuntu2.3 amd64 Vendor neutral GL dispatch library -- GLX support ii libglx0:i386 1.0.0-2ubuntu2.3 i386 Vendor neutral GL dispatch library -- GLX support ii libnvidia-cfg1-440:amd64 440.100-0ubuntu0.18.04.1 amd64 NVIDIA binary OpenGL/GLX configuration library ii libnvidia-gl-440:amd64 440.100-0ubuntu0.18.04.1 amd64 NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD ii libnvidia-gl-440:i386 440.100-0ubuntu0.18.04.1 i386 NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD ii libxcb-glx0:amd64 1.13-2~ubuntu18.04 amd64 X C Binding, glx extension ii libxcb-glx0:i386 1.13-2~ubuntu18.04 i386 X C Binding, glx extension ii libxcb-glx0-dev:amd64 1.13-2~ubuntu18.04 amd64 X C Binding, glx extension, development files

I had installed them like this sudo apt-get install cmake libx11-dev xorg-dev libglu1-mesa-dev freeglut3-dev libglew1.5 libglew1.5-dev libglu1-mesa libglu1-mesa-dev libgl1-mesa-glx libgl1-mesa-dev

Umarbi commented 4 years ago

Thanks everyone. I just tried it on the attached monitor to the machine and it is working now. Not sure which change made it work. Must have been an ssh env related issue. btw below was the output from glxinfo. Over ssh it is the same error message.

$ glxinfo | grep "OpenGL" OpenGL vendor string: NVIDIA Corporation OpenGL renderer string: Quadro P1000/PCIe/SSE2 OpenGL core profile version string: 4.6.0 NVIDIA 440.100 OpenGL core profile shading language version string: 4.60 NVIDIA OpenGL core profile context flags: (none) OpenGL core profile profile mask: core profile OpenGL core profile extensions: OpenGL version string: 4.6.0 NVIDIA 440.100 OpenGL shading language version string: 4.60 NVIDIA OpenGL context flags: (none) OpenGL profile mask: (none) OpenGL extensions: OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 440.100 OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20 OpenGL ES profile extensions:

rajkundu commented 5 months ago

I also had an Azure Kinect SDK Error 207/failure to load swrast.

It turned out to be an issue with Anaconda, and this GitHub comment helped immensely. It recommended using conda-forge packages when creating the conda environment (i.e., conda create --name my_env -c conda-forge python=3.11). It worked for me!