habitat-sim
habitat-sim copied to clipboard
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?
Please run again with export MAGNUM_LOG=verbose MAGNUM_GPU_VALIDATION=ON
Please run again with
export MAGNUM_LOG=verbose MAGNUM_GPU_VALIDATION=ON
I have tried this. Unfortunately, it seems not to work and the same bugs still exist.
Is there no additional information printed? If so that likely indicates a driver bug or similar.
Is there no additional information printed? If so that likely indicates a driver bug or similar.
I tried
python examples/example.py --scene /Replica-Dataset/dataset/apartment_0/habitat/mesh_semantic.ply --save_png --semantic_sensor --max_frame 20
Here is the information printed:
sim_cfg.physics_config_file = ./data/default.physics_config.json
WARNING: Logging before InitGoogleLogging() is written to STDERR
I1003 13:42:57.914039 29584 ManagedFileBasedContainer.h:210] <Dataset>::convertFilenameToPassedExt : Filename : default changed to proposed scene_dataset_config.json filename : default.scene_dataset_config.json
I1003 13:42:57.914077 29584 AttributesManagerBase.h:365] <Dataset>::createFromJsonOrDefaultInternal : Proposing JSON name : default.scene_dataset_config.json from original name : default | This file does not exist.
I1003 13:42:57.914203 29584 AssetAttributesManager.cpp:120] Asset attributes (capsule3DSolid : capsule3DSolid_hemiRings_4_cylRings_1_segments_12_halfLen_0.75_useTexCoords_false_useTangents_false) created and registered.
I1003 13:42:57.914281 29584 AssetAttributesManager.cpp:120] Asset attributes (capsule3DWireframe : capsule3DWireframe_hemiRings_8_cylRings_1_segments_16_halfLen_1) created and registered.
I1003 13:42:57.914352 29584 AssetAttributesManager.cpp:120] Asset attributes (coneSolid : coneSolid_segments_12_halfLen_1.25_rings_1_useTexCoords_false_useTangents_false_capEnd_true) created and registered.
I1003 13:42:57.914392 29584 AssetAttributesManager.cpp:120] Asset attributes (coneWireframe : coneWireframe_segments_32_halfLen_1.25) created and registered.
I1003 13:42:57.914415 29584 AssetAttributesManager.cpp:120] Asset attributes (cubeSolid : cubeSolid) created and registered.
I1003 13:42:57.914434 29584 AssetAttributesManager.cpp:120] Asset attributes (cubeWireframe : cubeWireframe) created and registered.
I1003 13:42:57.914489 29584 AssetAttributesManager.cpp:120] Asset attributes (cylinderSolid : cylinderSolid_rings_1_segments_12_halfLen_1_useTexCoords_false_useTangents_false_capEnds_true) created and registered.
I1003 13:42:57.914538 29584 AssetAttributesManager.cpp:120] Asset attributes (cylinderWireframe : cylinderWireframe_rings_1_segments_32_halfLen_1) created and registered.
I1003 13:42:57.914566 29584 AssetAttributesManager.cpp:120] Asset attributes (icosphereSolid : icosphereSolid_subdivs_1) created and registered.
I1003 13:42:57.914589 29584 AssetAttributesManager.cpp:120] Asset attributes (icosphereWireframe : icosphereWireframe_subdivs_1) created and registered.
I1003 13:42:57.914623 29584 AssetAttributesManager.cpp:120] Asset attributes (uvSphereSolid : uvSphereSolid_rings_8_segments_16_useTexCoords_false_useTangents_false) created and registered.
I1003 13:42:57.914656 29584 AssetAttributesManager.cpp:120] Asset attributes (uvSphereWireframe : uvSphereWireframe_rings_16_segments_32) created and registered.
I1003 13:42:57.914671 29584 AssetAttributesManager.cpp:108] ::constructor : Built default primitive asset templates : 12
I1003 13:42:57.915589 29584 SceneDatasetAttributesManager.cpp:36] File (default) not found, so new default dataset attributes created and registered.
I1003 13:42:57.915603 29584 MetadataMediator.cpp:127] ::createSceneDataset : Dataset default successfully created.
I1003 13:42:57.915621 29584 AttributesManagerBase.h:365] <Physics Manager>::createFromJsonOrDefaultInternal : Proposing JSON name : ./data/default.physics_config.json from original name : ./data/default.physics_config.json | This file exists.
I1003 13:42:57.916173 29584 PhysicsAttributesManager.cpp:26] JSON Configuration File (./data/default.physics_config.json) based physics manager attributes created and registered.
I1003 13:42:57.916191 29584 MetadataMediator.cpp:212] ::setActiveSceneDatasetName : Previous active dataset changed to default successfully.
I1003 13:42:57.916199 29584 MetadataMediator.cpp:183] ::setCurrPhysicsAttributesHandle : Old physics manager attributes changed to ./data/default.physics_config.json successfully.
I1003 13:42:57.916211 29584 MetadataMediator.cpp:68] ::setSimulatorConfiguration : Set new simulator config for scene/stage : /Replica-Dataset/dataset/apartment_0/habitat/mesh_semantic.ply and dataset : default which is currently active dataset.
Platform::WindowlessEglApplication::tryCreateContext(): cannot get default EGL display: EGL_BAD_PARAMETER
WindowlessContext: Unable to create windowless context
Sorry I am not sure if this if of a driver bug or not.
Likely a driver issue. Headless mode requires a recent(ish) nvidia gpu with nvidia's opengl libraries (those are installed by default with a default driver install).
Likely a driver issue. Headless mode requires a recent(ish) nvidia gpu with nvidia's opengl libraries (those are installed by default with a default driver install).
I see. Would you please tell me if there is anything I can do to handle the driver issue? Do I need to install the OpenGL lib manually?
You shouldn't need to manually install them, they are installed as part of a normal driver install
You shouldn't need to manually install them, they are installed as part of a normal driver install
I’m still confused because there are nvidia gpus on my cluster. I suppose the libraries are installed by default. But the driver issue still exists.
Possibly not. Others have opened issues here because their cluster admins did not install nvidia's opengl libs. Please talk to them.
Possibly not. Others have opened issues here because their cluster admins did not install nvidia's opengl libs. Please talk to them.
Sure. I really appreciate for your help!
This issue seems to be resolved.
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!)
- run
nvidia-smito check the version of your driver - download the driver installation binary from NVIDIA directly. You can do this by searching
nvidia driver <version-id>on google. The file should beNVIDIA-Linux-x86_64-<version-id>.run - 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
- 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
- Add this folder to your LD search path
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/NVIDIA-Linux-x86_64-<version-id>
- 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>.
- You're good to go! Just follow this to verify your
habitat-siminstallation.
Thanks @jeasinema for this. Would you mind sending a PR to add this information to https://github.com/facebookresearch/habitat-sim/blob/main/BUILD_FROM_SOURCE.md#common-build-issues
@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!
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 #851 as well!)
- run
nvidia-smito check the version of your driver- download the driver installation binary from NVIDIA directly. You can do this by searching
nvidia driver <version-id>on google. The file should beNVIDIA-Linux-x86_64-<version-id>.run- 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
- 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
- Add this folder to your LD search path
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/NVIDIA-Linux-x86_64-<version-id>
- 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.0andlibGLdispatch.so.0should be all pointed to the ones in/path/to/NVIDIA-Linux-x86_64-<version-id>.
- You're good to go! Just follow this to verify your
habitat-siminstallation.
That seems like I still can not run well. Following is my wrong message. That seems like Ican not use opencv now.
Traceback (most recent call last):
File "/data5/xrh/navigation/habitat3/habitat-lab/examples/example.py", line 9, in