WindowGLFW: Failed create window

I am exploring NVIDIA’s drive software for exploring the driveworks package. I was successfully able to install drive sdk and all my binaries are created in /usr/local/driveworks/bin. I was also able to run the ./sample_hello_word example, and the following is the output of the same:

Welcome to Driveworks SDK
[13-05-2020 06:16:32] Platform: Detected Generic x86 Platform
[13-05-2020 06:16:32] Initialize DriveWorks SDK v2.0.2081
[13-05-2020 06:16:32] Release build with GNU 4.9.4 from heads/buildbrain-branch-0-g36b127f
[13-05-2020 06:16:32] TimeSource: monotonic epoch time offset is 1589299953526456
[13-05-2020 06:16:33] Platform: number of GPU devices detected 4
[13-05-2020 06:16:33] Platform: currently selected GPU device discrete ID 0
[13-05-2020 06:16:33] SDK: Resources mounted from /usr/local/driveworks-2.0/data/
Context of Driveworks SDK successfully initialized.
Version: 2.0.2081
GPU devices detected: 4
[13-05-2020 06:16:33] Platform: currently selected GPU device discrete ID 0
----------------------------------------------
Device: 0, GeForce GTX 1080
CUDA Driver Version / Runtime Version : 10.2 / 10.0
CUDA Capability Major/Minor version number: 6.1
Total amount of global memory in MBytes:8116.44
Memory Clock rate Khz: 5005000
Memory Bus Width bits: 256
L2 Cache Size: 2097152
Maximum 1D Texture Dimension Size (x): 131072
Maximum 2D Texture Dimension Size (x,y): 131072, 65536
Maximum 3D Texture Dimension Size (x,y,z): 16384, 16384, 16384
Maximum Layered 1D Texture Size, (x): 32768 num: 2048
Maximum Layered 2D Texture Size, (x,y): 32768, 32768 num: 2048
Total amount of constant memory bytes: 65536
Total amount of shared memory per block bytes: 49152
Total number of registers available per block: 65536
Warp size: 32
Maximum number of threads per multiprocessor: 2048
Maximum number of threads per block: 1024
Max dimension size of a thread block (x,y,z): 1024,1024,64
Max dimension size of a grid size (x,y,z): 2147483647,65535,65535
Maximum memory pitch bytes: 2147483647
Texture alignment bytes: 512
Concurrent copy and kernel execution: Yes, copy engines num: 2
Run time limit on kernels: Yes
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
Device supports Unified Addressing (UVA): Yes
Device PCI Domain ID: 0, Device PCI Bus ID: 5, Device PCI location ID: 0
Compute Mode: Default (multiple host threads can use ::cudaSetDevice() with device simultaneously)
Concurrent kernels: 1
Concurrent memory: 1

[13-05-2020 06:16:33] Platform: currently selected GPU device discrete ID 1
----------------------------------------------
Device: 1, GeForce GTX 1080
CUDA Driver Version / Runtime Version : 10.2 / 10.0
CUDA Capability Major/Minor version number: 6.1
Total amount of global memory in MBytes:8119.56
Memory Clock rate Khz: 5005000
Memory Bus Width bits: 256
L2 Cache Size: 2097152
Maximum 1D Texture Dimension Size (x): 131072
Maximum 2D Texture Dimension Size (x,y): 131072, 65536
Maximum 3D Texture Dimension Size (x,y,z): 16384, 16384, 16384
Maximum Layered 1D Texture Size, (x): 32768 num: 2048
Maximum Layered 2D Texture Size, (x,y): 32768, 32768 num: 2048
Total amount of constant memory bytes: 65536
Total amount of shared memory per block bytes: 49152
Total number of registers available per block: 65536
Warp size: 32
Maximum number of threads per multiprocessor: 2048
Maximum number of threads per block: 1024
Max dimension size of a thread block (x,y,z): 1024,1024,64
Max dimension size of a grid size (x,y,z): 2147483647,65535,65535
Maximum memory pitch bytes: 2147483647
Texture alignment bytes: 512
Concurrent copy and kernel execution: Yes, copy engines num: 2
Run time limit on kernels: No
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
Device supports Unified Addressing (UVA): Yes
Device PCI Domain ID: 0, Device PCI Bus ID: 6, Device PCI location ID: 0
Compute Mode: Default (multiple host threads can use ::cudaSetDevice() with device simultaneously)
Concurrent kernels: 1
Concurrent memory: 1

[13-05-2020 06:16:33] Platform: currently selected GPU device discrete ID 2
----------------------------------------------
Device: 2, GeForce GTX 1080
CUDA Driver Version / Runtime Version : 10.2 / 10.0
CUDA Capability Major/Minor version number: 6.1
Total amount of global memory in MBytes:8119.56
Memory Clock rate Khz: 5005000
Memory Bus Width bits: 256
L2 Cache Size: 2097152
Maximum 1D Texture Dimension Size (x): 131072
Maximum 2D Texture Dimension Size (x,y): 131072, 65536
Maximum 3D Texture Dimension Size (x,y,z): 16384, 16384, 16384
Maximum Layered 1D Texture Size, (x): 32768 num: 2048
Maximum Layered 2D Texture Size, (x,y): 32768, 32768 num: 2048
Total amount of constant memory bytes: 65536
Total amount of shared memory per block bytes: 49152
Total number of registers available per block: 65536
Warp size: 32
Maximum number of threads per multiprocessor: 2048
Maximum number of threads per block: 1024
Max dimension size of a thread block (x,y,z): 1024,1024,64
Max dimension size of a grid size (x,y,z): 2147483647,65535,65535
Maximum memory pitch bytes: 2147483647
Texture alignment bytes: 512
Concurrent copy and kernel execution: Yes, copy engines num: 2
Run time limit on kernels: No
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
Device supports Unified Addressing (UVA): Yes
Device PCI Domain ID: 0, Device PCI Bus ID: 9, Device PCI location ID: 0
Compute Mode: Default (multiple host threads can use ::cudaSetDevice() with device simultaneously)
Concurrent kernels: 1
Concurrent memory: 1

[13-05-2020 06:16:33] Platform: currently selected GPU device discrete ID 3
----------------------------------------------
Device: 3, GeForce GTX 1080
CUDA Driver Version / Runtime Version : 10.2 / 10.0
CUDA Capability Major/Minor version number: 6.1
Total amount of global memory in MBytes:8119.56
Memory Clock rate Khz: 5005000
Memory Bus Width bits: 256
L2 Cache Size: 2097152
Maximum 1D Texture Dimension Size (x): 131072
Maximum 2D Texture Dimension Size (x,y): 131072, 65536
Maximum 3D Texture Dimension Size (x,y,z): 16384, 16384, 16384
Maximum Layered 1D Texture Size, (x): 32768 num: 2048
Maximum Layered 2D Texture Size, (x,y): 32768, 32768 num: 2048
Total amount of constant memory bytes: 65536
Total amount of shared memory per block bytes: 49152
Total number of registers available per block: 65536
Warp size: 32
Maximum number of threads per multiprocessor: 2048
Maximum number of threads per block: 1024
Max dimension size of a thread block (x,y,z): 1024,1024,64
Max dimension size of a grid size (x,y,z): 2147483647,65535,65535
Maximum memory pitch bytes: 2147483647
Texture alignment bytes: 512
Concurrent copy and kernel execution: Yes, copy engines num: 2
Run time limit on kernels: No
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
Device supports Unified Addressing (UVA): Yes
Device PCI Domain ID: 0, Device PCI Bus ID: 10, Device PCI location ID: 0
Compute Mode: Default (multiple host threads can use ::cudaSetDevice() with device simultaneously)
Concurrent kernels: 1
Concurrent memory: 1

[13-05-2020 06:16:33] Driveworks SDK released
Happy autonomous driving!

But when I try to run the sample dnn plugin ./sample_dnn_plugin I get WindowGLFW: Failed create window error, Initially I was running in cuda 9.2 and was still facing the problem after seeing @SivaRamaKrishnaNV post I tried updating my CUDA to 10.2 but still facing the same issue. Any leads will be really helpful. Thanks in advance.

Dear @sparth21,
Please share ldd of the executable and also nvidia-smi output.

output of lld ./sample_dnn_plugin

linux-vdso.so.1 =>  (0x00007fffb23d6000)
libdriveworks.so.2 => /usr/local/driveworks-2.0/bin/./../lib/libdriveworks.so.2 (0x00007fcd09d23000)
libdriveworks_visualization.so.2 => /usr/local/driveworks-2.0/bin/./../lib/libdriveworks_visualization.so.2 (0x00007fcd097eb000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fcd095ce000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007fcd09294000)
libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007fcd0908e000)
libXinerama.so.1 => /usr/lib/x86_64-linux-gnu/libXinerama.so.1 (0x00007fcd08e8b000)
libXcursor.so.1 => /usr/lib/x86_64-linux-gnu/libXcursor.so.1 (0x00007fcd08c81000)
libXrandr.so.2 => /usr/lib/x86_64-linux-gnu/libXrandr.so.2 (0x00007fcd08a76000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fcd08872000)
libGL.so.1 => /usr/lib/nvidia-440/libGL.so.1 (0x00007fcd085c9000)
libcudart.so.10.0 => /usr/local/cuda/lib64/libcudart.so.10.0 (0x00007fcd0834f000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fcd07f6c000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fcd07c63000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fcd07a4b000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fcd07681000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fcd07479000)
libcuda.so.1 => /usr/lib/x86_64-linux-gnu/libcuda.so.1 (0x00007fcd06273000)
libusb-1.0.so.0 => /lib/x86_64-linux-gnu/libusb-1.0.so.0 (0x00007fcd0605b000)
libnvcuvid.so.1 => /usr/lib/nvidia-440/libnvcuvid.so.1 (0x00007fcd05b47000)
libnvinfer.so.5 => /usr/local/driveworks-2.0/bin/./../lib/../lib/libnvinfer.so.5 (0x00007fccfe6d7000)
libnvparsers.so.5 => /usr/local/driveworks-2.0/bin/./../lib/../lib/libnvparsers.so.5 (0x00007fccfe1bb000)
libnvmedia.so => /usr/local/driveworks-2.0/bin/./../lib/../lib/libnvmedia.so (0x00007fccfdfa1000)
libnvmedia_ipp.so => /usr/local/driveworks-2.0/bin/./../lib/../lib/libnvmedia_ipp.so (0x00007fccfdb41000)
libnvmedia_acp.so => /usr/local/driveworks-2.0/bin/./../lib/../lib/libnvmedia_acp.so (0x00007fccfd936000)
libnv_extimgdev.so => /usr/local/driveworks-2.0/bin/./../lib/../lib/libnv_extimgdev.so (0x00007fccfd6be000)
libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007fccfd487000)
/lib64/ld-linux-x86-64.so.2 (0x00007fcd0b357000)
libGLU.so.1 => /usr/lib/x86_64-linux-gnu/libGLU.so.1 (0x00007fccfd218000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fccfcff6000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007fccfcde4000)
libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007fccfcbda000)
libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007fccfc9d4000)
libGLX.so.0 => /usr/lib/nvidia-440/libGLX.so.0 (0x00007fccfc7a4000)
libGLdispatch.so.0 => /usr/lib/nvidia-440/libGLdispatch.so.0 (0x00007fccfc4d1000)
libudev.so.1 => /lib/x86_64-linux-gnu/libudev.so.1 (0x00007fcd0b51c000)
libcudnn.so.7 => /usr/local/driveworks-2.0/bin/./../lib/../lib/libcudnn.so.7 (0x00007fcce7865000)
libcublas.so.10.0 => /usr/local/cuda/lib64/libcublas.so.10.0 (0x00007fcce32ce000)
libnvtvmr.so => /usr/local/driveworks-2.0/bin/./../lib/../lib/libnvtvmr.so (0x00007fcce30bf000)
libnvmedia_isc.so => /usr/local/driveworks-2.0/bin/./../lib/../lib/libnvmedia_isc.so (0x00007fcce2eb9000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007fcce2cb5000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fcce2aaf000)

output of nvidia-smi

Wed May 13 07:25:32 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.64.00    Driver Version: 440.64.00    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  GeForce GTX 1080    Off  | 00000000:05:00.0 Off |                  N/A |
| 32%   52C    P8     8W / 180W |     52MiB /  8116MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   1  GeForce GTX 1080    Off  | 00000000:06:00.0 Off |                  N/A |
| 32%   50C    P8     8W / 180W |      2MiB /  8119MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   2  GeForce GTX 1080    Off  | 00000000:09:00.0 Off |                  N/A |
| 31%   49C    P8     8W / 180W |      2MiB /  8119MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   3  GeForce GTX 1080    Off  | 00000000:0A:00.0 Off |                  N/A |
| 30%   47C    P8     8W / 180W |      2MiB /  8119MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1966      G   /usr/lib/xorg/Xorg                            49MiB |
+-----------------------------------------------------------------------------+

Some more addtional information, I am using ubuntu 16.04 and doing a ssh into the host system from my windows machine with X11 enabled, and xming running in my windows system. I tested my X11 connection and was able to view some image from my host machine using the eog command and it seems to work fine. I have installed hyperion_5.1.0.2_SDK which is compatible with the ubuntu version I use.

Hi @sparth21,

  1. please do not install different CUDA versions then what was is installed by default using the SDK Manager.
    DW software and other dependencies can face issues while running if you do that as they are all dependent on CUDA.
    the CUDA version that comes with the SDK Manager installation is compatible with all the software needed for your development.

  2. the sample “sample_hello_world” is the only one that does not open a window for graphic display, and therefore that sample ran successfully.
    the error “WindowGLFW: Failed create window” describes a situation where a graphic window could not be opened.
    you are probably using ssh connection to run the sample, or you don’t have a display connected to your device.

  • in case you have a display connected to your device and you are using ssh to execute the sample remotely please make sure that the environment variable DISPLAY is set (usually set to 0 if only one display is connected - execute export DISPLAY=:0 before running the sample)
  • in case you don’t have a display connected to your device or you have one connected but do not want to run the sample with a graphical display, you can use the input parameter --offscreen=true for the running the sample and the sample will run with no graphical display.
2 Likes

Hi @shayNV,
Thanks for your input, there are attempts:

  1. I uninstalled my DW software and tried installing it again to make sure I didn’t change any installation w.r.t to CUDA,
  2. As you rightly pointed out since I am able to run sample_hello_word and not any other samples the issue is w.r.t using the graphic for display. As I mentioned I have installed DW in ubuntu 16.04 host which has a display and I am doing an ssh into it to execute these commands, I have also enabled X11 port forwarding and able to access my host machine’s screen for viewing any images which ensures that my X11 is infact working
  3. The environment variable DISPLAY is already set for me and it’s value is localhost:10.0
  4. I in fact tried running headless using the --offscreen=true command but I still get the same WindowGLFW: Failed create window error.

I am really clueless as to what is happening, any help to get it working will be really appreciated.

Hi @sparth21,

  1. make sure you have glfw installed (should be) and install it by:
    sudo apt-get install libglfw3-dev libglfw3
  2. are you abe able to run one of the graphic samples directly on the machine and not through ssh to make sure that is the problem?
  3. please try not to enable X11 port forwarding and run export DISPLAY=:0 in your regular ssh connection to set the default screen for X11 and then run the sample.
  4. please try using --offscreen=1 (instead of true use 1)

thanks

Thanks a lot for your response @shayNV

  1. I installed all the glfw packages, in fact they were already installed, so the install command didn’t have any effect
  2. I currently don’t have direct access to my host machine, so the only was to access it is via ssh with X11 enabled and xming running on the my window’s machine from which I do ssh, so I am not able to run them directly.
  3. I ran export DISPLAY=:0 after doing a ssh into my host machine and tried running the sample_dnn_plugin but I got the following
    No protocol specified
    WindowGLFW: Failed initialize GLFW
    My default value for DISPLAY was localhost:10.0 and I was able to access the GUI of my host machine from my windows machine (tried viewing some images using the eog command, and it works fine)
  4. --offscreen=1 also resulted in the same error

I feel something is going wrong with my X11 forwarding. Is there anything that I could try now?

Hi @sparth21,
well it seems you are having a blocking issue not related to the DW software.
I’d suggest you start by running a simple sample of GLFW windowing app to test your system.

I have attached a sample code for that. it simply opens an empty window, to compile it use the following command: g++ helloWindow.cpp -lglfw -lGL -o helloWindow
helloWindow.cpp.txt (1.1 KB)
once that works for you then the samples of DriveWorks should work too.

I suggest looking for a solution to your specific problem of your setup in relevant forums on the web.

good luck

Hi @shayNV,
Thank you for your response. I tried compiling your sample code and ran it, and this is what I got:

sparth21@Admin:~/NVIDIA-SDK$ ./helloWindow
Error code=65544, message=X11: RandR gamma ramp support seems broken
Error code=65542, message=GLX: GLX version 1.3 is required
init failed

Do I have to change anything with respect to GLX??
Thanks in advance.

Hello @sparth21,
I am not familiar with the second error you are having, but the problem seems to be related to this.
the way to install glx on your machine is to run:
sudo apt-get install -y libgl1-mesa- glx

please try it.

Hi @shayNV,
It turns out that I have already installed libgl1-mesa-glx executing the above command didn’t have any impact. However, I just tried checking the version of glx installed in my machine and this is what I got:

sparth21@Admin:~$ glxinfo | grep version
server glx version string: 1.2
client glx version string: 1.4
GLX version: 1.2
OpenGL version string: 1.2 (1.5 Mesa 6.4.1)

Turns out that I have GLX 1.2 installed but this error Error code=65542, message=GLX: GLX version 1.3 is required, says it needs version 1.3. I tried upgrading GLX using sudo apt-get upgrade libgl1-mesa-glx but it didn’t seem to get upgraded. Any idea on how to do this?

On the other hand, instead of having xming when I use MobaXterm for starting X server and execute your program ./helloWindow, I am able to run it without any error as shown below:


However when I try to run the ./sample_dnn_plugin I still get the Failed create window error. Sorry for bugging you like this, but I am not able to fix this nor able to find support in internet.

Also this is the output of ./sample_hello_world (for one of the devices)

Device: 3, GeForce GTX 1080
CUDA Driver Version / Runtime Version : 10.2 / 10.0
CUDA Capability Major/Minor version number: 6.1
Total amount of global memory in MBytes:8119.56
Memory Clock rate Khz: 5005000
Memory Bus Width bits: 256
L2 Cache Size: 2097152
Maximum 1D Texture Dimension Size (x): 131072
Maximum 2D Texture Dimension Size (x,y): 131072, 65536
Maximum 3D Texture Dimension Size (x,y,z): 16384, 16384, 16384
Maximum Layered 1D Texture Size, (x): 32768 num: 2048
Maximum Layered 2D Texture Size, (x,y): 32768, 32768 num: 2048
Total amount of constant memory bytes: 65536
Total amount of shared memory per block bytes: 49152
Total number of registers available per block: 65536
Warp size: 32
Maximum number of threads per multiprocessor: 2048
Maximum number of threads per block: 1024
Max dimension size of a thread block (x,y,z): 1024,1024,64
Max dimension size of a grid size (x,y,z): 2147483647,65535,65535
Maximum memory pitch bytes: 2147483647
Texture alignment bytes: 512
Concurrent copy and kernel execution: Yes, copy engines num: 2
Run time limit on kernels: No
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
Device supports Unified Addressing (UVA): Yes
Device PCI Domain ID: 0, Device PCI Bus ID: 10, Device PCI location ID: 0
Compute Mode: Default (multiple host threads can use ::cudaSetDevice() with device simultaneously)
Concurrent kernels: 1
Concurrent memory: 1

Might throw some light on what is happening under the hood.

Hi @sparth21,

I think getting “no protocol specified” error is when running gui application on remote with sudo (root privileges).

when the DISPLAY variable is set to localhost:10.0 it means you are still trying to enable X11 port forwarding(like using mobaXterm) and that would not work. you must have a display physically connected to your computer to have graphic windowing support on Ubuntu.

using port forwarding of X11 enables support of opengl <=1.5 while the DW samples require a higher version (>4.3). (that is why you were able to run the simple window and not a more complex app like the DW sample)
to test the correct requirements please consider this attached updated sample code for glfw.helloWindow.cpp.txt (1.3 KB)
compile command: g++ helloWindow.cpp -lglfw -lGL -o helloWindow

the recommended way to run the samples is directly on a host computer(no ssh or using ssh while setting the DISPLAY variable to the id of the display that is physically connected) or on the Drive platform.
please try that first and then other alternatives.
otherwise, I’d recommend you post your question to the relevant forum.

good luck.

1 Like

Thanks for your response @shayNV, when I compiled your updated helloWindow.cpp and ran it, this is what I got:

sparth21@Admin:~/NVIDIA-SDK$ ./helloWindow1
Error code=65543, message=GLX: Failed to create context: GLXBadFBConfig
failed to create window

But as mentioned earlier, I was able to run the previous version of your helloWindow.cpp.

As you directed, I will try to get access to the host machine directly and run these commands and let you know. Thanks for your assistance and patience.

1 Like