Skip to content

Instantly share code, notes, and snippets.

@vfdev-5
Last active April 15, 2021 15:05
Show Gist options
  • Save vfdev-5/75e283f5decb042acab3ec6a8b39b271 to your computer and use it in GitHub Desktop.
Save vfdev-5/75e283f5decb042acab3ec6a8b39b271 to your computer and use it in GitHub Desktop.

Reproduce issue: pytorch/pytorch#54415

git clone git@github.com:Algomorph/NeuralTracking.git
cd NeuralTracking/
git checkout 6b8a10b2536eda26f9b613c3521b2fe4894602ad

nano .git/config
# Replace git@gitlab.com:libeigen/eigen.git by https://gitlab.com/libeigen/eigen.git
nano .gitmodules
# Replace git@gitlab.com:libeigen/eigen.git by https://gitlab.com/libeigen/eigen.git
git submodule update --init --recursive

# Commented in csrc/CMakeLists.txt:
# # find_package(Pybind11StubgenExecutable)
# # if (NOT PYBIND11_STUBGEN_EXECUTABLE)
# #     message(FATAL_ERROR "PYBIND11_STUBGEN_EXECUTABLE should be set (pybind11-stubgen command will be found if present in the path)")
# # endif()

# Replace lines 121-122 with
        frames_directory = "seq014_reduced/"
        depth_intrinsics_path = "seq014_reduced/intrinsics.txt"

Execute inside pytorch docker: pytorch/pytorch:1.8.1-cuda11.1-cudnn8-devel

This case can reproduce the issue

docker pull pytorch/pytorch:1.8.1-cuda11.1-cudnn8-devel
docker run -it --name=repro11 -v $PWD:/repro -w /repro --network=host --shm-size 16G pytorch/pytorch:1.8.1-cuda11.1-cudnn8-devel /bin/bash


# Install cmake 3.18
apt update && apt install -y wget git libssl-dev && export version=3.18 && export build=1 && mkdir /tmp/cmake && cd /tmp/cmake && \
    wget https://cmake.org/files/v$version/cmake-$version.$build.tar.gz && tar -xzvf cmake-$version.$build.tar.gz && \
    cd cmake-$version.$build/ && ./bootstrap && make -j8 && make install

ln -s /usr/local/bin/cmake /usr/bin/cmake

cd /repro
mkdir build11 && cd build11
cmake ..
make install-pip-package
cd ..

# Install deps:
apt-get install -y libglu1-mesa-dev libc++-7-dev libudev-dev libusb-1.0-0-dev

pip install scikit-image kornia

# build open3d from source: http://www.open3d.org/docs/latest/compilation.html
cd /tmp
git clone --recursive https://github.com/intel-isl/Open3D
cd Open3D

# util/install_deps_ubuntu.sh
apt-get install -y xorg-dev autoconf libtool libxi-dev libc++abi-7-dev

mkdir build && cd build
cmake -DBUILD_CUDA_MODULE=ON ..
make -j8 install-pip-package
python -c "import open3d"

pip install cupy

cd /repro

python basic_pipeline.py

Execute with pytorch 1.8.1 and cuda 10.2

This case does not reproduce the issue

docker pull nvidia/cuda:10.2-cudnn7-devel-ubuntu18.04
docker run --gpus=all -it --name=repro10 -v $PWD:/repro -w /repro --network=host --shm-size 16G nvidia/cuda:10.2-cudnn7-devel-ubuntu18.04 /bin/bash


# Install cmake 3.18
apt update && apt install -y wget libssl-dev && export version=3.18 && export build=1 && mkdir /tmp/cmake && cd /tmp/cmake && \
    wget https://cmake.org/files/v$version/cmake-$version.$build.tar.gz && tar -xzvf cmake-$version.$build.tar.gz && \
    cd cmake-$version.$build/ && ./bootstrap && make -j8 && make install

ln -s /usr/local/bin/cmake /usr/bin/cmake
cd /repro

apt-get update && ln -fs /usr/share/zoneinfo/Europe/Paris /etc/localtime && \
    apt-get install -y tzdata && \
    dpkg-reconfigure --frontend noninteractive tzdata && \
    apt-get install -y git wget

cd /tmp

wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
hash -r
conda config --set always_yes yes --set changeps1 no
conda update -q conda
pip install ninja

pip install torch torchvision
python -c "import torch; print(torch.cuda.is_available())"

# Install deps:
apt-get install -y libglu1-mesa-dev libc++-7-dev libudev-dev libusb-1.0-0-dev

cd /repro
mkdir build && cd build
cmake ..
make install-pip-package
cd ../

pip install scikit-image kornia

# build open3d from source: http://www.open3d.org/docs/latest/compilation.html
cd /tmp
git clone --recursive https://github.com/intel-isl/Open3D
cd Open3D

# util/install_deps_ubuntu.sh
apt-get install -y xorg-dev autoconf libtool libxi-dev libc++abi-7-dev

mkdir build && cd build
cmake -DBUILD_CUDA_MODULE=ON ..
make install-pip-package
python -c "import open3d"

pip install cupy==6.0.0

cd /repro

python basic_pipeline.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment