|
240 | 240 | import platform |
241 | 241 | import os |
242 | 242 |
|
243 | | -# Handle CUDA DLL paths on Windows |
244 | | -if platform.system() == "Windows": |
245 | | - # Common CUDA installation paths |
246 | | - cuda_paths = [ |
247 | | - r"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6/bin", |
248 | | - r"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.5/bin", |
249 | | - r"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.4/bin", |
250 | | - r"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.3/bin", |
251 | | - r"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.2/bin", |
252 | | - r"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/bin", |
253 | | - r"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.0/bin", |
254 | | - r"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/bin", |
255 | | - r"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.7/bin", |
256 | | - r"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/bin", |
257 | | - ] |
258 | | - |
259 | | - # Try to find and add CUDA path |
260 | | - cuda_found = False |
261 | | - for cuda_path in cuda_paths: |
262 | | - if os.path.exists(cuda_path): |
263 | | - os.add_dll_directory(cuda_path) |
264 | | - cuda_found = True |
265 | | - break |
266 | | - |
267 | | - if not cuda_found: |
268 | | - print("Warning: CUDA DLL directory not found. If you encounter DLL loading issues, " |
269 | | - "please ensure CUDA is installed and add its bin directory to the system path.") |
270 | | - |
271 | 243 | from .vectordb import * |
272 | 244 | from ._embed_anything import * |
273 | 245 | import onnxruntime |
|
0 commit comments