summaryrefslogtreecommitdiff
path: root/sci-libs/pytorch/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-02-16 02:03:12 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-02-16 02:03:12 +0000
commitb435e036d9775b71048373b91d4c7c3398826858 (patch)
treea052e1ef783006a9481cac27318cd9b3a6fec7a8 /sci-libs/pytorch/files
parent0da5c40f264673f79a9d8c95d465d1cab718d282 (diff)
gentoo auto-resync : 16:02:2023 - 02:03:12
Diffstat (limited to 'sci-libs/pytorch/files')
-rw-r--r--sci-libs/pytorch/files/pytorch-1.13.1-global-dlopen.patch23
1 files changed, 23 insertions, 0 deletions
diff --git a/sci-libs/pytorch/files/pytorch-1.13.1-global-dlopen.patch b/sci-libs/pytorch/files/pytorch-1.13.1-global-dlopen.patch
new file mode 100644
index 000000000000..4f414be67a29
--- /dev/null
+++ b/sci-libs/pytorch/files/pytorch-1.13.1-global-dlopen.patch
@@ -0,0 +1,23 @@
+Don't hardcode the library path. Leave it to the dynamic loader.
+
+Index: pytorch-1.13.1/torch/__init__.py
+===================================================================
+--- a/torch/__init__.py 2023-02-15 20:27:51.747853677 +0100
++++ b/torch/__init__.py 2023-02-15 20:28:23.506341918 +0100
+@@ -169,14 +169,14 @@
+ lib_path = os.path.join(os.path.dirname(here), 'lib', lib_name)
+
+ try:
+- ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
++ ctypes.CDLL(lib_name, mode=ctypes.RTLD_GLOBAL)
+ except OSError as err:
+ # Can only happen of wheel with cublas as PYPI deps
+ # As PyTorch is not purelib, but nvidia-cublas-cu11 is
+ if 'libcublas.so.11' not in err.args[0]:
+ raise err
+ _preload_cuda_deps()
+- ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
++ ctypes.CDLL(lib_name, mode=ctypes.RTLD_GLOBAL)
+
+
+ if (USE_RTLD_GLOBAL_WITH_LIBTORCH or os.getenv('TORCH_USE_RTLD_GLOBAL')) and \