NVlabs / nvdiffrast

Nvdiffrast - Modular Primitives for High-Performance Differentiable Rendering
Other
1.29k stars 139 forks source link

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

Closed BIG-PIE-MILK-COW closed 1 year ago

BIG-PIE-MILK-COW commented 1 year ago

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 commented 1 year ago

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.

ming1993li commented 1 year ago

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

s-laine commented 1 year ago

You have three options: