JingyunLiang / RVRT

Recurrent Video Restoration Transformer with Guided Deformable Attention (NeurlPS2022, official repository)
https://arxiv.org/abs/2206.02146
Other
354 stars 33 forks source link

Cannot run on Win10? #5

Open AIisCool opened 1 year ago

AIisCool commented 1 year ago

python main_test_rvrt.py --task 006_RVRT_videodenoising_DAVIS_16frames --sigma 50 --folder_lq C:/RVRT/testsets/Set8/ --folder_gt C:/RVRT/testsets/Set8/ --tile 0 256 256 --tile_overlap 2 20 20 Traceback (most recent call last): File "C:\Python310\lib\site-packages\torch\utils\cpp_extension.py", line 1740, in _run_ninja_build subprocess.run( File "C:\Python310\lib\subprocess.py", line 524, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\RVRT\main_test_rvrt.py", line 18, in from models.network_rvrt import RVRT as net File "C:\RVRT\models\network_rvrt.py", line 21, in from .op.deform_attn import deform_attn, DeformAttnPack File "C:\RVRT\models\op\deform_attn.py", line 19, in deform_attn_ext = load( File "C:\Python310\lib\site-packages\torch\utils\cpp_extension.py", line 1144, in load return _jit_compile( File "C:\Python310\lib\site-packages\torch\utils\cpp_extension.py", line 1357, in _jit_compile _write_ninja_file_and_build_library( File "C:\Python310\lib\site-packages\torch\utils\cpp_extension.py", line 1469, in _write_ninja_file_and_build_library _run_ninja_build( File "C:\Python310\lib\site-packages\torch\utils\cpp_extension.py", line 1756, in _run_ninja_build raise RuntimeError(message) from e RuntimeError: Error building extension 'deform_attn': [1/2] C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\bin\nvcc --generate-dependencies-with-compile --dependency-output deform_attn_cuda_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=deform_attn -DTORCH_API_INCLUDE_EXTENSION_H -IC:\Python310\lib\site-packages\torch\include -IC:\Python310\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Python310\lib\site-packages\torch\include\TH -IC:\Python310\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\include" -IC:\Python310\Include -D_GLIBCXX_USE_CXX11_ABI=0 -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -c C:\RVRT\models\op\deform_attn_cuda_kernel.cu -o deform_attn_cuda_kernel.cuda.o FAILED: deform_attn_cuda_kernel.cuda.o C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\bin\nvcc --generate-dependencies-with-compile --dependency-output deform_attn_cuda_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=deform_attn -DTORCH_API_INCLUDE_EXTENSION_H -IC:\Python310\lib\site-packages\torch\include -IC:\Python310\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Python310\lib\site-packages\torch\include\TH -IC:\Python310\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\include" -IC:\Python310\Include -D_GLIBCXX_USE_CXX11_ABI=0 -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -c C:\RVRT\models\op\deform_attn_cuda_kernel.cu -o deform_attn_cuda_kernel.cuda.o C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\include\crt/host_config.h(160): fatal error C1189: #error: -- unsupported Microsoft Visual Studio version! Only the versions between 2017 and 2019 (inclusive) are supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk. deform_attn_cuda_kernel.cu ninja: build stopped: subcommand failed.

JingyunLiang commented 1 year ago

We didn't test it on Win10. A linux system should be fine.

ddfault commented 2 months ago

I have this running on Windows 10 22H2 with CUDA toolkit 12.1. It seems that it wasn't happy with your Visual studio version. I ran pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 and install build tools from https://aka.ms/vs/17/release/vs_BuildTools.exe to go with my Visual Studio 2022 community version. I set the environmental variables CUDA_HOME CUDAHOSTCXX TORCH_CUDA_ARCH_LIST I added C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\bin and C:\Software\MSVisualStudio2022Community\VC\Tools\MSVC\14.40.33807\bin\Hostx64\x64\ to my PATH to ensure cl and nvcc would run just fine (not sure a requirement and I'm cheating with 12.4 instead of 12.1) `using dataset from testsets/DVD10/test_GT_blurred Testing 01_IMG_0030 ( 0/10) - PSNR: 34.82 dB; SSIM: 0.9553; PSNR_Y: 36.65 dB; SSIM_Y: 0.9638 Testing 02_IMG_0049 ( 1/10) - PSNR: 38.33 dB; SSIM: 0.9723; PSNR_Y: 40.17 dB; SSIM_Y: 0.9791 Testing 03_IMG_0021 ( 2/10) - PSNR: 35.26 dB; SSIM: 0.9596; PSNR_Y: 37.52 dB; SSIM_Y: 0.9691 Testing 04_720p_240fps_2 ( 3/10) - PSNR: 34.78 dB; SSIM: 0.9439; PSNR_Y: 36.33 dB; SSIM_Y: 0.9540 Testing 05_IMG_0032 ( 4/10) - PSNR: 29.78 dB; SSIM: 0.9292; PSNR_Y: 31.24 dB; SSIM_Y: 0.9377 Testing 06_IMG_0033 ( 5/10) - PSNR: 36.13 dB; SSIM: 0.9607; PSNR_Y: 37.71 dB; SSIM_Y: 0.9679 Testing 07_IMG_0031 ( 6/10) - PSNR: 33.04 dB; SSIM: 0.9433; PSNR_Y: 34.72 dB; SSIM_Y: 0.9536 Testing 08_IMG_0003 ( 7/10) - PSNR: 30.12 dB; SSIM: 0.9256; PSNR_Y: 31.61 dB; SSIM_Y: 0.9361 Testing 09_IMG_0039 ( 8/10) - PSNR: 37.81 dB; SSIM: 0.9725; PSNR_Y: 39.60 dB; SSIM_Y: 0.9794 Testing 10_IMG_0037 ( 9/10) - PSNR: 33.39 dB; SSIM: 0.9540; PSNR_Y: 34.99 dB; SSIM_Y: 0.9608

results/004_RVRT_videodeblurring_DVD_16frames -- Average PSNR: 34.35 dB; SSIM: 0.9516; PSNR_Y: 36.06 dB; SSIM_Y: 0.9601` were my test results.

NehorayMelamed commented 1 month ago

there is any solution for running on windows ?