CUDA 安装失败-未满足依赖项

CUDA 安装失败-未满足依赖项

我正在尝试CUDA按照Ubuntu 18.04.3 LTS本文档来自 nvidia。

当我尝试通过以下命令安装 Linux 标头时遇到了麻烦。

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

它引发了一个Unmet dependencies错误。

The following packages have unmet dependencies:
 libcuinj64-9.1 : Depends: libcuda1 (>= 387.26) or
                           libcuda-9.1-1
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

当我尝试

sudo apt --fix-broken install

我有

dpkg: error processing archive /var/cache/apt/archives/libnvidia-compute-430_430.26-0ubuntu0.18.04.2_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libnvidia-ml.so', which is also in package nvidia-340 340.107-0ubuntu0.18.04.3
Errors were encountered while processing:
 /var/cache/apt/archives/libnvidia-compute-430_430.26-0ubuntu0.18.04.2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

可以看到整个终端输出这里

这是我的 gpu

  *-display                 
       description: VGA compatible controller
       product: GM204 [GeForce GTX 970]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
       configuration: driver=nouveau latency=0
       resources: irq:29 memory:f6000000-f6ffffff memory:e0000000-efffffff memory:f0000000-f1ffffff ioport:e000(size=128) memory:c0000-dffff

我不知道接下来该怎么办。有人能帮忙吗?

答案1

我没有安装任何专有的 nvidia 驱动程序。我从 ubuntu 菜单进入Software and Updates > Additional Drivers并安装了nvidia-driver-430

foo@42:~$ sudo lshw -C display
  *-display                 
       description: VGA compatible controller
       product: GM204 [GeForce GTX 970]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:30 memory:f6000000-f6ffffff memory:e0000000-efffffff memory:f0000000-f1ffffff ioport:e000(size=128) memory:c0000-dffff

驱动程序从 更改为nouveaunvidia它还安装了CUDA Version: 10.2

foo@42:~$ nvidia-smi
Tue Oct  8 22:27:48 2019       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 430.26       Driver Version: 430.26       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 970     Off  | 00000000:01:00.0  On |                  N/A |
|  0%   43C    P8    16W / 200W |    191MiB /  4039MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      4953      G   /usr/lib/xorg/Xorg                            16MiB |
|    0      4998      G   /usr/bin/gnome-shell                          51MiB |
|    0      5151      G   /usr/lib/xorg/Xorg                            79MiB |
|    0      5392      G   ...ervice-request-channel-token=1831114496    39MiB |

相关内容