Skip to content

Instantly share code, notes, and snippets.

@w32zhong
Last active May 11, 2023 02:53
Show Gist options
  • Save w32zhong/a6e130fdc03b067abb2927b54729abb7 to your computer and use it in GitHub Desktop.
Save w32zhong/a6e130fdc03b067abb2927b54729abb7 to your computer and use it in GitHub Desktop.
Build PyTorch 2.0
# clone pytorch at b004c0b3c6a1ee39ba0b512a00d95e7f83852556 with all submodules.
git clone -b main --recursive https://github.com/pytorch/pytorch
cd pytorch
inotifywait --event create -rm /home/tk/anaconda3/envs/pytorch-ref/
conda deactivate
conda env remove -n pytorch-src
conda create -n pytorch-src python=3.11
conda activate pytorch-src
conda install cmake
# refer to https://stackoverflow.com/questions/6622454/cuda-incompatible-with-my-gcc-version
conda install -c conda-forge gcc_linux-64=11.2 gxx_linux-64=11.2
#conda install -c "nvidia/label/cuda-11.8.0" cuda-toolkit cuda cudnn
conda install -c conda-forge sysroot_linux-64=2.17
pip install -r requirements.txt
#conda install -c pytorch magma-cuda118
#conda install mkl mkl-include
export CMAKE_PREFIX_PATH=$CONDA_PREFIX && echo $CMAKE_PREFIX_PATH
rm -rf build
python setup.py clean
#python setup.py build
python setup.py develop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment