如何在 Ubuntu 18.04 LTS 上安装 CUDA 8?

如何在 Ubuntu 18.04 LTS 上安装 CUDA 8?

Ubuntu 18.04 TLS 现已移至 CUDA 9.1,它弃用了 Nvidia Fermi 架构。

我尝试安装 nvidia 的 cuda 8 工具包并且--override选择一个选项(放弃编译器验证),但是安装失败,如下所示:

命令sudo ./cuda_8.0.61_375.26_linux.run --override --toolkitpath /usr/local/cuda-8.0/

输出

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 375.26?
(y)es/(n)o/(q)uit: n

Install the CUDA 8.0 Toolkit?
(y)es/(n)o/(q)uit: y

Enter Toolkit Location
 [ default is /usr/local/cuda-8.0 ]: /usr/local/cuda-8.0

Do you want to install a symbolic link at /usr/local/cuda?
(y)es/(n)o/(q)uit: y

Install the CUDA 8.0 Samples?
(y)es/(n)o/(q)uit: y

Enter CUDA Samples Location
 [ default is /home/user ]: 

Installing the CUDA Toolkit in /usr/local/cuda-8.0 ...
Warning: cannot find Toolkit in /usr/local/cuda-8.0. Use --toolkitpath to specify the toolkit location.
Installing the CUDA Samples in /home/user ...
sh: 1: /usr/local/cuda-8.0/bin/cuda-install-samples-8.0.sh: not found
chown: cannot access '/home/user/NVIDIA_CUDA-8.0_Samples': No such file or directory

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

Driver:   Not Selected
Toolkit:  Installation Failed
Samples:  Installation Failed

答案1

我已通过以下步骤解决了该问题:

  1. 使用以下命令解压 .run 文件:./cuda*.run --tar mxvf(或sh ./cuda*.run --tar mxvf
  2. 将解压后的文件 InstallUtils.pm 复制到 /usr/lib/x86_64-linux-gnu/perl-base
  3. 在终端中输入命令:export $PERL5LIB

答案2

有两种更简洁的方法可以解决这个问题:

  1. 通过以下方式将当前目录设置为 perl 库搜索路径:PERL5LIB=. sh cuda_8.0.61_375.26_linux.run your-other-options。相关关联
  2. 通过以下方式安装缺少的 perl 模块:sudo apt install module-install-perl。相关关联

相关内容