Closed JiyouSeo closed 2 years ago
You seem to have no graphics libraries installed on your system (OpenGL and EGL) that are required by the OpenGL-based rasterizer. 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.
Thank you for kindly replying. I will do following your reply.
Hello, I have the same problem as you, have you solved it?
I have replaced "RasterizeGLContext" with "RasterizeCudaContext", so I guess I don't need to install graphics libraries like OpenGL,but the problem is still there.
I have replaced "RasterizeGLContext" with "RasterizeCudaContext", so I guess I don't need to install graphics libraries like OpenGL,but the problem is still there.
Which line did you modify? I met the same problem.
I did the same thing as JiyouSeo, I modified ['ninja', '-v'] to ['ninja', '--version'] in cpp_extension.py ,and then I got "nvdiffrast_plugin_gl.so: cannot open shared object file: No such file or directory".
It seems that I have solved this problem:don't modify " ['ninja', '-v']", and replace "RasterizeGLContext" with "RasterizeCudaContext" in your project.
It seems that I have solved this problem:don't modify " ['ninja', '-v']", and replace "RasterizeGLContext" with "RasterizeCudaContext" in your project.
in util/nvdiffrast.py? it does not work for me.
in util/nvdiffrast.py? it does not work for me.
It should be in some files which import nvdiffrast, I think you will find it by searching "RasterizeGLContext" in your own project. By the way, if you want to use "RasterizeGLContext", you must install some related libs following the DockerFile
Here's a new update on this issue:
If you already installed ninja and tried all the above-mentioned methods but still suffer from this problem, you can check whether you have installed ninja both on python and ubuntu environment. Installing both of them will cause conflict!
I tried almost every other approach on the Internet, until finally I resolved this by:
pip uninstall ninja
And I suggest not change anything under system directories, the suggested methods of modifying ['ninja', '-v'] to ['ninja', '--version'] in cpp_extension.py might be just a way of shifting between the ubuntu and python's versions of ninja.
For me it was missing EGL and GL headers in conda c++ compiler.
Installing these two packages helped: conda install conda-forge::mesa-libegl-devel-cos6-x86_64 conda install conda-forge::mesa-libgl-devel-cos6-x86_64
Now I have another problem that appears even when replacing RasterizeGLContext with RasterizeCudaContext too: cannot find -lcudart
The problem with "cannot find -lcudart" solved too.
It was a broken symlink libcudart.so -> libcudart.so.12.1.55.
Because of conflicts I couldn't install
conda install nvidia/label/cuda-12.1.1::cuda-toolkit
and I installed another version
conda install nvidia/label/cuda-12.1.0::cuda-toolkit
which had broken link to libcudart.so
To fix this I upgraded only cudart to 12.1.1
conda install nvidia/label/cuda-12.1.1::cuda-cudart-dev
conda install nvidia/label/cuda-12.1.1::cuda-cudart-static
The last problem I encountered while compiling ComfyUI-3D-Pack:
ctime:80:11: error: 'timespec_get' has not been declared in '::'
80 | using ::timespec_get;
| ^~~~~~~~~~~~
ninja: build stopped: subcommand failed.
And the fix was to use conda gcc:
conda install conda-forge::gcc
The problem with "cannot find -lcudart" solved too.
It was a broken symlink libcudart.so -> libcudart.so.12.1.55.
Because of conflicts I couldn't install
conda install nvidia/label/cuda-12.1.1::cuda-toolkit
and I installed another versionconda install nvidia/label/cuda-12.1.0::cuda-toolkit
which had broken link to libcudart.soTo fix this I upgraded only cudart to 12.1.1
conda install nvidia/label/cuda-12.1.1::cuda-cudart-dev
conda install nvidia/label/cuda-12.1.1::cuda-cudart-static
If you still can't have "cannot find -ldcudart" problem after using conda install nvidia/label/cuda-12.1.1::cuda-toolkit
I find out in my error message that "... -L/usr/local/cuda-11.3/lib64 ..", ninja is trying to find libcudart.so in lib64 folder but in my installation, my libcudart.* is in lib folder.
So my solution is just create a lib64 folder in my env conda env and copy libcudart.* from lib to lib64 and the issue is solved.
It seems that I have solved this problem:don't modify " ['ninja', '-v']", and replace "RasterizeGLContext" with "RasterizeCudaContext" in your project.
Thank you very much, I also used this method to solve it.
It seems that I have solved this problem:don't modify " ['ninja', '-v']", and replace "RasterizeGLContext" with "RasterizeCudaContext" in your project.
Thank you very much, I also used this method to solve it.
兄弟,在哪个文件里面替换?
Hello, thank you for your great research!
I have a problem running the code that import nvdiffrast.
So, I modify ['ninja', '-v'] to ['ninja', '--version'] in cpp_extension.py Then It return
I guess it is because it cannot build nvdiffrast_plugin_gl.so. How can I build exactly nvdiffrast_plugin_gl.so? And this is my code environment.
Thank you.