Open Obambaaaa opened 3 weeks ago
Successfully solve the problem. Here is my full solution and referrence link: Problem ImportError: DLL load failed while importing nvdiffrast_plugin: The specified module could not be found. Solution Manually run ninja for nvdiffrast_plugin
[https://github.com/NVlabs/nvdiffrast/issues/46#issuecomment-974756618]
cd C:\Users\*\AppData\Local\torch_extensions\torch_extensions\Cache\nvdiffrast_plugin
ninja
[https://blog.csdn.net/HaoZiHuang/article/details/125795675]
a. Install VS2019
b. add cl.exe to the environment variables
[https://www.reddit.com/r/comfyui/comments/1bf7tv1/comment/kv1dq5f/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button]
a. Manually add the path to msvcprt.lib
b. Run ninja again, if other .lib files are still not found, continue to add their paths
c. The final ldflags variable in the build.ninja file:
ldflags = /DLL c10.lib c10_cuda.lib torch_cpu.lib torch_cuda.lib -INCLUDE:?warp_size@cuda@at@@YAHXZ torch.lib /LIBPATH:C:\Users\Picaloe\.conda\envs\instantmesh\lib\site-packages\torch\lib torch_python.lib /LIBPATH:C:\Users\Picaloe\.conda\envs\instantmesh\libs "/LIBPATH:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\lib\x64" cudart.lib "/LIBPATH:D:\Softwares\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\lib\x64" msvcprt.lib "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\um\x64" kerbcli.lib "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\ucrt\x64" ucrt.lib "/LIBPATH:C:\Users\Picaloe\AppData\Local\torch_extensions\torch_extensions\Cache\py310_cu121\nvdiffrast_plugin" nvdiffrast_plugin.exp "/LIBPATH:C:\Users\Picaloe\AppData\Local\torch_extensions\torch_extensions\Cache\py310_cu121\nvdiffrast_plugin" nvdiffrast_plugin.lib
Solved!
I found the same issue on jtydhr88 / ComfyUI-InstantMesh, but it's been archievied. I also read that in the past a user solved the same issue by updating to CUDA 12.1, but since 12.1 is my current version I found no solution.
A couple of examples of when this happens:
Another example: