habitat-sim: Platform::WindowlessEglApplication::tryCreateContext(): cannot get default EGL display: EGL_BAD_PARAMETER

I tried to render data from Replica dataset with python examples/example.py --scene I have installed the Habitat with

conda create -n habitat python=3.6 cmake=3.14.0
conda activate habitat

Then I got the error:

Platform::WindowlessEglApplication::tryCreateContext(): cannot get default EGL display: EGL_BAD_PARAMETER
WindowlessContext: Unable to create windowless context

Could you please help me to solve this issue?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

Just in case someone needs this: here is a solution for those who don’t want to use docker and happen to use a server that does not install EGL* along with NVIDIA driver by default. (cross-posted to https://github.com/facebookresearch/habitat-sim/issues/851 as well!)

  1. run nvidia-smi to check the version of your driver
  2. download the driver installation binary from NVIDIA directly. You can do this by searching nvidia driver <version-id> on google. The file should be NVIDIA-Linux-x86_64-<version-id>.run
  3. extract the binary without running. This will create a folder named NVIDIA-Linux-x86_64-<version-id>
sh NVIDIA-Linux-x86_64-<version-id>.run --extract-only   
  1. create some simlinks
cd NVIDIA-Linux-x86_64-<version-id>
ln -s ./libEGL.so.<version-id>  libEGL.so.1 # note: there might be a libEGL_nvidia*, do not symlink it as libEGL.so.1 instead!
ln -s ./libGL.so.<version> libGL.so.1      
  1. Add this folder to your LD search path
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/NVIDIA-Linux-x86_64-<version-id>
  1. Check your habitat linker (Thanks @erikwijmans for this!)
cd
ldd $(python -c "import habitat_sim; print(habitat_sim._ext.habitat_sim_bindings.__file__)")

Note that libEGL.so.1, libOpenGL.so.0 and libGLdispatch.so.0 should be all pointed to the ones in /path/to/NVIDIA-Linux-x86_64-<version-id>.

  1. You’re good to go! Just follow this to verify your habitat-sim installation.

@jeasinema Hi, thanks for the information! I’m trying to manually install the missing EGL libraries as you mentioned above. I have driver version 515.105.01 installed (without opengl support). I see in the NVIDIA-Linux-x86_64-<driver_version> folder that there is libEGL_nvidia.so.<driver_version>, do I need to symlink this too?

Update: I additionally added the symlink on libEGL_nvidia.so.<driver_version> to libEGL_nvidia.so.0. I can confirm that the method above by @jeasinema works well to resolve the issue (without asking admin to update opengl support). Thanks a lot!