-
Notifications
You must be signed in to change notification settings - Fork 454
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
"Free(): invalid pointer" - during BOPWriter #1099
Comments
Thanks for the hint, @matteomastrogiuseppe! I am currently investigating a few strange issue that occur in the multiprocessing the bop writer.
|
|
Also, this issue occurs only when trying to render with the GPU. If I set |
Thanks! I guess with bproc 2.6.2 (does not use multiprocessing in bop writer) everything would also work right? The problem is a bit that I cannot reproduce this issue on my system. Whiche GPU do you use? |
With BProc 2.6.2 I still get the Using a NVIDIA RTX 2080 at the moment, but I got the same issue with another integrated NVIDIA GPU. I'm using a conda environment, but I don't think it's related to this case. |
Recreated the problem on another machine, this one has returned a more explanatory error log. It should be the same issue but can't say 100%. I get this message printed indefinitely (so for every pool worker instantiated):
cc: @traversaro |
Thanks for the update @matteomastrogiuseppe. So it seems the error is not related to the multiprocessing but more to the pyrenderer/OpenGL. Are you able to instantiate the OffscreenRenderer outside of blender? As you could reproduce the error on multiple system, but I could not reproduce it on our systems, there seems to be something different between our environments. |
I am using a very simple conda environment. Environment.yaml:
Then of course, on the very first blenderproc run, it will download a bunch of dependencies. Funny enough, I tried to define (and not use) a random
Which is after the pyrender initialization. |
Just to check if this is indeed and EGL error, can you try if this happens by setting https://github.com/DLR-RM/BlenderProc/blob/main/blenderproc/python/writer/BopWriterUtility.py#L28 to |
To interpret a bit better:
|
More in general perhaps we should call |
Thanks for the investigation! |
What about pyopengl ? If I recall correctly, pyrender (that I am afraid is currently unmantained, in another project we migrated to https://github.com/fishbotics/pyribbit explicitly to avoid the pyopengl==3.1.0 pin) was pinning pyopengl==3.1.0, that however does not have an important bugfix, i.e. in egl loads the legacy |
I was not aware that pyrender is not maintained anymore. So if you say, switching to pyribbit would solve the error, we can do that in the next bproc version (although pyribbit is also not that well maintained...). |
I never found any kind of announcement, but the maintainers have stopped replying to any issue or PR, so that's my assumption. See mmatl/pyrender#224 and mmatl/urdfpy#31 for a related discussion (urdfpy and pyrender have the same mantainer).
Just to totally clear I am not sure if that will fix that error, that was just an hypothesis. I would first double check that (I can align with @matteomastrogiuseppe).
In which sense? Indeed the docs website are not regenerated/polished and still point to the pyrender one, but I am not aware of any bug present in pyribbit. |
Sorry for the late reply, but the error disappeared on one machine, where @traversaro performed a deep-cleaning of the NVIDIA drivers and then re-installed them with I tried to do the same on another machine (where I used to get this error), and it solved the issue once again. Next time I won't suppose that multiple computers are ground truth, sorry😁 I guess we can close this! |
Great! No need to worry about dependencies then. To comment a bit more on the problem on that machine: there no |
Great that it works now! Thanks for the explanation. Regarding pyrender: I will keep that in mind and will then probably switch to pyribbit in one of the next versions.
This was only based on the fact that the repo contains only one more commit compared to the original repo. But if there are no further issue, its of course fine. |
I am getting this error as well. I am using 3 x NVIDIA RTX 6000 Ada. I assume this will be solved in the next versions. |
If anyone is still suffering from this, what worked on my end (as a temporary fix) was simply importing the following on the top of my blenderproc script:
To my understanding, this negates an import within a function down the line that leads to the error. Couldn't determine the exact cause though |
Same problem occured on my env. I downgraded conda env python 3.10 to 3.9. then problem solved. |
Describe the issue
I found this issue trying to render some images through the
bproc.writer.write_bop
method on two Ubuntu native machines (22.04). After the rendering, the code breaks and "Free(): invalid pointer" is printed indefinitely.I tracked the source of the error in https://github.com/DLR-RM/BlenderProc/blob/main/blenderproc/python/writer/BopWriterUtility.py, the error pops up at line 538, when a PyRender object is instantiated.
I think it may be an OpenGL problem, that pops up in combination when using multiprocessing.
It may even be correlated to the issue I encountered a while ago (#1084), since I feel like memory is still not handled in a correct way.
A minimal code to reproduce the issue is by simply following the steps at https://github.com/DLR-RM/BlenderProc/tree/main/examples/datasets/bop_object_physics_positioning.
Minimal code example
Files required to run the code
No response
Expected behavior
The code fails during the generation of the BOP data, most specifically when creating
pyrender
renderer objects.BlenderProc version
2.7.0
The text was updated successfully, but these errors were encountered: