sudo apt-get install linux-headers-$(uname -r) 中的 Cuda 安装错误

sudo apt-get install linux-headers-$(uname -r) 中的 Cuda 安装错误

我在带有持久数据的 liveUSB 上运行 Ubuntu 16.04.6,我的机器有 Nvidia Quadro M1200 和内置 Intel HD 630。在附加驱动程序中,我选择Using NVIDIA binary driver -version 384.130 from nvidia-384(proprietary, tested)应用更改,然后重新启动并在 BIOS 中禁用安全启动。

但是当我启动到 Ubuntu 并输入命令时nvidia-smi,它显示nvidia-smi: command not found

检查nvidia-settings得到错误:

** Message: PRIME: No offloading required. Abort
** Message: PRIME: is it supported? no

ERROR: nvidia-settings could not find the registry key file. This file should
       have been installed along with this driver at
       /usr/share/nvidia/nvidia-application-profiles-key-documentation. The
       application profiles will continue to work, but values cannot be
       prepopulated or validated, and will not be listed in the help text.
       Please see the README for possible values and descriptions.

然后我跟着Cuda 安装指南-Linux当我尝试确保内核头与内核版本匹配时遇到了问题。

$ uname -r
4.15.0-45-generic
$ sudo apt-get install linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
linux-headers-4.15.0-45-generic is already the newest version (4.15.0-45.48~16.04.1).
0 upgraded, 0 newly installed, 0 to remove and 418 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up nvidia-384 (384.130-0ubuntu0.16.04.2) ...
/usr/sbin/update-initramfs: 6: /usr/sbin/update-initramfs: cannot create /cdrom/casper/vmlinuz: Read-only file system
dpkg: error processing package nvidia-384 (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of libcuda1-384:
 libcuda1-384 depends on nvidia-384 (>= 384.130); however:
  Package nvidia-384 is not configured yet.

dpkg: error processing package libcuda1-384 (--configure):
 dependency problems - leaving unconfigured
Setting up linux-image-4.4.0-187-generic (4.4.0-187.217) ...
No apport report written because the error message indicates its a followup error from a previous failure.

dpkg: dependency problems prevent configuration of nvidia-opencl-icd-384:
 nvidia-opencl-icd-384 depends on nvidia-384 (>= 384.130); however:
  Package nvidia-384 is not configured yet.

dpkg: error processing package nvidia-opencl-icd-384 (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          Processing triggers for libc-bin (2.23-0ubuntu11) ...
Processing triggers for linux-image-4.4.0-187-generic (4.4.0-187.217) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 4.4.0-187-generic
   ...done.
/etc/kernel/postinst.d/initramfs-tools:
/usr/sbin/update-initramfs: 6: /usr/sbin/update-initramfs: cannot create /cdrom/casper/vmlinuz: Read-only file system
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 2
dpkg: error processing package linux-image-4.4.0-187-generic (--configure):
 subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 nvidia-384
 libcuda1-384
 nvidia-opencl-icd-384
 linux-image-4.4.0-187-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

通过检查 Linux 标头,我得到:

$ dpkg -l | grep linux-headers-
ii  linux-headers-4.15.0-45                    4.15.0-45.48~16.04.1                         all          Header files related to Linux kernel version 4.15.0
ii  linux-headers-4.15.0-45-generic            4.15.0-45.48~16.04.1                         amd64        Linux kernel headers for version 4.15.0 on 64 bit x86 SMP
ii  linux-headers-4.4.0-187                    4.4.0-187.217                                all          Header files related to Linux kernel version 4.4.0
ii  linux-headers-4.4.0-187-generic            4.4.0-187.217                                amd64        Linux kernel headers for version 4.4.0 on 64 bit x86 SMP
ii  linux-headers-generic                      4.4.0.187.193                                amd64        Generic Linux kernel headers
ii  linux-headers-generic-hwe-16.04            4.15.0.45.66                                 amd64        Generic Linux kernel headers 

我不知道错误信息是什么意思,不知道我是否应该继续安装或现在修复它?但是该怎么做呢?

相关内容