summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Tupone <tupone@gentoo.org>2023-02-15 20:40:24 +0100
committerAlfredo Tupone <tupone@gentoo.org>2023-02-15 20:40:24 +0100
commitde632cbceb0e91127bcaefb47e3538ca48477b15 (patch)
tree7096efc0d6f6a883fb73fb6bfaf87ad7e9105d53 /sci-libs/pytorch/files
parentsci-libs/caffe2: add 1.13.1 (diff)
downloadgentoo-de632cbceb0e91127bcaefb47e3538ca48477b15.tar.gz
gentoo-de632cbceb0e91127bcaefb47e3538ca48477b15.tar.bz2
gentoo-de632cbceb0e91127bcaefb47e3538ca48477b15.zip
sci-libs/pytorch: add 1.13.1
Closes: https://bugs.gentoo.org/893594 Signed-off-by: Alfredo Tupone <tupone@gentoo.org>
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 \