-
Notifications
You must be signed in to change notification settings - Fork 156
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
Add missing python dependency for examples #7
Conversation
It's only 4.8 MiB... but not zero.
Thanks for the PR. I will add the required deps into our upstream version and they will flow into the GitHub version at some point. We don't unfortunately merge PRs on GitHub. The display interval parameter will open a window and show optimization results with OpenGL. So to run it, I think you also need to give some extra args to Docker, something like:
When I try this I hit a bug though:
This looks like a bug on our side. @nachovizzo, you didn't hit this problem? |
I did face a similar issue:
But somehow I related it to the fact I was using an ssh connection. Running now on a docker with the flags above I get the following error:
|
@nachovizzo I think I'm running into the similar issue when I'm running on a Linux server on AWS (ssh in). When I run
I get
I tried to replicate all the libraries inside the docker image. Since I'm trying to develop on top of it I prefer to use virtual environments instead of docker. Could you share some insight in how you got it to work in the end? |
Hello there, so I guess(because I don't quite remember) that the changes of this PR solved that problem for me. I hope that helps |
Headless operation should not need glfw or pyopengl, so I don't quite see how the PR would fix headless operation. The samples do need glfw and pyopengl, but I don't include those in the Dockerfile as I never got nvdiffrast headless rendering and interactive mode working with Docker and Linux.
Looks like all EGL related calls are failing. I'd debug further by adding some error checking related prints into https://github.com/NVlabs/nvdiffrast/blob/main/nvdiffrast/common/glutil.cpp. |
I tried to run it and it fails at
with the error: "eglCreateContext() Failed", error code 0x3005 -> EGL_BAD_CONFIG. This is a bit strange since I thought the config comes from the previous line |
This is fixed in #24. Turns out I just needed to upgrade nVidia driver and reboot. 🤣 |
I have the same issue but I do have the latest version of the code, what could go wrong?
|
@changkun your issue is slightly different from mine. Mine was failing at
Could you print out your C code stack trace so it's easier? |
@nairb2020 Thanks for the swift response. How to print out the C code stack trace in this python calling C case? |
Hi @changkun! The failure occurs when trying to map OpenGL buffers to Cuda memory space. I re-inspected the code related to Cuda/OpenGL buffer management but I cannot immediately see what could cause the bug that you're seeing. The error code (219: cudaErrorInvalidGraphicsContext) suggests a problem with the OpenGL context, which in turn points to something in the OS or graphics drivers. Could you try calling |
Hi @s-laine , thanks very much for inspecting the error. I just add the call you suggested before the main function of the cube.py example:
and pose.py
and envphong.py:
|
This looks like a conflict between the OpenGL contexts used by nvdiffrast and used for showing the interactive results window ( Are you running this in Docker? As noted in the comment above, headless rendering (as used by nvdiffrast) + results window + Docker = problems, and we unfortunately don't know why. Based on the other comments, it sounds like the combination works for some users, so I guess it may be related to graphics driver version, possibly Docker version, or even glfw and pyopengl versions. The log shows that nvdiffrast manages to render at first but then fails to use the same OpenGL context again sometime later. In between, there is presumably at least an attempt to show the result image to the user by opening a window, which uses glfw and pyopengl. My hunch is that when opening the window, glfw or pyopengl does something that effectively reinitializes EGL or otherwise causes our internal OpenGL context to be invalidated. As a workaround, you could try opening the window before creating the OpenGL context for nvdiffrast — maybe it works in the other order. You can do this with a call such as
somewhere before |
Thanks again for helping out.
Yes. I saw a window with rendered content then exit immediately with that error.
No. Everything seems to work without the
No. It is a local miniconda environment.
I just tried inserting the given line directly before the
|
Thanks for the information. It appears there's a fundamental conflict between glfw/pyopengl and nvdiffrast on Linux, and unfortunately I don't have any further advice for troubleshooting. The interactive display window was originally tested on Windows where it works fine, but the maze of different graphics libraries on Linux makes this much more difficult. I may try to sort this out and find a working configuration some time in the future when I get access to a Linux machine. But for now I think we'll have to just declare the |
Following this example I have encountered the following error:
Later on, I found that also
glfw
was also missing.This is easily solved in this PR by just updating the docker image.