Jetson 上cmake 带cuda 的程序报错

报错信息为: 找不到CUDA 架构
https://blog.csdn.net/qq_19449259/article/details/128001426

把cuda 的nvcc 加入环境变量之后,又报了如下错误:
报错信息如下:
-D__CUDACC_VER_MAJOR__=10 -D__CUDACC_VER_MINOR__=2 -D__CUDACC_VER_BUILD__=300 -include "cuda_runtime.h" "CMakeCUDACompilerId.cu" -o "tmp/CMakeCUDACompilerId.cpp1.ii" 
In file included from /usr/local/cuda/bin/../targets/aarch64-linux/include/cuda_runtime.h:83,
                 from :
/usr/local/cuda/bin/../targets/aarch64-linux/include/crt/host_config.h:138:2: error: #error -- unsupported GNU version! gcc versions later than 8 are not supported!
  138 | #error -- unsupported GNU version! gcc versions later than 8 are not supported!
      |  ^~~~~
# --error 0x1 --
https://www.cnblogs.com/devilmaycry812839668/p/16864901.html
原因:gcc 版本太高了
解决办法:
sudo apt-get install gcc-8

sudo apt-get install g++-8

sudo ln -s /usr/bin/gcc-8 /usr/local/cuda/bin/gcc
 

你可能感兴趣的:(各种编程,Jetson,报错)