Closed L1onKing closed 1 year ago
I think I have spotted an issue
"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\Hostx64\x64/link.exe" Buffer.o CudaRaster.o RasterImpl.cuda.o RasterImpl.o common.o rasterize.cuda.o interpolate.cuda.o texture.cuda.o texture.o antialias.cuda.o torch_bindings.o torch_rasterize.o torch_interpolate.o torch_texture.o torch_antialias.o /nologo /DLL c10.lib c10_cuda.lib torch_cpu.lib torch_cuda_cu.lib -INCLUDE:?_torch_cuda_cu_linker_symbol_op_cuda@native@at@@YA?AVTensor@2@AEBV32@@Z torch_cuda_cpp.lib -INCLUDE:?warp_size@cuda@at@@YAHXZ torch.lib /LIBPATH:D:\Work\PythonEnvironments\working_env\lib\site-packages\torch\lib torch_python.lib /LIBPATH:D:\Work\PythonEnvironments\working_env\Scripts\libs "/LIBPATH:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\lib\x64" cudart.lib /out:nvdiffrast_plugin.pyd
LINK : fatal error LNK1104: cannot open file 'python38.lib'
It seems there is no correct path to python38.lib. My python38.lib is here:
C:\Users\username\AppData\Local\Programs\Python\Python38\libs
Can you advise how can I point that path into the command? Thanks!
This looks like a problem with PyTorch's extension build mechanism. When building the CUDA/C++ extension, nvdiffrast only supplies the names of the code-containing source files to PyTorch and has it execute the build. I unfortunately don't know why PyTorch doesn't add the relevant library path to the command line of the linker, or if it can be instructed to do that somehow.
This could be some sort of version conflict as you suspect. Because PyTorch doesn't point the linker to the correct Python library, I'm guessing the PyTorch version you have installed is not fully compatible with the Python version.
As a crude first test, you could try copying the missing library file into the library directory that is specified in the command line. However, the linker error is probably a symptom of a deeper problem, so I'd be surprised if this fixed it.
@s-laine
Thanks for all your insights. Just wanted to follow up that interestingly enough "just" copying the libraries from the AppData path to the lib folder of Visual Studio (I'm using 2022 Professional) worked just fine.
Great to hear you found a workaround. Hopefully this isn't too common a problem — there are so many ways people's environments can differ that there always seem to be new ways for things to fail.
Closing for now, but will reopen for further troubleshooting if there are more reports of the same issue.
Hello! I have installed nvdiffrast pretty much successfuly, no issues along the way:
But when I tried to run a test script, I have an error at the line:
The error is next:
Could you please give me an advice how to fix an issue? I think it is obvious that the problem is in CUDA. But what is the problem exactly, wrong version perhaps?
I have installed Cuda and I am using it with PyTorch quite successfuly, so I don't think it is a question of "correct" installation. My CUDA version is
11.8