Could NOT find CUDA (missing: CUDA_INCLUDE_DIRS) (found suitable exact version “11.4“)

问题描述:在终端输入nvidia-smi,报了以下错误(明明用的好端端的,早上来实验室,准备条一下代码,莫名其妙地出现这个错误)

NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. 
Make sure that the latest NVIDIA driver is installed and running.

试了很多方法,最后重装显卡驱动(装也只能装最新的版本才可以)
解决了nvidia-smi的问题后,在catkin_make,报了以下错误:

Could NOT find CUDA (missing: CUDA_INCLUDE_DIRS) (found suitable exact version “11.4)

可以看出这是由于系统找不到cuda11.4的文件夹,解决方法如下:
方法一(自行尝试,但是我还是没解决问题)
方法二:由于安装cuda的版本是11.7(原来的cuda版本11.4安装不上),我是生成一个软链接,通过生成cuda11.4的文件夹链接到cuda11.7,这样就能让系统找到cuda11.4的文件夹

cd /usr/local
ln -s /usr/local/cuda-11.7 /usr/local/cuda-11.4

你可能感兴趣的:(错误,cuda,ros)