Comments (24)
@YuDeng hello, I also encounter [F glutil.cpp:338] eglInitialize() failed
when running the inference code. My system environment is nvidia driver 450.80.02 and cuda 11.0. I already have a basic pytorch environment so only install OpenGL related libraries in my system environment (not docker environment) as suggested above. Specifically, I did the following steps:
- I organize the contents of the dockerfile (provided by @yuzhou164) into an environment.sh:
apt-get update && apt-get install -y --no-install-recommends \
pkg-config \
libglvnd0 \
libgl1 \
libglx0 \
libegl1 \
libgles2 \
libglvnd-dev \
libgl1-mesa-dev \
libegl1-mesa-dev \
libgles2-mesa-dev \
cmake \
curl \
libsm6 \
libxext6 \
libxrender-dev
# export PYTHONDONTWRITEBYTECODE=1
export PYTHONUNBUFFERED=1
# for GLEW
export LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH
# nvidia-container-runtime
export NVIDIA_VISIBLE_DEVICES=all
export NVIDIA_DRIVER_CAPABILITIES=compute,utility,graphics
# Default pyopengl to EGL for good headless rendering support
export PYOPENGL_PLATFORM=egl
cp docker/10_nvidia.json /usr/share/glvnd/egl_vendor.d/10_nvidia.json
pip install --upgrade pip
pip install ninja imageio imageio-ffmpeg
- Run this environment.sh:
sudo bash environment.sh
- Re-install nvdiffrast:
cd nvdiffrast # ./Deep3DFaceRecon_pytorch/nvdiffrast
pip install .
I want to know if it is really caused by the nvidia driver version or some other problems.
Looking forward to your reply.
from deep3dfacerecon_pytorch.
Solution
Replace all
dr.RasterizeGLContext
todr.RasterizeCudaContext
I have tried different images using docker, and all failed with the same error. But this works for me. And these codes are located in util/nvdiffrast.py Line 62. I do like this:
if self.ctx is None:
self.ctx = dr.RasterizeCudaContext(device=device)
ctx_str = "cuda"
# if self.use_opengl:
# self.ctx = dr.RasterizeGLContext(device=device)
# ctx_str = "opengl"
# else:
# self.ctx = dr.RasterizeCudaContext(device=device)
# ctx_str = "cuda"
# print("create %s ctx on device cuda:%d"%(ctx_str, device.index))
from deep3dfacerecon_pytorch.
nvdiffrast.zip
Hi, This ZIP package includes a dockerfile with requirement.txt for this Deep3DFaceRecon_pytorch project.
The command to build the environment is docker build -f docker/Dockerfile -t name:tagname .
One thing needs attention is that the version correspondence between version Cuda and version Nvidia Driver . Please refers the Nvidia website
from deep3dfacerecon_pytorch.
Solution
Replace all dr.RasterizeGLContext
to dr.RasterizeCudaContext
from deep3dfacerecon_pytorch.
Hi, the problem seems to be caused by some OpenGL related libraries required by nvdiffrast. Could you try to follow the Dockerfile provided by nvdiffrast to install the dependencies and re-install nvdiffrast to see if it works?
from deep3dfacerecon_pytorch.
Thank for your answering, the problem has been solved. I can close this issue.
from deep3dfacerecon_pytorch.
@YuDeng Hi, I also encountered [F glutil.cpp:338] eglInitialize() failed Aborted
. My system is centos. DId you run the code in the centos? CentOS is reportedly problematic when using nvdiffrast.
from deep3dfacerecon_pytorch.
Hi, glad to hear that you have solved the issue. Could you post the extra dependencies you have installed?
We can add them to our installation instruction and help newcomers to build the environment from scratch.
from deep3dfacerecon_pytorch.
Okay. Thanks for your kind reply.
from deep3dfacerecon_pytorch.
@yuzhou164 Hi, could you share your version Cuda and version Nvidia Drive?
from deep3dfacerecon_pytorch.
Do I have to run the docker environment? What is the command to do that? Sorry, I'm not an expert in docker. If I just build it then try to run the test.py script I still get the egInitialize() failed error
from deep3dfacerecon_pytorch.
您好,我也遇到了egInitialize() failed的错误,按照上述的办法并未解决,请问有什么好方法吗?
我的Linux环境:
cudnn:8.6
cuda:11.3
python:3.7
pytorch:1.9.0
from deep3dfacerecon_pytorch.
I also encounter this problem when I run the code on our lab server. And that because the server missing some Nvidia drivers. Try to install the missing packages or just reinstall the whole driver.
You can see:
https://github.com/NVlabs/nvdiffrast/issues/51#issuecomment-954275825
https://github.com/NVlabs/nvdiffrast/issues/56#issuecomment-983690874
https://github.com/NVlabs/nvdiffrast/issues/24#issuecomment-824702760
from deep3dfacerecon_pytorch.
According to NVlabs/nvdiffrast#56 (comment), I successfully resolve this problem by reinstalling the NVIDIA driver without -no-opengl-files.
from deep3dfacerecon_pytorch.
nvdiffrast.zip Hi, This ZIP package includes a dockerfile with requirement.txt for this Deep3DFaceRecon_pytorch project. The command to build the environment is
docker build -f docker/Dockerfile -t name:tagname .
One thing needs attention is that the version correspondence between version Cuda and version Nvidia Driver . Please refers the Nvidia website
Hi,May i ask that how to use the command of 'docker'?
from deep3dfacerecon_pytorch.
According to NVlabs/nvdiffrast#56 (comment), I successfully resolve this problem by reinstalling the NVIDIA driver without -no-opengl-files.
May i ask how to reinstall the NVIDIA driver without -no-opengl-files? Could u provide more details?
Looking forward to your assistance!
from deep3dfacerecon_pytorch.
According to NVlabs/nvdiffrast#56 (comment), I successfully resolve this problem by reinstalling the NVIDIA driver without -no-opengl-files.
May i ask how to reinstall the NVIDIA driver without -no-opengl-files? Could u provide more details? Looking forward to your assistance!
Hi, I downloaded the corresponding Nvidia Driver from https://www.nvidia.cn/Download/index.aspx?lang=cn and installed it without -no-opengl-files in my device.
from deep3dfacerecon_pytorch.
According to NVlabs/nvdiffrast#56 (comment), I successfully resolve this problem by reinstalling the NVIDIA driver without -no-opengl-files.
May i ask how to reinstall the NVIDIA driver without -no-opengl-files? Could u provide more details? Looking forward to your assistance!
Hi, I downloaded the corresponding Nvidia Driver from https://www.nvidia.cn/Download/index.aspx?lang=cn and installed it without -no-opengl-files in my device.
Very glad to receive your sincere reply.
EXM, i'm a newcomer on it. Could u explain more about how to "installed it without -no-opengl-files in my device."? Is there some tutorial for reinstalling Nvidia about it?
Thx.
from deep3dfacerecon_pytorch.
@ChenVoid, this blog (https://blog.csdn.net/weixin_43925119/article/details/109808670) may help you. When installing the Nvidia Driver, I changed the command "sudo ./NVIDIA-Linux-x86_64-430.14.run -no-x-check -no-nouveau-check -no-opengl-files" to "sudo ./NVIDIA-Linux-x86_64-430.14.run".
from deep3dfacerecon_pytorch.
@Rodger-Huang, thanks for your reply.
By the way, do i need to re-install CUDA, Anaconda or PyTorch after reinstalling the Nvidia driver?
from deep3dfacerecon_pytorch.
@YuDeng hello, I also encounter
[F glutil.cpp:338] eglInitialize() failed
when running the inference code. My system environment is nvidia driver 450.80.02 and cuda 11.0. I already have a basic pytorch environment so only install OpenGL related libraries in my system environment (not docker environment) as suggested above. Specifically, I did the following steps:
- I organize the contents of the dockerfile (provided by @yuzhou164) into an environment.sh:
apt-get update && apt-get install -y --no-install-recommends \ pkg-config \ libglvnd0 \ libgl1 \ libglx0 \ libegl1 \ libgles2 \ libglvnd-dev \ libgl1-mesa-dev \ libegl1-mesa-dev \ libgles2-mesa-dev \ cmake \ curl \ libsm6 \ libxext6 \ libxrender-dev # export PYTHONDONTWRITEBYTECODE=1 export PYTHONUNBUFFERED=1 # for GLEW export LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH # nvidia-container-runtime export NVIDIA_VISIBLE_DEVICES=all export NVIDIA_DRIVER_CAPABILITIES=compute,utility,graphics # Default pyopengl to EGL for good headless rendering support export PYOPENGL_PLATFORM=egl cp docker/10_nvidia.json /usr/share/glvnd/egl_vendor.d/10_nvidia.json pip install --upgrade pip pip install ninja imageio imageio-ffmpeg
- Run this environment.sh:
sudo bash environment.sh
- Re-install nvdiffrast:
cd nvdiffrast # ./Deep3DFaceRecon_pytorch/nvdiffrast pip install .
I want to know if it is really caused by the nvidia driver version or some other problems. Looking forward to your reply.
The same problem came across to me. It seems that the use of a low version OpenGL (specifically, Mesa instead of Nvidia) caused this error.
from deep3dfacerecon_pytorch.
@SunYangtian Could you explain more? The previous solution is not working because I don't have permission to reinstall the nvidia driver.
from deep3dfacerecon_pytorch.
Following #108, we have updated the code and README to support CUDA context. For someone having trouble installing OpenGL, you may try to add "--use_opengl False" to the script to switch to using CUDA context.
from deep3dfacerecon_pytorch.
Solution
Replace all
dr.RasterizeGLContext
todr.RasterizeCudaContext
Thank you, confirmed this worked for me too.
from deep3dfacerecon_pytorch.
Related Issues (20)
- visualize the face mesh without texture and color HOT 2
- RuntimeError: Cuda error: 304[cudaGraphicsGLRegisterBuffer(&s.cudaPosBuffer, s.glPosBuffer, cudaGraphicsRegisterFlagsWriteDiscard);] HOT 1
- ValueError: Unknown CUDA arch (8.9) or GPU not supported
- On the issue of differences in training visualization and testing effectiveness
- False error in training
- FileNotFoundError: [Errno 2] No such file or directory: './checkpoints/face_recon/epoch_latest.pth'
- Use this project with recent GPU ? HOT 6
- Open mouth HOT 2
- A little confusion about mask used for computing feat loss HOT 1
- Pretrained model
- No module named 'models.arcface_torch' HOT 1
- RuntimeError: CUDA error: no kernel image is available for execution on the device
- ImportError: DLL load failed HOT 2
- RuntimeError: Error building extension 'nvdiffrast_plugin_gl': ninja: error: build.ninja:3: lexing error HOT 1
- What does align_img do in test.py? HOT 1
- error while running
- UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd3 in position 1454: invalid continuation byte
- ImportError: libtorch_cpu.so: undefined symbol: iJIT_IsProfilingActive HOT 5
- resnet50-0676ba61.pth
- Thank you for your work. There is no result showing in preprocess_in_th_wild.py
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deep3dfacerecon_pytorch.