Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
16th May 2023, 05:01 | #1 | Link |
Registered User
Join Date: Nov 2008
Posts: 137
|
does vs-rife need cuda toolkit?
Hi I posted this here:
https://github.com/HolyWu/vs-rife/issues/24 Getting an error "RIFE: cuda is not available" Someone has mentioned that I need to install cuda toolkit. However it's also mentioned that the latest vs-rife includes necessary runtime libraries. Anyone has used this encounter this error and what to do? I have followed this and tried to use it with mpc-be but keep encountering the above error. https://www.svp-team.com/forum/viewt...d=81456#p81456 Thanks for any good replies and i can provide more info if needed. |
18th May 2023, 17:24 | #2 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,259
|
https://github.com/styler00dollar/Va...FE-ncnn-Vulkan would probably be easier to use,...
|
19th May 2023, 03:54 | #3 | Link | |
Registered User
Join Date: Nov 2008
Posts: 137
|
Quote:
So I'd like to try it |
|
19th May 2023, 07:12 | #4 | Link | |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,259
|
Okay, then make sure to:
a. set CUDA_MODULE_LOADING to "LAZY" b. load the dependencies like "CUDA Toolkit 11.7", "cuDNN 8.6", "TensorRT 8.5.2.2" In my (portable) setup, a script where I use vs-rife looks like: Code:
# Imports import vapoursynth as vs # getting Vapoursynth core core = vs.core import site import os import ctypes # Adding torch dependencies to PATH path = site.getsitepackages()[0]+'/torch_dependencies/bin/' ctypes.windll.kernel32.SetDllDirectoryW(path) path = path.replace('\\', '/') os.environ["PATH"] = path + os.pathsep + os.environ["PATH"] os.environ["CUDA_MODULE_LOADING"] = "LAZY" # Loading Plugins core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/fmtconv.dll") # for color conversions core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/MiscFilter/MiscFilters/MiscFilters.dll") # for scene change detection core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll") # to load the source # source: 'G:\TestClips&Co\test.avi' # current color space: YUV420P8, bit depth: 8, resolution: 640x352, fps: 25, color matrix: 470bg, yuv luminance scale: limited, scanorder: progressive # Loading G:\TestClips&Co\test.avi using LWLibavSource clip = core.lsmas.LWLibavSource(source="G:/TestClips&Co/test.avi", format="YUV420P8", stream_index=0, cache=0, fpsnum=25, prefer_hw=0) # Setting detected color matrix (470bg). clip = core.std.SetFrameProps(clip, _Matrix=5) # Setting color transfer info (470bg), when it is not set clip = clip if not core.text.FrameProps(clip,'_Transfer') else core.std.SetFrameProps(clip, _Transfer=5) # Setting color primaries info (), when it is not set clip = clip if not core.text.FrameProps(clip,'_Primaries') else core.std.SetFrameProps(clip, _Primaries=5) # Setting color range to TV (limited) range. clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1) # making sure frame rate is set to 25 clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1) clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=0) # progressive from vsrife import RIFE # adjusting color space from YUV420P8 to RGBH for vsTorchRIFE clip = core.resize.Bicubic(clip=clip, format=vs.RGBH, matrix_in_s="470bg", range_s="limited") # adjusting frame count&rate with RIFE (torch) clip = RIFE(clip, model="4.6", sc_threshold=0.150) # new fps: 50 # Resizing using 10 - bicubic spline clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, range_s="limited") clip = core.fmtc.resample(clip=clip, kernel="spline16", w=1280, h=704, interlaced=False, interlacedd=False) # resolution 1280x704 # adjusting output color from: RGBS to YUV420P8 for x264Model clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, matrix_s="470bg", range_s="limited", dither_type="error_diffusion") # set output frame rate to 50fps (progressive) clip = core.std.AssumeFPS(clip=clip, fpsnum=50, fpsden=1) # Output clip.set_output() Code:
cublas64_11.dll cublasLt64_11.dll cudart64_110.dll cudnn64_8.dll cudnn_adv_infer64_8.dll cudnn_cnn_infer64_8.dll cudnn_ops_infer64_8.dll cufft64_10.dll cufftw64_10.dll curand64_10.dll cusolver64_11.dll cusolverMg64_11.dll cusparse64_11.dll nvblas64_11.dll nvinfer.dll nvinfer_builder_resource.dll nvinfer_plugin.dll nvonnxparser.dll (iirc. this isn't needed for vs-rife, but for some other filter I use) nvparsers.dll nvrtc-builtins64_117.dll nvrtc64_112_0.dll zlibwapi.dll Quote:
Cu Selur Last edited by Selur; 19th May 2023 at 07:14. |
|
19th May 2023, 15:34 | #5 | Link | |
Registered User
Join Date: Nov 2008
Posts: 137
|
Quote:
" README.md RIFE Real-Time Intermediate Flow Estimation for Video Frame Interpolation, based on https://github.com/hzwer/Practical-RIFE. Dependencies NumPy PyTorch 1.13 VapourSynth R55+ trt requires additional runtime libraries: CUDA Toolkit 11.7 cuDNN 8.6 TensorRT 8.5.2.2 For ease of installation on Windows, you can download the 7z file on Releases which contains required runtime libraries and Python wheel file. Either add the unzipped directory to your system PATH or copy the DLL files to a directory which is already in your system PATH. Finally pip install the Python wheel file." Also, how do you set "CUDA_MODULE_LOADING to "LAZY" ? Last edited by Milardo; 19th May 2023 at 15:51. |
|
19th May 2023, 19:59 | #6 | Link | |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,259
|
Quote:
About the runtime files: CUDA-11.7_cuDNN-8.6.0_TensorRT-8.5.2.2_win64.7z contains them, you just need to be sure that they are used. Since I didn't want to copy them into my path, I extended the PATH variable in my script. |
|
20th May 2023, 03:50 | #7 | Link | |
Registered User
Join Date: Nov 2008
Posts: 137
|
Quote:
Where do I put the "torch_dependencies/bin" folder so it can be found? |
|
20th May 2023, 08:10 | #8 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,259
|
I set it to:
Code:
path = site.getsitepackages()[0]+'/torch_dependencies/bin/' Using: Code:
import vapoursynth as vs core = vs.core import site clip = core.std.BlankClip(format=vs.RGB24, color=[255, 255, 255]) clip = core.text.Text(clip, site.getsitepackages()[0]) clip.set_output() I kept the 'torch_dependencies/bin' folder inside the Vapoursynth-folder to keep it portable. Cu Selur |
21st May 2023, 05:39 | #9 | Link | |
Registered User
Join Date: Nov 2008
Posts: 137
|
Quote:
Is the vapoursynth home folder in the python folder if it is portable? Here is a screenshot of what I am getting as an error without the dependency folder being recognized. |
|
21st May 2023, 16:21 | #10 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,259
|
Can't see the image since it's pending for approval.
The script I posted should show the first entry in the side packages. Placing the 'torch_dependencies/bin' folder there and using: Code:
import site import ctypes path = site.getsitepackages()[0]+'/torch_dependencies/bin/' ctypes.windll.kernel32.SetDllDirectoryW(path) Cu Selur |
22nd May 2023, 04:52 | #11 | Link | |
Registered User
Join Date: Nov 2008
Posts: 137
|
Quote:
Here is the image i tried posting yesterday gif upload Last edited by Milardo; 22nd May 2023 at 04:54. |
|
22nd May 2023, 07:10 | #12 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,259
|
What does:
Code:
import vapoursynth as vs core = vs.core import site clip = core.std.BlankClip(format=vs.RGB24, color=[255, 255, 255]) clip = core.text.Text(clip, site.getsitepackages()[0]) clip.set_output() What does your Vapoursynth script look like? lib/site-packages normally isn't in the PATH, so unless you add it to the 'SetDllDirectoryW' this won't work. Seems like you are trying to load those dlls as if they were normal filters. (also make sure you use the latest NVIDIA drivers) Cu Selur Last edited by Selur; 22nd May 2023 at 07:13. |
23rd May 2023, 03:47 | #13 | Link | |
Registered User
Join Date: Nov 2008
Posts: 137
|
Quote:
Here is my vapoursynth script: Code:
import vapoursynth as vs from vsrife import RIFE core = vs.core import site import os # Adding torch dependencies to PATH import ctypes path = site.getsitepackages()[0]+'/torch_dependencies/bin/' ctypes.windll.kernel32.SetDllDirectoryW(path) path = path.replace('\\', '/') os.environ["PATH"] = path + os.pathsep + os.environ["PATH"] os.environ["CUDA_MODULE_LOADING"] = "LAZY" ret = VpsFilterSource ret = core.resize.Bicubic(clip=ret, format=vs.RGBS, matrix_in_s="470bg", range_s="full") ret = RIFE(clip=ret, model='4.6', trt=True, factor_num=2, factor_den=1) output_ret = core.resize.Bicubic(clip=ret, format=vs.YUV420P8, matrix_s="709") output_ret.set_output() VpsFilterSource is from here: https://github.com/CrendKing/avisynth_filter I have the latest nvidia gpu drivers. Last edited by Milardo; 23rd May 2023 at 03:49. |
|
23rd May 2023, 06:52 | #14 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,259
|
Okay, so the first site package points to 'C:\Users\StarFox\Palemoondownload\testing\pything-3.10.9-embeded-am64' and since you used 'getsitepackages()[0]+'/torch_dependencies/bin/'
your 'torch_dependencies/bin'-folder should be under 'C:\Users\StarFox\Palemoondownload\testing\pything-3.10.9-embeded-am64/torch_dependencies/bin/', is this the case? Since your RIFE call contains 'trt=True', did you install the pytorch and the TensorRT whl ? To install the whl, copy the tensorrt-8.5.2.2-cp310-none-win_amd64.whl to your Vapoursynth folder, open a terminal in it and call: Code:
python -m pip install tensorrt-8.5.2.2-cp310-none-win_amd64.whl Cu Selur |
Thread Tools | Search this Thread |
Display Modes | |
|
|