1

I am trying to build Pytorch from source following tutorial on

  • Jetson: Jetson 5.0.2 GA
  • os: Ubuntu 20.04.4 LTS focal
  • cmake version: 3.16.3, installed along with ROS noetic.
  • gcc: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0

The error occurred at the installation step python3 setup.py bdist_wheel:

Building wheel torch-1.12.0
-- Building version 1.12.0
cmake -GNinja -DBUILD_PYTHON=True -DBUILD_TEST=True -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/media/gvsc/reddy_reddy/pytorch/torch -DCMAKE_PREFIX_PATH=/usr/lib/python3.8/site-packages;/home/gvsc/Admin/Projects/racer_ws/devel:/opt/ros/noetic -DNUMPY_INCLUDE_DIR=/usr/lib/python3/dist-packages/numpy/core/include -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTHON_INCLUDE_DIR=/usr/include/python3.8 -DPYTHON_LIBRARY=/usr/lib/libpython3.8.so.1.0 -DTORCH_BUILD_VERSION=1.12.0 -DUSE_NCCL=0 -DUSE_NUMPY=True -DUSE_PYTORCH_QNNPACK=0 -DUSE_QNNPACK=0 /media/gvsc/reddy_reddy/pytorch
-- Could not find ccache. Consider installing ccache to speed up compilation.
-- Performing Test COMPILER_WORKS
-- Performing Test COMPILER_WORKS - Failed
CMake Error at cmake/MiscCheck.cmake:34 (message):
  Could not run a simple program built with your compiler.  If you are trying
  to use -fsanitize=address, make sure libasan is properly installed on your
  system (you can confirm if the problem is this by attempting to build and
  run a small program.)
Call Stack (most recent call first):
  CMakeLists.txt:679 (include)


-- Configuring incomplete, errors occurred!
See also "/media/gvsc/reddy_reddy/pytorch/build/CMakeFiles/CMakeOutput.log".
See also "/media/gvsc/reddy_reddy/pytorch/build/CMakeFiles/CMakeError.log".

  • libasan is installed as libasan5
  • I also verified that the machine can use cmake to build a simple program by following the cmake tutorial. I could run cmake . to get cmake-tutotrial built.

If anyone can suggest a solution, I will be very grateful!

starball
  • 20,030
  • 7
  • 43
  • 238
MsLate
  • 149
  • 2
  • 10
  • Weird, it might be worth it to try `sudo apt-get update` and `sudo apt-get upgrade` if you haven't already. – Brock Brown May 10 '23 at 16:53
  • @user `gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0` – MsLate May 10 '23 at 17:32
  • related: [How to know which gcc version to choose when compiling pytorch from source?](https://stackoverflow.com/q/61340939/11107541) – starball May 10 '23 at 17:35
  • @user GCC version seems good based on the [link](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html). Added my OS and GCC info in the question description. – MsLate May 10 '23 at 17:49

0 Answers0