I am trying to use my GPU to run my own program. The compiling of the project works and on another system it worked. But on the current system, which has a different GPU, I can't even get nvidia-smi to work. All I get as output is:

$ nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

When trying to install the drivers using

$ sudo apt-get install nvidia-340

as recommended, I get the following output:

Unpacking nvidia-settings (396.54-0ubuntu0~gpu18.04.1) ...
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

The system was set up clean yesterday and I have also tried installing the cuda toolkit with apt-get, which worked just fine. The code compiled on CUDA 9.2. I then noticed that I can not use the code as it fails with unknown errors and uninstalled all nvidida and cuda related things, to start fresh. Now I get

$ sudo apt-get install nvidia-cuda-toolkit
nvidia-driver-390 : Depends: libnvidia-gl-390 (= 390.87-0ubuntu0~gpu18.04.1) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

The apt --fix-broken install does not actually work at all:

$ apt --fix-broken install
Usage: apt command [options]
       apt help command [options]

I am at a loss, so maybe someone more experienced can help shed light on this.

Here is my system configuration:

$ inxi -Fxz
System:    Host: <hostname> Kernel: 4.15.0-20-generic x86_64
           bits: 64 gcc: 7.3.0
           Desktop: Cinnamon 3.8.9 (Gtk 3.22.30-1ubuntu1)
           Distro: Linux Mint 19 Tara
Machine:   Device: desktop Mobo: ASUSTeK model: SABERTOOTH X58 v: Rev 1.xx serial: N/A
           BIOS: American Megatrends v: 0802 date: 12/21/2010
CPU:       Quad core Intel Core i7 950 (-MT-MCP-) 
           arch: Nehalem rev.5 cache: 8192 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 24589
           clock speeds: max: 3068 MHz 1: 1920 MHz 2: 1764 MHz 3: 1777 MHz
           4: 1781 MHz 5: 1874 MHz 6: 1771 MHz 7: 1780 MHz 8: 1795 MHz
Graphics:  Card: NVIDIA GM200 [GeForce GTX TITAN X] bus-ID: 04:00.0
           Display Server: x11 (X.Org 1.19.6 )
           drivers: nouveau (unloaded: modesetting,fbdev,vesa)
           Resolution: 1920x1080@60.00hz, 1920x1080@60.00hz
           OpenGL: renderer: NV120 version: 4.3 Mesa 18.0.5 Direct Render: Yes
Audio:     Card-1 NVIDIA GM200 High Def. Audio
           driver: snd_hda_intel bus-ID: 04:00.1
           Card-2 Intel 82801JI (ICH10 Family) HD Audio Controller
           driver: snd_hda_intel bus-ID: 00:1b.0
           Card-3 Logitech QuickCam Pro 9000
           driver: USB Audio usb-ID: 002-002
           Sound: Advanced Linux Sound Architecture v: k4.15.0-20-generic

edit Following @Hermann 's direction I did the following:

$ sudo apt-get remove --purge nvidia*
$ sudo apt-get remove --purge cuda*

then to start new I did:

$ sudo apt-get install nvidia-driver-390

again I got this message:

 Unpacking nvidia-driver-390 (390.87-0ubuntu0~gpu18.04.1) ...
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

Then, because the apt --fix-broken command does not work for some reason, I open the synaptic package manager and I get a message about two broken packages, which of course are part of the ones that I just tried to install.

I have never experienced this kind of behavior with Linux Mint before and I have had my previous version running for about 2 years now.


The nvidia packages version must match. For some reason, not all relationships are maintained as package dependencies. It looks like you tried to install version 340 of the driver, version 396 of the nvidia-settings application, and a CUDA development environment which needs driver version 390. I recommend uninstalling all relevant nvidia packages and then install nvidia-driver-390, nvidia-settings, nvidia-utils-390 and nvidia-cuda-toolkit. This will give you the driver version 390, appropriate utility programs and CUDA 9.1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.