完整报错:
RuntimeError: Error building extension 'fused': [1/3] C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\lib\x64;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\bin;\bin\nvcc --generate-dependencies-with-compile --dependency-output fused_bias_act_kernel.cuda.o.d -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcompiler /EHsc -Xcompiler /wd4190 -Xcompiler /wd4018 -Xcompiler /wd4275 -Xcompiler /wd4267 -Xcompiler /wd4244 -Xcompiler /wd4251 -Xcompiler /wd4819 -Xcompiler /MD -DTORCH_EXTENSION_NAME=fused -DTORCH_API_INCLUDE_EXTENSION_H -ID:\Anaconda\SetUpPath\envs\Pytorch\lib\site-packages\torch\include -ID:\Anaconda\SetUpPath\envs\Pytorch\lib\site-packages\torch\include\torch\csrc\api\include -ID:\Anaconda\SetUpPath\envs\Pytorch\lib\site-packages\torch\include\TH -ID:\Anaconda\SetUpPath\envs\Pytorch\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\lib\x64;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\bin;\include" -ID:\Anaconda\SetUpPath\envs\Pytorch\Include -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_75,code=compute_75 -gencode=arch=compute_75,code=sm_75 -c d:\Python\Python_Demo\虚拟换衣\Projects\11、pose-with-style-main\op\fused_bias_act_kernel.cu -o fused_bias_act_kernel.cuda.o
FAILED: fused_bias_act_kernel.cuda.o
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\lib\x64;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\bin;\bin\nvcc --generate-dependencies-with-compile --dependency-output fused_bias_act_kernel.cuda.o.d -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcompiler /EHsc -Xcompiler /wd4190 -Xcompiler /wd4018 -Xcompiler /wd4275 -Xcompiler /wd4267 -Xcompiler /wd4244 -Xcompiler /wd4251 -Xcompiler /wd4819 -Xcompiler /MD -DTORCH_EXTENSION_NAME=fused -DTORCH_API_INCLUDE_EXTENSION_H -ID:\Anaconda\SetUpPath\envs\Pytorch\lib\site-packages\torch\include -ID:\Anaconda\SetUpPath\envs\Pytorch\lib\site-packages\torch\include\torch\csrc\api\include -ID:\Anaconda\SetUpPath\envs\Pytorch\lib\site-packages\torch\include\TH -ID:\Anaconda\SetUpPath\envs\Pytorch\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\lib\x64;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\bin;\include" -ID:\Anaconda\SetUpPath\envs\Pytorch\Include -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_75,code=compute_75 -gencode=arch=compute_75,code=sm_75 -c d:\Python\Python_Demo\虚拟换衣\Projects\11、pose-with-style-main\op\fused_bias_act_kernel.cu -o fused_bias_act_kernel.cuda.o
CreateProcess failed: The system cannot find the file specified.
ninja: fatal: ReadFile: 句柄无效。
解决方案:
1、下载MinGW(MinGW - Minimalist GNU for Windows download | SourceForge.net)并安装
2、添加环境变量(系统变量中的Path)
3、win+R 打开cmd,输入mingw-get,弹出
4、在cmd中输入mingw-get install gcc 来安装gcc ,如果想安装 g++,gdb,只要输入命令 mingw-get install g++ 和 mingw-get install gdb
5、查看gcc版本gcc -v