stereolabs / zed-sdk

⚡️The spatial perception framework for rapidly building smart robots and spaces
https://stereolabs.com
MIT License
763 stars 452 forks source link

cuda error in docker #116

Closed lyyiangang closed 5 years ago

lyyiangang commented 5 years ago

I meet following erros in docker, when I am trying to compile depth sensing example.

root@8a82230b716d:/usr/local/zed/zed-examples/depth sensing/build# ./ZED_Depth_Sensing 
Error: CUDA - OpenGL Interop failed (63)
ERROR: while compiling Shader :
0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES

ERROR: while compiling vertex shader
ERROR: while compiling Shader :
0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES

ERROR: while compiling fragment shader
ERROR: while compiling Shader :
0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES

ERROR: while compiling vertex shader
ERROR: while compiling Shader :
0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES

ERROR: while compiling fragment shader
Error: CUDA MapResources (33)
Error: CUDA GetMappedPointer (33)
Error: CUDA UnmapResources (33)
Error: CUDA MapResources (33)
Error: CUDA GetMappedPointer (33)
Error: CUDA UnmapResources (33)
Error: CUDA MapResources (33)
Error: CUDA GetMappedPointer (33)
Error: CUDA UnmapResources (33)
Error: CUDA MapResources (33)
Error: CUDA GetMappedPointer (33)
Error: CUDA UnmapResources (33)
Error: CUDA MapResources (33)

the docker file I am using is from https://github.com/stereolabs/zed-docker/blob/master/2.7/ubuntu1604/cuda9.0/devel/Dockerfile.
When run ZED Explorer, I also get following error from ShaderLog.txt.

Compilation log from inner string

0:1(10): error: GLSL 1.50 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES

Strange chars found : ( char - line - col )
    ( # - 1 - 1)
    ( & - 9 - 72)
    ( & - 9 - 73)
    ( & - 9 - 84)
    ( & - 9 - 85)
    ( & - 9 - 96)
    ( & - 9 - 97)

Compilation log from inner string

0:1(10): error: GLSL 1.50 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES

Strange chars found : ( char - line - col )
    ( # - 1 - 1)
    ( & - 9 - 72)
    ( & - 9 - 73)
    ( & - 9 - 84)
    ( & - 9 - 85)
    ( & - 9 - 96)
    ( & - 9 - 97)

here is the screen shot. zed, the picture seems strange.

adujardin commented 5 years ago

Hi, Could you try with the cuda-gl image instead? https://github.com/stereolabs/zed-docker/blob/master/2.7/ubuntu1604/cuda9.0/devel-gl/Dockerfile

lyyiangang commented 5 years ago

@adujardin cuda-gl version still doesn't work for me. I get following error when using cuda-gl docker.

root@ac358619370e:/usr/local/zed/tools# ./ZED\ Explorer 
 ** [SVO] Hardware compression (NVENC) not available **
Could not initialize OpenGL
Aborted (core dumped)

My GPU is Nvidia GTX 1070m. Here is my OpenGL information.

abc@pc:~/abc$ glxinfo | grep "OpenGL"
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: llvmpipe (LLVM 6.0, 256 bits)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 18.0.5
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 18.0.5
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 18.0.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
OpenGL ES profile extensions:

I get following information from nvidia-smi command.

Thu Nov 22 10:20:18 2018       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 410.73       Driver Version: 410.73       CUDA Version: 10.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1070    Off  | 00000000:01:00.0  On |                  N/A |
| N/A   51C    P5    11W /  N/A |    151MiB /  8117MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1365      G   /usr/lib/xorg/Xorg                           149MiB |
+-----------------------------------------------------------------------------+
adujardin commented 5 years ago

The weird image in ZED Explorer is caused by the shader not compiling. What you see is the raw image coming from the camera (YUV).

I tried to reproduce the error but could get exactly the same behavior. Without the "gl" image, ZED Explorer won't work and using the gl image, everything work as expected. You should make sure that you run the image with the correct permissions/parameters (https://github.com/stereolabs/zed-docker#opengl-support).

It's worth noting that I'm using Ubuntu 1604 and CUDA 9 on the host, to run an image that matches my configuration. It shouldn't be an issue though. Just in case there is a version conflict, I pushed the ubuntu1604-cuda10.0-zed2.7-gl image, you should try it.

lyyiangang commented 5 years ago

I installed graphic card driver like this:'./nv_driver.run -s -no-opengl-files, and the OpenGL files are not updated. I try to reinstall the driver without '-no-opengl-files, the cuda-gl docker image works for me now.