1

I am trying to install CUDA in Ubuntu 18.04.3 LTS according to this documentation from nvidia.

I ran into trouble when I tried to install linux headers by the following command.

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

It raised an Unmet dependencies error.

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).

When I tried

sudo apt --fix-broken install

I got

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)

The whole terminal output can be seen here.

This is the gpu I have

  *-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

I am not sure where to go from here. Can anyone help?

Sounak
  • 119

1 Answers1

0

I did not have any proprietary nvidia-driver installed. From the ubuntu menu I went to Software and Updates > Additional Drivers and installed 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

The driver changed from nouveau to nvidia. It also installed 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 |
Sounak
  • 119