Reputation: 187
I am already desperate about this problem that I am having.
RuntimeError: inverse: LAPACK library not found in compilation
The easiest way to reproduce it is:
import torch
A = torch.rand(5,5)
torch.inverse(A)
I run this inside a docker container. The part of the dockerfile that compiles pytorch is:
#PyTorch
RUN pip3 install astunparse numpy ninja pyyaml mkl mkl-include setuptools cmake cffi typing_extensions future six requests dataclasses
ENV PYTORCH_INST_VERSION="v1.8.1"
RUN git clone --recursive --branch ${PYTORCH_INST_VERSION} https://github.com/pytorch/pytorch pytorch-src && \
cd pytorch-src && \
export MAX_JOBS=$((`nproc` - 2)) && \
export TORCH_CUDA_ARCH_LIST=${CUDA_ARCH} && \
python3 setup.py install --prefix=/opt/pytorch && \
cp -r /opt/pytorch/lib/python3.8/site-packages/* /usr/lib/python3/dist-packages/ && \
cd /opt && \
rm -rf /opt/pytorch-src
I am not super experienced so I don't know if I need to provide additional details. Please tell me if so.
Upvotes: 1
Views: 4187
Reputation: 13
I had the same problem yesterday, I reinstalled pytorch for my system copying the suitable command as instructed (you should choose the parameters suits your system) check here https://pytorch.org/#:~:text=conda%20install%20pytorch%20torchvision%20torchaudio%20cpuonly%20%2Dc%20pytorch when I run my script again the problem was gone
Upvotes: 1
Reputation: 187
I solved my own problem. I added apt-get liblapack-dev on the dockerfile before the torch compilation. Then I runned the docker container again and it worked.
Upvotes: 3