Pangolin
Pangolin copied to clipboard
HelloPangolinOffscreen produces blank image.
The HelloPangolin example seems to build without errors. However, the generated image is just a blank 640 x 480 image (1.3kb called window.png). It seems to me that the code should be saving a cube. Here is the build output:
matt@mattpc:~/Desktop/scripts/Pangolin/examples/HelloPangolinOffscreen$ mkdir build
matt@mattpc:~/Desktop/scripts/Pangolin/examples/HelloPangolinOffscreen$ cd build/
matt@mattpc:~/Desktop/scripts/Pangolin/examples/HelloPangolinOffscreen/build$ cmake ..
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/matt/Desktop/scripts/Pangolin/examples/HelloPangolinOffscreen/build
matt@mattpc:~/Desktop/scripts/Pangolin/examples/HelloPangolinOffscreen/build$ make
Scanning dependencies of target HelloPangolinOffscreen
[ 50%] Building CXX object CMakeFiles/HelloPangolinOffscreen.dir/main.cpp.o
[100%] Linking CXX executable HelloPangolinOffscreen
[100%] Built target HelloPangolinOffscreen
matt@mattpc:~/Desktop/scripts/Pangolin/examples/HelloPangolinOffscreen/build$ ./HelloPangolinOffscreen
matt@mattpc:~/Desktop/scripts/Pangolin/examples/HelloPangolinOffscreen/build$
same here @christian-rauch
system: Ubuntu 16.04 egl version: 18.0.5 Nvidia driver version: 384.130
When I change the code from:
pangolin::CreateWindowAndBind("Main",640,480,pangolin::Params({{"scheme", "nogui"}}));//headless
to:
pangolin::CreateWindowAndBind("Main", 640, 480);//with gui
It does output a cube.
It seems a nvidia driver issues discussed in #389 and #443
Yes, this is certainly a bug in the nvidia driver. Can you try to update the nvidia drivers via the Ubuntu 16.04 CUDA repo? You do not need to install CUDA, just the "official" driver from the repo.
Edit: Can you also check if this minimal EGL test program works: https://github.com/christian-rauch/egltri
This definitely works in Ubuntu 18.04 with nvidia 410.79.
I am getting this image (the background is transparent):
Thank you for your quick response! The mini EGL program doesn't work and the window stays black.
I'll have a try with Ubuntu 18 on another PC next week.
According to this response in the nvidia forum, you might also be able to solve this by installing the driver with the .run installer from nvidia. However, I do not recommend to install the driver using the binary installer since it's likely that it will break after a kernel update and will interfere with other graphical components on your desktop.
If you can, switching to Ubuntu 18.04 is the more stable way to make EGL and true offscreen rendering work.
I tried this on an old computer with integrated graphics. Specifically,
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
Does Pangolin need an Nvidia GPU to work?
The offscreen example gives me a blank image on Ubuntu 18.04 with an "Intel HD Graphics 5500".
But the X11/EGL Pangolin examples and egltri
work. So this might rather be an offscreen configuration issue than a driver bug related to EGL.
As a workaround, you can try to render into a dedicated frame buffer object. I extended the offscreen rendering example in https://github.com/stevenlovegrove/Pangolin/pull/484 to additionally render into an FBO.
Can you try if FBO rendering works on your intel and Ubuntu 16 + nvidia setup? The example should write an image fbo.png
that has the same content as what should be exported in window.png
(the pixel buffer).
The issue with intel drivers reading from a pixel buffer in a regular OpenGL (non ES) context is a known driver issue: https://bugs.freedesktop.org/show_bug.cgi?id=108977 .
Reading from the pixel buffers works only after additionally creating the FBO (see also: https://stackoverflow.com/questions/28817777/pbuffer-vs-fbo-in-egl-offscreen-rendering). I.e. the offscreen example with the additional FBO will correctly export the pixel buffer into the window.png
file.