You're right, the dlib initialization script requires the user to have the CUDA SDK and cuDNN installed, while torch only needs to be installed in the same environment.
Replace the __init__.py file in the dlib folder with the attached version and clear the cache.
Key Changes applied in the attached script:
Removed Static CUDA Paths: Eliminated hardcoded references to the NVIDIA CUDA Toolkit.
Dynamic Torch Path Detection: Used torch.__file__ to locate the torch package and constructed the path to its lib folder.
Windows-Specific Logic: Wrapped the DLL path modification in a check for os.name == 'nt' to ensure it only runs on Windows.
Robust Error Handling: Maintained try-except blocks to prevent failures if torch is not installed or paths are inaccessible.
Installation Requirement:
Ensure that the torch package with CUDA 13.0 is installed in the same Python environment as dlib, so that the script can locate torch\lib correctly.
This modification allows dlib to dynamically use the CUDA DLLs bundled with torch, improving portability and reducing dependency on system-wide CUDA installations.
I installed 'dlib-20.0.99-cp313-cp313-win_amd64.whl', then replaced the __init__.py, made sure to delete the __pycache__ folder inside Hybrid\64bit\Vapoursynth\Lib\site-packages\dlib and Hybrid\64bit\Vapoursynth\Lib\site-packages.
Sadly I get:
2026-02-16 18:46:54.861
Error on frame 0 request:
Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 3222, in vapoursynth.publicFunction
File "src/cython/vapoursynth.pyx", line 3224, in vapoursynth.publicFunction
File "src/cython/vapoursynth.pyx", line 837, in vapoursynth.FuncData.__call__
File "F:\Hybrid\64bit\Vapoursynth\Lib\site-packages\torch\utils\_contextlib.py", line 124, in decorate_context
return func(*args, **kwargs)
File "F:\Hybrid\64bit\Vapoursynth\Lib\site-packages\vscodeformer\__init__.py", line 122, in inference
face_helper[local_index].get_face_landmarks_5(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
only_center_face=only_center_face, resize=640, eye_dist_threshold=5
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "F:\Hybrid\64bit\Vapoursynth\Lib\site-packages\vscodeformer\face_restoration_helper.py", line 218, in get_face_landmarks_5
return self.get_face_landmarks_5_dlib(only_keep_largest)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
File "F:\Hybrid\64bit\Vapoursynth\Lib\site-packages\vscodeformer\face_restoration_helper.py", line 182, in get_face_landmarks_5_dlib
det_faces = self.face_detector(self.input_img, scale)
RuntimeError: Error while calling cudaOccupancyMaxPotentialBlockSize(&num_blocks,&num_threads,K) in file D:\PProjects\dlib\dlib\cuda\cuda_utils.h:164. code: 209, reason: no kernel image is available for execution on the device
Hmmm,... I see 'cuda-toolkit 13.1.1' in my pip list output.
Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.