Skip to content

Commit 22d6345

Browse files
authored
Merge pull request #7 from intellistream/doc_pr
Doc: Small fix for cpu torch and compilation with Debug mode.
2 parents 2bddff9 + fb2699a commit 22d6345

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,5 @@ doc/
3737
/cmake-build-debug/_deps/
3838
/cmake-build-release/
3939
/cmake-build-release/_deps/
40+
41+
/.vscode

‎README.md‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,11 @@ pip3 install torch==1.13.0 torchvision torchaudio
8787
(w/o CUDA)
8888

8989
```shell
90-
pip3 install torch==1.13.0 torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu
90+
pip3 install --ignore-installed torch==1.13.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
9191
```
9292

93+
*Note: Conflict between torch1.13.0+cpu and torchaudio+cpu may occur under python version > 3.10*
94+
9395
#### (Optional) Pytorch with Cuda backend on jetson
9496

9597
Refer to https://docs.nvidia.com/deeplearning/frameworks/install-pytorch-jetson-platform/index.html.
@@ -118,10 +120,20 @@ pip install torchviz
118120
```shell
119121
export CUDACXX=/usr/local/cuda/bin/nvcc
120122
mkdir build && cd build
123+
```
124+
125+
Build for release by default:
126+
```shell
121127
cmake -DCMAKE_PREFIX_PATH=`python3 -c 'import torch;print(torch.utils.cmake_prefix_path)'` ..
122128
make
123129
```
124130

131+
Or you can build with debug mode to debug cpp dynamic lib:
132+
```shell
133+
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=`python3 -c 'import torch;print(torch.utils.cmake_prefix_path)'` ..
134+
make
135+
```
136+
125137
## An open box test
126138

127139
```shell
@@ -201,3 +213,4 @@ You will find the figures then.
201213
2. Some pytorch version can not work well with liblog4cxx and googletest, so we diabled it.
202214
3. Clion may fail to render and highlight the torch apis. In this case, kindly type a random line of "555"
203215
to validate the highlight when you need it, and comment it during a compile. :)
216+
4. When setting up torch for cpu under python version > 3.10, torch == 1.13.0 would conflict with torchaudio according to https://pytorch.org/audio/stable/installation.html. Use Python version <= 3.10 for smooth installation.

0 commit comments

Comments
 (0)