diff '--color=auto' -ur pytorch-v2.14.0.orig/torch/__init__.py pytorch-v2.14.0/torch/__init__.py
--- pytorch-v2.14.0.orig/torch/__init__.py	2026-09-02 21:13:02.944339768 +0200
+++ pytorch-v2.14.0/torch/__init__.py	2026-09-02 21:16:34.297917402 +0200
@@ -337,15 +337,13 @@
         raise AssertionError(f"Should only be called on Linux, got {platform.system()}")
 
     lib_path = None
-    for path in sys.path:
-        candidate_lib_paths = _get_cuda_dep_paths(path, lib_folder, lib_name)
-        if candidate_lib_paths:
-            lib_path = candidate_lib_paths[0]
-            break
+    candidate_lib_paths = glob.glob(os.path.join("/opt/cuda/%LIB_DIR%", lib_name))
+    if candidate_lib_paths:
+        lib_path = candidate_lib_paths[0]
     if not lib_path and required:
         raise ValueError(f"{lib_name} not found in the system path {sys.path}")
     if lib_path:
-        ctypes.CDLL(lib_path)
+        ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
 
 
 def _preload_cuda_deps(err: OSError | None = None, required: bool = True) -> None:
@@ -383,7 +381,7 @@
     # some of these wheels (e.g. just a cupti wheel alongside a system CUDA)
     # preloads the ones present instead of aborting on the first missing one.
     for lib_folder, lib_name in cuda_libs:
-        _preload_cuda_lib(lib_folder, lib_name, required=required)
+        _preload_cuda_lib(lib_folder, lib_name, required=False)
 
     # libnvToolsExt is Optional Dependency
     _preload_cuda_lib("nvtx", "libnvToolsExt.so.*[0-9]", required=False)
