Supress CUDA path error in CPU mode
This commit is contained in:
@@ -77,7 +77,7 @@ On Windows, before continuing, ensure that you have the [Visual Studio Build Too
|
|||||||
|
|
||||||
Follow these steps to install Refacer and its dependencies:
|
Follow these steps to install Refacer and its dependencies:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Check if ffmpeg is available (if not, you might to download it and add it to your PATH)
|
# Check if ffmpeg is available (if not, you might to download it and add it to your PATH)
|
||||||
# Windows: download ffmpeg-git-essentials.7z from https://www.gyan.dev/ffmpeg/builds/
|
# Windows: download ffmpeg-git-essentials.7z from https://www.gyan.dev/ffmpeg/builds/
|
||||||
# Other systems: see a tutorial https://www.hostinger.com/tutorials/how-to-install-ffmpeg
|
# Other systems: see a tutorial https://www.hostinger.com/tutorials/how-to-install-ffmpeg
|
||||||
@@ -107,7 +107,7 @@ Follow these steps to install Refacer and its dependencies:
|
|||||||
|
|
||||||
# For CoreML only (compatible with MacOSX, requires Silicon architecture):
|
# For CoreML only (compatible with MacOSX, requires Silicon architecture):
|
||||||
pip install -r requirements-COREML.txt
|
pip install -r requirements-COREML.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
For NVIDIA GPU, make sure you have both NVIDIA GPU Computing Toolkit and NVIDIA CUDNN installed. The onnxruntime-gpu version must match your version of CUDA. This example uses onnxruntime-gpu 1.21.0, which is compatible with CUDA 12.6 and CUDNN 9.4 - Refacer.py is pre-loading both libraries. Remember to update the paths if needed in refacer.py if you have different location or versions.
|
For NVIDIA GPU, make sure you have both NVIDIA GPU Computing Toolkit and NVIDIA CUDNN installed. The onnxruntime-gpu version must match your version of CUDA. This example uses onnxruntime-gpu 1.21.0, which is compatible with CUDA 12.6 and CUDNN 9.4 - Refacer.py is pre-loading both libraries. Remember to update the paths if needed in refacer.py if you have different location or versions.
|
||||||
|
|
||||||
|
|||||||
@@ -30,8 +30,12 @@ gc = __import__('gc')
|
|||||||
# Preload NVIDIA DLLs if Windows
|
# Preload NVIDIA DLLs if Windows
|
||||||
if sys.platform in ("win32", "win64"):
|
if sys.platform in ("win32", "win64"):
|
||||||
if hasattr(os, "add_dll_directory"):
|
if hasattr(os, "add_dll_directory"):
|
||||||
os.add_dll_directory(r"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\bin")
|
try:
|
||||||
os.add_dll_directory(r"C:\Program Files\NVIDIA\CUDNN\v9.4\bin\12.6")
|
os.add_dll_directory(r"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\bin")
|
||||||
|
os.add_dll_directory(r"C:\Program Files\NVIDIA\CUDNN\v9.4\bin\12.6")
|
||||||
|
except Exception as e:
|
||||||
|
print(f"[INFO] Failed to add CUDA or CUDNN DLL directory: {e}")
|
||||||
|
print("[INFO] This error can be ignored if running in CPU mode. Otherwise, make sure the paths are correct.")
|
||||||
|
|
||||||
if hasattr(rt, "preload_dlls"):
|
if hasattr(rt, "preload_dlls"):
|
||||||
rt.preload_dlls()
|
rt.preload_dlls()
|
||||||
|
|||||||
Reference in New Issue
Block a user