本文最后更新于 134 天前,其中的信息可能已经有所发展或是发生改变。
build torch2.1.2 for cuda11.4, python3.8
torch-2.1.2+cu114-cp38-cp38-win_amd64.whl
torch-2.1.2+cu114-cp38-cp38-linux_x86_64.whl
torch-2.1.2+cu114-cp38-cp38-linux_aarch64.whl
torch-2.1.2+cu114.tegra-cp38-cp38-linux_aarch64
———-
Linux environment:
docker container from nvcr.io/nvidia/cuda:11.4.2-cudnn8-devel-ubuntu20.04
# install dependence apt update && apt install -y --no-install-recommends git pkg-config curl python3 python3-pip python3-dev build-essential libjpeg-dev pip3 install numpy==1.22.2 scipy==1.10.1 pyyaml==6.0.1 pandas==1.5.3 onnx==1.14.0 triton==2.1.0 transformers==4.30.2 cmake ninja curl -fkLO https://nchc.dl.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz && tar -zxvf *.gz && rm *.gz curl -fkLO https://jaist.dl.sourceforge.net/project/libpng/libpng16/1.6.44/libpng-1.6.44.tar.gz && tar -zxvf *.gz && rm *.gz cd zlib-1.2.11 && make && make install && cd ../libpng-1.6.44 && ./configure && make && make install && cd ..
# build torch export TORCH_CUDA_ARCH_LIST="3.5;3.7;5.0;5.2;6.0;6.1;7.0;7.5;8.0;8.6" export PYTORCH_BUILD_VERSION=2.1.2+cu114 export PYTORCH_BUILD_NUMBER=0 # build for Tegra # export TORCH_CUDA_ARCH_LIST="7.2;8.7" # export USE_CUDNN=0 git clone --recursive -b v2.1.2 https://github.com/pytorch/pytorch.git && cd pytorch python3 setup.py bdist_wheel install
# build torchvision export PYTORCH_VERSION=2.1.2+cu114 export TORCHVISION_USE_PNG=1 export TORCHVISION_USE_JPEG=1 export TORCHVISION_USE_NVJPEG=1 export BUILD_VERSION=0.16.2+cu114 git clone --recursive -b v0.16.2 https://github.com/pytorch/vision.git && cd vision python3 setup.py bdist_wheel
# build torchaudio export PYTORCH_VERSION=2.1.2+cu114 export BUILD_VERSION=2.1.2+cu114 git clone --recursive -b v2.1.2 https://github.com/pytorch/audio.git && cd audio python3 setup.py bdist_wheel
———-
Windows environment:
Windows Server 2022; Visual Studio 2019; CUDA Toolkit 11.4.2; cuDNN 8.2.4.15; python 3.8.10; cmake
# install dependence pip install wheel numpy==1.22.2 scipy==1.10.1 pyyaml==6.0.1 pandas==1.5.3 onnx==1.14.0 transformers==4.30.2 mkl ninja sympy
# build torch set "VS150COMNTOOLS=%PROGRAMFILES(x86)%\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build" set CMAKE_GENERATOR=Visual Studio 16 2019 set DISTUTILS_USE_SDK=1 set CMAKE_GENERATOR=Ninja set USE_CUDA=1 set USE_CUDNN=1 set CUDNN_INCLUDE_DIR="%PROGRAMFILES%\NVIDIA GPU Computing Toolkit\CUDA\v11.4\include" set TORCH_CUDA_ARCH_LIST=Kepler;Maxwell;Pascal;Volta;Turing;Ampere set PYTORCH_BUILD_VERSION=2.1.2+cu114 set PYTORCH_BUILD_NUMBER=0 call "%VS150COMNTOOLS%\vcvarsall.bat" x64 git clone --recursive -b v2.1.2 https://github.com/pytorch/pytorch.git && cd pytorch python setup.py bdist_wheel