ShichenLiu / SoftRas

Project page of paper "Soft Rasterizer: A Differentiable Renderer for Image-based 3D Reasoning"
MIT License
1.24k stars 156 forks source link

error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\link.exe' failed with exit code 1120 #107

Open Echo-jyt opened 1 year ago

Echo-jyt commented 1 year ago

Hello, thanks for your great work。I am a beginner in the talking face field, and I have encountered a problem while running python setup.py install. I have been unable to resolve it. Can you help me?

  正在创建库 D:\jyt\SoftRas-master\build\temp.win-amd64-cpython-38\Release\soft_renderer/cuda\load_textures.cp38-win_amd64.lib 和对象 D:\jyt\SoftRas-master\build\temp.win-amd64-cpython-38\Release\soft_renderer/cuda\load_textures.cp38-win_amd64.exp
load_textures_cuda.obj : error LNK2001: 无法解析的外部符号 __imp___tls_offset_?init@?1??lazy_init_num_threads@internal@at@@YAXXZ@4_NA
load_textures_cuda.obj : error LNK2001: 无法解析的外部符号 __imp___tls_index_?init@?1??lazy_init_num_threads@internal@at@@YAXXZ@4_NA
build\lib.win-amd64-cpython-38\soft_renderer\cuda\load_textures.cp38-win_amd64.pyd : fatal error LNK1120: 
2 个无法解析的外部命令
error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\link.exe' failed with exit code 1120
bhavaygrg commented 1 year ago

It looks like you are encountering linker errors while trying to install a Python package that involves compiling and linking CUDA code. The error messages you provided indicate that there are unresolved external symbols related to TLS (Thread Local Storage) offsets and indices.

Here are a few steps you can try to troubleshoot and resolve this issue:

Update Visual Studio: The error messages mention Microsoft Visual Studio 2022. Make sure you have the necessary components installed and that Visual Studio is up to date. Sometimes, updating Visual Studio to the latest version can resolve compatibility issues.

Check CUDA Compatibility: Ensure that the CUDA version you have installed is compatible with your current setup and the package you are trying to install. Different versions of CUDA may have compatibility issues with certain compiler versions.

Check Compiler Version: The package might be built with a specific version of the MSVC (Microsoft Visual C++) compiler. Make sure that your Visual Studio installation includes the required compiler version. If necessary, you might need to adjust your environment variables or project settings to use the correct compiler.

Check Package Requirements: Double-check the documentation of the package you're trying to install. It might have specific requirements or dependencies that need to be satisfied. Ensure that you have all the necessary dependencies installed, including CUDA, and that they are correctly configured.

Clean and Rebuild: Sometimes, issues can arise due to cached build artifacts. Try cleaning the build artifacts and then rebuilding the package. You can do this by deleting the build directory in your project folder and then running the installation command again.

Contact Package Maintainers: If none of the above steps work, consider reaching out to the maintainers of the package for help. They might be able to provide specific guidance for resolving this issue in the context of their package.

Remember that troubleshooting compiler and linker issues can sometimes be complex and may require careful debugging and investigation. It's also a good practice to search for similar issues reported by other users in forums or issue trackers related to the package you are trying to install, as you might find valuable insights and solutions from others who have encountered similar problems. I once faced a same issue when I was trying to install stable diffusion locally on my system. Updating the microsoft c++ did the trick for me. Hope this helps , Good Luck!