-
Notifications
You must be signed in to change notification settings - Fork 167
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
glewInit() failed #18
Comments
It's tricky to get the installation exactly right on the Linux host. I've always run this stuff only in Docker on Linux. |
1 - yes I can. However I would also like to run on native linux if possible, for development and testing etc. Also in case I need to setup another docker image I would like to know how I need to set it up.
|
error 4 seems to be could it be related to this? nigels-com/glew#172 |
I don't understand the question. You can build an image with our Dockerfile with "docker build -t your-base-image:latest ." and if you need to setup your own image, you start your own Dockerfile with "FROM your-base-image:latest" and build your own. Or alternatively you edit our Dockerfile. There's a number of ways the GL/EGL init can fail. If you want to debug this further, I'd recommend adding debug prints into the GLEW source code (you can the Dockerfile on how it's built) or in our EGL init code in nvdiffrast. |
Mea culpa, it must be that i have compiled glew without Another way it works is with this change: diff --git a/nvdiffrast/common/glutil.inl b/nvdiffrast/common/glutil.inl
index 4df00a5..1ef9c59 100644
--- a/nvdiffrast/common/glutil.inl
+++ b/nvdiffrast/common/glutil.inl
@@ -184,7 +184,7 @@ static void setGLContext(GLContext& glctx)
return;
GLenum result = glewInit();
- if (result != GLEW_OK)
+ if (result != GLEW_OK && result != GLEW_ERROR_NO_GLX_DISPLAY)
LOG(FATAL) << "glewInit() failed, return value = " << result;
glctx.glewInitialized = 1;
} If you are open to suggestions, the latter method would allow users to stick to using glew installed from apt - but that's just personal preference. And, while I have your attention, I would suggest this other change in the Dockerfile: diff --git a/docker/Dockerfile b/docker/Dockerfile
index 5b35a93..cc4de98 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -50,7 +50,7 @@ RUN mkdir -p /tmp && \
cd /tmp && tar zxf /tmp/glew-2.1.0.tgz && cd glew-2.1.0 && \
SYSTEM=linux-egl make && \
SYSTEM=linux-egl make install && \
- rm -rf /tmp/glew-2.1.0.zip /tmp/glew-2.1.0
+ rm -rf /tmp/glew-2.1.0.tgz /tmp/glew-2.1.0
RUN pip install imageio imageio-ffmpeg
and this for the diff --git a/run_sample.sh b/run_sample.sh
old mode 100644
new mode 100755 Thanks, and just wanted to say: this library is really amazing! |
Thanks @michele-arrival for reporting your findings -- it's very useful! Re: GLEW - I guess an alternative would be to vendor in GLEW into the library and compile the required parts during compilation of nvdiffrast. At least personally, using system libraries often leads to new types of problems on Linux, so vendoring might be a more stable solution.
Whoops, indeed! Thanks for letting me know. I'll put these suggestions on my todo list. |
What's wrong with |
FYI - as of a4e7a4d, GLEW init should not be an issue anymore. The GLEW dependency was removed from nvdiffrast. |
Thank you very much! that will certainly make my (an many other's) life easier! |
I'm on Ubuntu-18.04 and I've installed all dependencies as in the docker file including
LD_LIBRARY_PATH=/usr/lib64:$LD_LIBRARY_PATH
,PYOPENGL_PLATFORM=egl
, andCC=gcc-8
.I'm using torch 1.7.1, cuda 10.2
I keep getting this error on any sample in the
torch
folder:[F glutil.inl:188] glewInit() failed, return value = 4
Any idea why?
The text was updated successfully, but these errors were encountered: