facebookresearch / pytorch3d

PyTorch3D is FAIR's library of reusable components for deep learning with 3D data
https://pytorch3d.org/
Other
8.7k stars 1.3k forks source link

Installing PyTorch3D with CUDA 11.3 and PyTorch 1.11.0 with Python 3.8 #1691

Closed adfayed closed 10 months ago

adfayed commented 10 months ago

If you do not know the root cause of the problem / bug, and wish someone to help you, please post according to this template:

🐛 Bugs / Unexpected behaviors

NOTE: Please look at the existing list of Issues tagged with the label 'bug`. Only open a new issue if this bug has not already been reported. If an issue already exists, please comment there instead..

Instructions To Reproduce the Issue:

Following the exact installation steps on Installing prebuilt binaries for PyTorch3D (step 2) using install wheels for Linux in INSTALL.md:

I'm quoting: "We have prebuilt wheels with CUDA for Linux for PyTorch 1.11.0, for each of the supported CUDA versions, for Python 3.8 and 3.9. This is for ease of use on Google Colab. These are installed in a special way. For example, to install for Python 3.8, PyTorch 1.11.0 and CUDA 11.3"

So I go with the exact configuration CUDA 11.3 Docker base image with python 3.8, and then I try to install PyTorch 1.11.0 and Pytorch3D.

First I run pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py38_cu113_pyt1110/download.html (as recommended in the INSTALL.md)

Then I try to run pip3 install torch==1.11.0 in a fresh CUDA 11.3 docker container (as recommended) using docker image nvcr.io/nvidia/cuda:11.3.1-devel-ubuntu20.04

/usr/local/lib/python3.8/dist-packages/pytorch3d/_C.cpython-38-x86_64-linux-gnu.so is missing some libraries: image

I find some of these packages under /usr/local/lib/python3.8/dist-packages/torch/lib/ so I export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/python3.8/dist-packages/torch/lib/ and almost all of them get linked correctly except: libtorch_cuda_cu.so => not found and libtorch_cuda_cpp.so => not found

Please help. How do I get those two .so files? Cannot seem to find a way.

I also tried installing PyTorch 1.11.0 from pip via pip3 install torch=1.11.0 and via the torch-1.11.0+cu102-cp38-cp38-linux_x86_64.whl wheel at https://download.pytorch.org/whl/torch/

I get the same issue.

libtorch_cuda_cu.soandlibtorch_cuda_cpp.so` are not installed with PyTorch 1.11.0

adfayed commented 10 months ago

Used PyTorch's base Docker image and that worked.

FROM pytorch/pytorch:1.11.0-cuda11.3-cudnn8-runtime