柳鲲鹏
驱动要先安装好,396。参考之前的安装文章。
先安装一些文件,否则会提示缺少文件。
sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev
下载
https://developer.nvidia.com/cuda-toolkit-archive
根据自己需要,下载相应的版本。
安装CUDA
sudo sh ./cuda_9.2.148_396.37_linux.run
除了驱动不安装,其他要么y,要么回车(默认)
配置
vi .bashrc export PATH=/usr/local/cuda/bin:$PATH export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH source .bashrc
检查NVCC版本结果
nvcc -V
编译运行
cd NVIDIA_CUDA-9.2_Samples/1_Utilities/deviceQuery make ./deviceQuery
忽略警告
在吾机器上,驱动是390,安装CUDA之后,提示
***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 384.00 is required for CUDA 9.2 functionality to work. To install the driver using this installer, run the following command, replacing <CudaInstaller> with the name of this run file: sudo <CudaInstaller>.run -silent -driver
在吾机器上,安装之后提示这个。吾安装驱动是396,怎么有这个提示?吾怀疑必须安装自带的驱动,才会不提示。也就是说,这是个BUG。