I have emerged sci-libs/pytorch-1.6.0 however I get following error when I try to import it in python: ''' python -c "import torch" Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib64/python3.6/site-packages/torch/__init__.py", line 188, in <module> _load_global_deps() File "/usr/lib64/python3.6/site-packages/torch/__init__.py", line 141, in _load_global_deps ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL) File "/usr/lib64/python3.6/ctypes/__init__.py", line 348, in __init__ self._handle = _dlopen(self._name, mode) OSError: /usr/lib64/python3.6/site-packages/torch/lib/libtorch_global_deps.so: cannot open shared object file: No such file or directory ''' Is there any way I can solve this?
eix -v pytorch * sci-libs/pytorch [1] Available versions: (~)1.4.0_p0 (~)1.6.0 IUSE (all versions): asan atlas cuda eigen +fbgemm ffmpeg gflags glog +gloo leveldb lmdb mkl mkldnn mpi namedtensor +nnpack numa +numpy +observers +openblas opencl opencv +openmp +python +qnnpack redis static tbb test tools zeromq Installed versions: Version: 1.6.0 Date: 12:05:25 09/08/20 USE: fbgemm gloo nnpack numpy observers openblas openmp python qnnpack -asan -atlas -cuda -eigen -ffmpeg -gflags -glog -leveldb -lmdb -mkl -mkldnn -mpi -namedtensor -numa -opencl -opencv -redis -static -test -tools -zeromq PYTHON_TARGETS="python3_6" DEPEND: dev-libs/protobuf dev-python/pyyaml[python_targets_python3_6(-),-python_single_target_python3_6(-)] dev-python/numpy[python_targets_python3_6(-),-python_single_target_python3_6(-)] sci-libs/openblas dev-lang/python:3.6 >=dev-lang/python-exec-2:2/2=[python_targets_python3_6(-),-python_single_target_python3_6(-)] dev-python/pybind11[python_targets_python3_6(-),-python_single_target_python3_6(-)] dev-libs/libuv dev-python/setuptools[python_targets_python3_6(-),-python_single_target_python3_6(-)] dev-cpp/tbb app-arch/zstd dev-python/protobuf-python[python_targets_python3_6(-),-python_single_target_python3_6(-)] dev-python/pybind11[python_targets_python3_6(-),-python_single_target_python3_6(-)] sys-fabric/libibverbs sys-process/numactl RDEPEND: dev-libs/protobuf dev-python/pyyaml[python_targets_python3_6(-),-python_single_target_python3_6(-)] dev-python/numpy[python_targets_python3_6(-),-python_single_target_python3_6(-)] sci-libs/openblas dev-lang/python:3.6 >=dev-lang/python-exec-2:2/2=[python_targets_python3_6(-),-python_single_target_python3_6(-)] dev-python/pybind11[python_targets_python3_6(-),-python_single_target_python3_6(-)] dev-libs/libuv dev-lang/python:3.6 >=dev-lang/python-exec-2:2/2=[python_targets_python3_6(-),-python_single_target_python3_6(-)] BDEPEND: dev-lang/python:3.6 >=dev-lang/python-exec-2:2/2=[python_targets_python3_6(-),-python_single_target_python3_6(-)] >=dev-python/setuptools-42.0.2[python_targets_python3_6(-),-python_single_target_python3_6(-)] dev-util/ninja >=dev-util/cmake-3.9.6 SRC_URI: EAPI: 7 Best versions/slot: (~)1.6.0 Homepage: https://pytorch.org/ Description: Tensors and Dynamic neural networks in Python with strong GPU acceleration License: BSD [1] "science" /var/lib/overlays/science
Oh wait. This is from ::science.
Thanks I can reproduce this error.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/proj/sci.git/commit/?id=72df8ef8dc56f868d4feaf7b558e93562b7627f3 commit 72df8ef8dc56f868d4feaf7b558e93562b7627f3 Author: Benda Xu <heroxbd@gentoo.org> AuthorDate: 2020-08-11 13:41:24 +0000 Commit: Benda Xu <heroxbd@gentoo.org> CommitDate: 2020-08-11 13:44:16 +0000 sci-libs/pytorch: donot hardcode the library path. Closes: https://bugs.gentoo.org/736643 Package-Manager: Portage-2.3.88, Repoman-2.3.18 Signed-off-by: Benda Xu <heroxbd@gentoo.org> sci-libs/pytorch/files/pytorch-1.6.0-global-dlopen.patch | 15 +++++++++++++++ sci-libs/pytorch/pytorch-1.6.0.ebuild | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-)
Thanks!
Hendrik, thanks for reporting!
Created attachment 655478 [details] build.log of emerge pytorch Hello Benda, I am trying to emerge pytorch with cuda enabled now, but I get an error with the global-dlopen.patch (see attachment for full log): ``` * ERROR: sci-libs/pytorch-1.6.0::science failed (prepare phase): * patch -p1 failed with /var/tmp/portage/sci-libs/pytorch-1.6.0/files/pytorch-pytorch-1.6.0-global-dlopen.patch ``` Am I doing something wrong? The patch was working fine without cuda enabled.