Repository: pytorch
Issue: Pytorch with GPU support compile error on Jetson Xavier RX 
Labels: module: build,module: cuda,triaged,module: arm

### 🐛 Describe the bug

Hi, everyone

I'm facing a problem and I need your help. I need a Pytorch and TorchVision with GPU support. I've already tested many different files from here (https://forums.developer.nvidia.com/t/pytorch-for-jetson/72048), but they don't work. 
I'm using the **nvcr.io/nvidia/l4t-tensorrt:r8.0.1-runtime** image because I need also **tensorrt**. This image has supports for Python3.6 and it's possible to install the  torch-1.8.0-cp36-cp36m-linux_aarch64.whl version, but I need that pytorch run in Python3.8 (this version is already there).
So... I thought to compile my own version. And I tried following this recipe https://support.huawei.com/enterprise/ru/doc/EDOC1100289998/4bb2a561/using-source-code-to-install-pytorch and others.

```
Well... I used this command line: **USE_CUDA=ON** CUDA_CUDART_LIBRARY=/usr/local/cuda/lib64/libcudart.so TORCH_CUDA_ARCH_LIST="7.2" python setup.py install bdist_wheel
```

Process:

```
Building wheel torch-1.8.0a0+37c1f4a
-- Building version 1.8.0a0+37c1f4a
cmake -DBUILD_PYTHON=True -DBUILD_TEST=True -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/data/pytorch_v1.8.0/torch -DCMAKE_PREFIX_PATH=/usr/lib/python3/dist-packages -DNUMPY_INCLUDE_DIR=/usr/local/lib/python3.8/dist-packages/numpy/core/include -DPYTHON_EXECUTABLE=/usr/bin/python -DPYTHON_INCLUDE_DIR=/usr/include/python3.8 -DPYTHON_LIBRARY=/usr/lib/libpython3.8.so.1.0 -DTORCH_BUILD_VERSION=1.8.0a0+37c1f4a **-DUSE_CUDA=ON** -DUSE_NUMPY=True /data/pytorch_v1.8.0
```

...

```
-- 
-- ******** Summary ********
--   CMake version         : 3.27.9
--   CMake command         : /usr/local/lib/python3.8/dist-packages/cmake/data/bin/cmake
--   System                : Linux
--   C++ compiler          : /usr/bin/c++
--   C++ compiler version  : 7.5.0
--   CXX flags             :  -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -Wnon-virtual-dtor
--   Build type            : Release
--   Compile definitions   : ONNX_ML=1;ONNXIFI_ENABLE_EXT=1
--   CMAKE_PREFIX_PATH     : /usr/lib/python3/dist-packages
--   CMAKE_INSTALL_PREFIX  : /data/pytorch_v1.8.0/torch
--   CMAKE_MODULE_PATH     : /data/pytorch_v1.8.0/cmake/Modules;/data/pytorch_v1.8.0/cmake/public/../Modules_CUDA_fix
```

...

```
-- /usr/include
-- /usr/lib/aarch64-linux-gnu/libnuma.so
-- Using ATen parallel backend: OMP
**disabling CUDA because USE_CUDA is set false**
```
...

```
   BUILD_PYTHON          : True
--     Python version      : 3.8
--     Python executable   : /usr/bin/python
--     Pythonlibs version  : 3.8.0
--     Python library      : /usr/lib/libpython3.8.so.1.0
--     Python includes     : /usr/include/python3.8
--     Python site-packages: lib/python3/dist-packages
--   BUILD_SHARED_LIBS     : ON
--   CAFFE2_USE_MSVC_STATIC_RUNTIME     : OFF
--   BUILD_TEST            : True
--   BUILD_JNI             : OFF
--   BUILD_MOBILE_AUTOGRAD : OFF
--   INTERN_BUILD_MOBILE   : 
--   USE_BLAS              : 0
--   USE_LAPACK            : 0
--   USE_ASAN              : OFF
--   USE_CPP_CODE_COVERAGE : OFF
**--   USE_CUDA              : OFF**
--   USE_ROCM              : OFF
--   USE_EIGEN_FOR_BLAS    : ON
```

This is my setup:

I'm using a Jetson Xavier RX with the following:

R32 (release), REVISION: 7.2, GCID: 30192233, BOARD: t186ref, EABI: aarch64, DATE: Sun Apr 17 09:53:50 UTC 2022

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Wed_Mar_17_22:37:55_PDT_2021
Cuda compilation tools, release 10.2, V10.2.311
Build cuda_10.2_r440.TC440_70.29732763_0

I installed also:

- apt install python3.8-dev
- pip install typing_extensions scikit-build cython cmake pyyaml==6.0.1

Thank you all.


### Versions

Any torch.

cc @malfet @seemethere @ptrblck @snadampal