修复在 Ubuntu 18.04 LTS 中安装 Cuda 7.5 时出现的问题

修复在 Ubuntu 18.04 LTS 中安装 Cuda 7.5 时出现的问题

我有 Ubuntu 18.04 LTS,我想安装Cuda 7.5(因为这个版本与我的 Nvidia GF 820m 显卡兼容)。我将其配置gcc-4.8为默认gcc(因为它是 Cuda 7.5 C 编译器),然后使用安装运行文件sudo ./cuda_7.5.18_linux.run。以下是我安装 CUDA 的终端输出:

    -------------------------------------------------------------
Do you accept the previously read EULA? (accept/decline/quit): accespt
Do you accept the previously read EULA? (accept/decline/quit): accept
You are attempting to install on an unsupported configuration. Do you wish to continue? ((y)es/(n)o) [ default is no ]: y
Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 352.39? ((y)es/(n)o/(q)uit): n
Install the CUDA 7.5 Toolkit? ((y)es/(n)o/(q)uit): y
Enter Toolkit Location [ default is /usr/local/cuda-7.5 ]: 
/usr/local/cuda-7.5 is not writable.
Do you wish to run the installation with 'sudo'? ((y)es/(n)o): y
Please enter your password: 
Do you want to install a symbolic link at /usr/local/cuda? ((y)es/(n)o/(q)uit): y
Install the CUDA 7.5 Samples? ((y)es/(n)o/(q)uit): y
Enter CUDA Samples Location [ default is /home/adel ]: 
Installing the CUDA Toolkit in /usr/local/cuda-7.5 ...
Missing recommended library: libGL.so

Error: cannot find Toolkit in /usr/local/cuda-7.5

===========
= Summary =
===========

Driver:   Not Selected
Toolkit:  Installation Failed
Samples:  Cannot find Toolkit in /usr/local/cuda-7.5

Logfile is /tmp/cuda_install_2279.log

是否需要修复这些缺失的库 libGL.so 来解决问题?

笔记:已安装 Nvidia 驱动程序nvidia-driver-390

更新 1:尾部输出-n 20 /tmp/cuda_install_2279.log

cp: cannot stat '/usr/local/cuda-7.5/bin/.uninstall_manifest_do_not_delete.txt': No such file or directory

Missing recommended library: libGL.so

Error: cannot find Toolkit in /usr/local/cuda-7.5

===========
= Summary =
===========

Driver:   Not Selected
Toolkit:  Installation Failed
Samples:  Cannot find Toolkit in /usr/local/cuda-7.5


Logfile is /tmp/cuda_install_2279.log

更新2:日志文件的内容:

Using more to view the EULA.
Installing the CUDA Toolkit in /usr/local/cuda-7.5 ...
Verifying archive integrity... All good.

Uncompressing NVIDIA CUDA...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Can't locate InstallUtils.pm in @INC (you may need to install the InstallUtils module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at ./install-linux.pl line 6.

BEGIN failed--compilation aborted at ./install-linux.pl line 6.

Verifying archive integrity... All good.

Uncompressing NVIDIA CUDA Samples................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Can't locate InstallUtils.pm in @INC (you may need to install the InstallUtils module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at ./install-sdk-linux.pl line 6.

BEGIN failed--compilation aborted at ./install-sdk-linux.pl line 6.

'uninstall_cuda_7.5.pl' -> '/usr/local/cuda-7.5/bin/uninstall_cuda_7.5.pl'

答案1

安装以下软件包:

sudo apt install freeglut3-dev build-essential libx11-dev libxmu-dev \
libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev libglfw3-dev libgles2-mesa-dev

sudo apt install sudo apt-get install linux-headers-$(uname -r)

对于 Cuda 7.5 安装类型,请输入以下命令行:

wget  http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers\
/cuda-repo-ubuntu1504-7-5-local_7.5-18_amd64.deb

sudo dpkg -i cuda-repo-ubuntu1504-7-5-local_7.5-18_amd64.deb
sudo apt-get update
sudo apt-get install cuda

为了轻松安装 Cuda 9.1,请使用此处提供的说明关联

sudo dpkg -i cuda-repo-ubuntu1704-9-1-local_9.1.85-1_amd64.deb
sudo apt-key add /var/cuda-repo-<version>/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda

或者使用默认的 Ubuntu multiverse repo 安装它:

sudo apt install nvidia-cuda-toolkit nvidia-cuda-dev nvidia-cuda-doc nvidia-cuda-gdb

相关内容