Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have a bug that is fatal error: EGL/egl.h: No such file or directory. #94

Closed
BIG-PIE-MILK-COW opened this issue Oct 21, 2022 · 3 comments

Comments

@BIG-PIE-MILK-COW
Copy link

I download nvdiffrast 0.3.0, and here are the errors.

[3/4] c++ -MMD -MF glutil.o.d -DTORCH_EXTENSION_NAME=nvdiffrast_plugin_gl -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_gcc" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1011" -isystem /SSD_DISK/users/anaconda3/envs/get3d1/lib/python3.8/site-packages/torch/include -isystem /SSD_DISK/users/anaconda3/envs/get3d1/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -isystem /SSD_DISK/users/anaconda3/envs/get3d1/lib/python3.8/site-packages/torch/include/TH -isystem /SSD_DISK/users/anaconda3/envs/get3d1/lib/python3.8/site-packages/torch/include/THC -isystem /usr/local/cuda/include -isystem /SSD_DISK/users/anaconda3/envs/get3d1/include/python3.8 -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++14 -DNVDR_TORCH -c /SSD_DISK/users/anaconda3/envs/get3d1/lib/python3.8/site-packages/nvdiffrast/common/glutil.cpp -o glutil.o
FAILED: glutil.o
c++ -MMD -MF glutil.o.d -DTORCH_EXTENSION_NAME=nvdiffrast_plugin_gl -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_gcc" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1011" -isystem /SSD_DISK/users/anaconda3/envs/get3d1/lib/python3.8/site-packages/torch/include -isystem /SSD_DISK/users/anaconda3/envs/get3d1/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -isystem /SSD_DISK/users/anaconda3/envs/get3d1/lib/python3.8/site-packages/torch/include/TH -isystem /SSD_DISK/users/anaconda3/envs/get3d1/lib/python3.8/site-packages/torch/include/THC -isystem /usr/local/cuda/include -isystem /SSD_DISK/users/anaconda3/envs/get3d1/include/python3.8 -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++14 -DNVDR_TORCH -c /SSD_DISK/users/qianjiachen/anaconda3/envs/get3d1/lib/python3.8/site-packages/nvdiffrast/common/glutil.cpp -o glutil.o
In file included from /SSD_DISK/users/anaconda3/envs/get3d1/lib/python3.8/site-packages/nvdiffrast/common/glutil.cpp:14:
/SSD_DISK/users/anaconda3/envs/get3d1/lib/python3.8/site-packages/nvdiffrast/common/glutil.h:36:10: fatal error: EGL/egl.h: No such file or directory
36 | #include <EGL/egl.h>
| ^~~~~~~~~~~
compilation terminated.

@s-laine
Copy link
Collaborator

s-laine commented Oct 24, 2022

On Linux, using the OpenGL-based rasterizer requires that you have both OpenGL and EGL installed. I suggest you take a look at our Dockerfile to see the required libraries and environment variables, or even better, use the Docker environment directly. Note that you will also need the OS-level graphics drivers installed in the system.

Since version v0.3.0 nvdiffrast includes a Cuda-based rasterizer that doesn't require the graphics libraries or drivers. It has some restrictions compared to OpenGL (see documentation) but it could be a working solution in your use case.

@s-laine s-laine closed this as completed Nov 14, 2022
@ming1993li
Copy link

Sorry, I am confused. Can you directly tell how to solve this issue?

@s-laine
Copy link
Collaborator

s-laine commented Jan 12, 2023

You have three options:

  • Use our provided Dockerfile (what is Docker?)
  • Set up your system so that it matches the configuration in the Dockerfile
  • Use RasterizeCudaContext instead of RasterizeGLContext if you're ok with the limitations of the Cuda-based rasterizer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants