Cannot run Nvidia driver

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
gewitty
Level 2
Level 2
Posts: 63
Joined: Tue Apr 14, 2009 11:02 am

Cannot run Nvidia driver

Post by gewitty »

I recently upgraded to Mint 19 with a clean install. Since then, I have been unable to switch from the X.Org X server - Nouveau display driver to the recommended Nvidia driver 390.

I have been trying to install the GIMP Plugin Registry via Synaptic, which produces an error message, saying that I have two broken packages on my system. When I use the 'Fix Broken Packages' option from the menu, nothing happens. Clicking on the 'Broken' option in the filters shows two packages: libnvidia-ifr1-390 and nvidia-driver-390. These are both shown with red flags against them. Attempts to reinstall these results in the following error:

'E: /var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_amd64.deb: new libnvidia-gl-390:amd64 package pre-installation script subprocess returned error exit status 2'

I also sometimes get another error:

'E: Internal Error, No file name for libnvidia-ifr1-390:amd64'

When I checked Drivers, the system shows that the nvidia-driver-390 is in use, but this is not the case. Running inxi -G in the terminal produces the following:

$ inxi -G
Graphics: Card: NVIDIA GM107 [GeForce GTX 750 Ti]
Display Server: x11 (X.Org 1.19.6 )
drivers: nouveau (unloaded: modesetting,fbdev,vesa)
Resolution: 1920x1080@60.00hz
OpenGL: renderer: NV117 version: 4.3 Mesa 18.0.5

I had neither of these issues when running Mint 18, so this appears to be something inherent in the 19 release.

Has anyone encountered this issue before, or can suggest how it can be resolved?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Cannot run Nvidia driver

Post by roblm »

gewitty wrote: Wed Oct 03, 2018 11:51 am Clicking on the 'Broken' option in the filters shows two packages: libnvidia-ifr1-390 and nvidia-driver-390. These are both shown with red flags against them.

I want to go over the steps to fix broken packages using Synaptic. Open Synaptic and click Status in the category list in the lower left, if it not already selected. Click Broken dependencies in the category list in the upper left. The broken packages will be listed on the right with a red checkbox. Click Edit > Fix Broken Packages. The red boxes should turn green, if the packages can be fixed. Click Apply.
gewitty
Level 2
Level 2
Posts: 63
Joined: Tue Apr 14, 2009 11:02 am

Re: Cannot run Nvidia driver

Post by gewitty »

Thanks for the reply Rob.

I ran through your suggested fix for the broken packages, which went OK right up until I clicked 'Apply'. I then got the following error:

'E: /var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_amd64.deb: new libnvidia-gl-390:amd64 package pre-installation script subprocess returned error exit status 2'

Any idea what this means?
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Cannot run Nvidia driver

Post by roblm »

gewitty wrote:I then got the following error:
'E: /var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_amd64.deb: new libnvidia-gl-390:amd64 package pre-installation script subprocess returned error exit status 2'
I have the nvidia-390.48 driver installed on one of my PCs, so I went to /var/cache/apt/archives, which stores copies of the installed packages, and extracted the contents of package libnvidia-gl-390_390.48-0ubuntu3_amd64.deb with root authority, and found the preinst script in the control.tar.xz package:

Code: Select all

#! /bin/sh
# preinst script for libnvidia-gl-390
#
# see: dh_installdeb(1)
#
# Copyright (C) 2018 Canonical Ltd
# Authors: Alberto Milone

set -e

# summary of how this script can be called:
#        * <new-preinst> `install'
#        * <new-preinst> `install' <old-version>
#        * <new-preinst> `upgrade' <old-version>
#        * <old-preinst> `abort-upgrade' <new-version>
#
# For details see /usr/share/doc/packaging-manual/

library_dir=usr/lib/x86_64-linux-gnu
no_alternatives_version=390.25-0ubuntu1
package_name=libnvidia-gl-390
this_version=`dpkg-query -W -f='${Version}' $package_name | cut -d\: -f2`


_remove_diversions() {
    set -a "libGL.so.1" "libGL.so" "libEGL.so.1" "libEGL.so"
    while [ $# -ge 1 ]; do
        libname=$1
        if dpkg-divert --list | grep -F "/$library_dir/$libname.distrib"
        then
            dpkg-divert --remove --rename /$library_dir/$libname
        fi
        shift
    done
}


_remove_alternative () {
    NAME=$1
    if [ -n "`update-alternatives --list $NAME 2>/dev/null`" ]; then
        set -a `update-alternatives --list $NAME 2>/dev/null`
        while [ $# -ge 1 ] && [ "$#" != "configure" ]; do
            ALTERNATIVE=${1}
            update-alternatives --remove $NAME $ALTERNATIVE
            shift
        done
    fi
}


_remove_alternatives () {
    # Clean up any previous non-multi-arch alternatives
    _remove_alternative gl_conf

    # Clean up the most recent alternatives
    _remove_alternative x86_64-linux-gnu_gl_conf
    _remove_alternative x86_64-linux-gnu_egl_conf

    # Clean up the compatibility alternatives
    if [ "`dpkg --print-architecture`" = "amd64" ]; then
        _remove_alternative i386-linux-gnu_gl_conf
        _remove_alternative i386-linux-gnu_egl_conf
    fi

    # Remove the alternative for glamor-egl
    _remove_alternative glamor_conf

    # explicit ldconfig due to alternatives
    ldconfig
}


_clean_up () {
    # Make sure that no diversion is still there
    _remove_diversions

    # Remove any nvidia related alternatives
    _remove_alternatives
}


case "$1" in
    install|upgrade)
        old_version="$2"
        if dpkg --compare-versions "$old_version" lt "$no_alternatives_version"; then
            # Clean up debris from previous nvidia packages
            _clean_up
        fi
    ;;

    abort-upgrade)
    ;;

    *)
        echo "preinst called with unknown argument \`$1'" >&2
        exit 0
    ;;
esac


# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.



exit 0

That script will run before the libnvidia-gl-390 package is installed and makes some system checks. If the script runs without finding any problems, then there would be an Exit status of 0. A status of 1 is for a minor problem and a 2 is for a more serious problem, perhaps a conflict with previous Nvidia driver packages.

For that error message, I found this bug report on this web page:
https://bugs.launchpad.net/ubuntu/+sour ... ug/1768050

In the last post (#3) is a solution and a link to the source of the solution:
https://askubuntu.com/questions/1035409 ... s-on-18-04

Before trying that solution, try using these commands in the Terminal:

Code: Select all

sudo apt autoremove
sudo apt install --fix-broken
gewitty
Level 2
Level 2
Posts: 63
Joined: Tue Apr 14, 2009 11:02 am

Re: Cannot run Nvidia driver

Post by gewitty »

Thanks once again for the reply.

I ran the two terminal commands you suggested. Autoremove seemed to run without comment, but apt install --fix-broken returned the following:

$ sudo apt install --fix-broken
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
cdrskin gstreamer1.0-vaapi lib32gcc1 libavcodec-extra libboost-python1.65.1
libbsd0:i386 libburn4 libc6-i386 libdrm-amdgpu1:i386 libdrm-intel1:i386
libdrm-nouveau2:i386 libdrm-radeon1:i386 libdrm2:i386 libedit2:i386
libelf1:i386 libexpat1:i386 libffi6:i386 libgl1:i386 libgl1-mesa-dri:i386
libglapi-mesa:i386 libglvnd0:i386 libglx-mesa0:i386 libglx0:i386
libhal1-flash libjs-underscore liblavfile-2.1-0 liblavjpeg-2.1-0
liblavplay-2.1-0 libllvm6.0:i386 libpciaccess0:i386 libqt4-dbus
libqt4-declarative libqt4-designer libqt4-help libqt4-network libqt4-script
libqt4-scripttools libqt4-sql libqt4-svg libqt4-test libqt4-xml
libqt4-xmlpatterns libqtassistantclient4 libqtcore4 libqtdbus4 libqtgui4
libsensors4:i386 libstdc++6:i386 libunshield0 libwayland-client0:i386
libwayland-server0:i386 libwxgtk3.0-gtk3-0v5 libx11-6:i386 libx11-xcb1:i386
libxau6:i386 libxcb-dri2-0:i386 libxcb-dri3-0:i386 libxcb-glx0:i386
libxcb-present0:i386 libxcb-sync1:i386 libxcb1:i386 libxdamage1:i386
libxdmcp6:i386 libxext6:i386 libxfixes3:i386 libxshmfence1:i386
libxxf86vm1:i386 linux-headers-4.15.0-23 linux-headers-4.15.0-23-generic
linux-headers-4.15.0-24 linux-headers-4.15.0-24-generic
linux-image-4.15.0-23-generic linux-image-4.15.0-24-generic
linux-modules-4.15.0-23-generic linux-modules-4.15.0-24-generic
linux-modules-extra-4.15.0-23-generic linux-modules-extra-4.15.0-24-generic
mjpegtools python-pil python-pyexiv2 python-qt4 python-sip python3-gst-1.0
python3-sip python3-wxgtk4.0 qdbus qtchooser qtcore4-l10n unshield
vorbis-tools
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
libnvidia-gl-390
The following NEW packages will be installed
libnvidia-gl-390
0 to upgrade, 1 to newly install, 0 to remove and 220 not to upgrade.
2 not fully installed or removed.
Need to get 0 B/14.3 MB of archives.
After this operation, 73.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 501484 files and directories currently installed.)
Preparing to unpack .../libnvidia-gl-390_390.48-0ubuntu3_amd64.deb ...
diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 to /usr/lib/x86_64-linux-gnu/libGL.so.1.distrib by nvidia-340
dpkg-divert: error: mismatch on package
when removing 'diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 by libnvidia-gl-390'
found 'diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 to /usr/lib/x86_64-linux-gnu/libGL.so.1.distrib by nvidia-340'
dpkg: error processing archive /var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_amd64.deb (--unpack):
new libnvidia-gl-390:amd64 package pre-installation script subprocess returned error exit status 2
Errors were encountered while processing:
/var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Following that, I tried the solution proposed in the link you gave. This seemed to run through without throwing up any errors, so I rebooted, then went into Drivers and selected the Nvidia 390 (recommended) option. This took quite a while to run, but failed with the following (very long) report:

installArchives() failed:
Extract templates from packages: 38%%
Extract templates from packages: 77%%
Extract templates from packages: 100%%

Extract templates from packages: 38%%
Extract templates from packages: 77%%
Extract templates from packages: 100%%
Selecting previously unselected package libxau6:i386.
(Reading database ...
(Reading database ... 5%%
(Reading database ... 10%%
(Reading database ... 15%%
(Reading database ... 20%%
(Reading database ... 25%%
(Reading database ... 30%%
(Reading database ... 35%%
(Reading database ... 40%%
(Reading database ... 45%%
(Reading database ... 50%%
(Reading database ... 55%%
(Reading database ... 60%%
(Reading database ... 65%%
(Reading database ... 70%%
(Reading database ... 75%%
(Reading database ... 80%%
(Reading database ... 85%%
(Reading database ... 90%%
(Reading database ... 95%%
(Reading database ... 100%%
(Reading database ... 428072 files and directories currently installed.)
Preparing to unpack .../00-libxau6_1%%3a1.0.8-1_i386.deb ...
Unpacking libxau6:i386 (1:1.0.8-1) ...
Selecting previously unselected package libbsd0:i386.
Preparing to unpack .../01-libbsd0_0.8.7-1_i386.deb ...
Unpacking libbsd0:i386 (0.8.7-1) ...
Selecting previously unselected package libxdmcp6:i386.
Preparing to unpack .../02-libxdmcp6_1%%3a1.1.2-3_i386.deb ...
Unpacking libxdmcp6:i386 (1:1.1.2-3) ...
Selecting previously unselected package libxcb1:i386.
Preparing to unpack .../03-libxcb1_1.13-1_i386.deb ...
Unpacking libxcb1:i386 (1.13-1) ...
Selecting previously unselected package libx11-6:i386.
Preparing to unpack .../04-libx11-6_2%%3a1.6.4-3ubuntu0.1_i386.deb ...
Unpacking libx11-6:i386 (2:1.6.4-3ubuntu0.1) ...
Selecting previously unselected package libxext6:i386.
Preparing to unpack .../05-libxext6_2%%3a1.3.3-1_i386.deb ...
Unpacking libxext6:i386 (2:1.3.3-1) ...
Selecting previously unselected package libxxf86vm1:i386.
Preparing to unpack .../06-libxxf86vm1_1%%3a1.1.4-1_i386.deb ...
Unpacking libxxf86vm1:i386 (1:1.1.4-1) ...
Preparing to unpack .../07-gcc-8-base_8.2.0-1ubuntu2~18.04_amd64.deb ...
De-configuring gcc-8-base:i386 (8-20180414-1ubuntu2) ...
Unpacking gcc-8-base:amd64 (8.2.0-1ubuntu2~18.04) over (8-20180414-1ubuntu2) ...
Preparing to unpack .../08-gcc-8-base_8.2.0-1ubuntu2~18.04_i386.deb ...
Unpacking gcc-8-base:i386 (8.2.0-1ubuntu2~18.04) over (8-20180414-1ubuntu2) ...
Preparing to unpack .../09-libgcc1_1%%3a8.2.0-1ubuntu2~18.04_i386.deb ...
De-configuring libgcc1:amd64 (1:8-20180414-1ubuntu2) ...
Unpacking libgcc1:i386 (1:8.2.0-1ubuntu2~18.04) over (1:8-20180414-1ubuntu2) ...
Preparing to unpack .../10-libgcc1_1%%3a8.2.0-1ubuntu2~18.04_amd64.deb ...
Unpacking libgcc1:amd64 (1:8.2.0-1ubuntu2~18.04) over (1:8-20180414-1ubuntu2) ...
Setting up gcc-8-base:amd64 (8.2.0-1ubuntu2~18.04) ...
Setting up gcc-8-base:i386 (8.2.0-1ubuntu2~18.04) ...
Setting up libgcc1:amd64 (1:8.2.0-1ubuntu2~18.04) ...
Setting up libgcc1:i386 (1:8.2.0-1ubuntu2~18.04) ...
(Reading database ...
(Reading database ... 5%%
(Reading database ... 10%%
(Reading database ... 15%%
(Reading database ... 20%%
(Reading database ... 25%%
(Reading database ... 30%%
(Reading database ... 35%%
(Reading database ... 40%%
(Reading database ... 45%%
(Reading database ... 50%%
(Reading database ... 55%%
(Reading database ... 60%%
(Reading database ... 65%%
(Reading database ... 70%%
(Reading database ... 75%%
(Reading database ... 80%%
(Reading database ... 85%%
(Reading database ... 90%%
(Reading database ... 95%%
(Reading database ... 100%%
(Reading database ... 428084 files and directories currently installed.)
Preparing to unpack .../libtsan0_8.2.0-1ubuntu2~18.04_amd64.deb ...
Unpacking libtsan0:amd64 (8.2.0-1ubuntu2~18.04) over (8-20180414-1ubuntu2) ...
Preparing to unpack .../libstdc++6_8.2.0-1ubuntu2~18.04_amd64.deb ...
Unpacking libstdc++6:amd64 (8.2.0-1ubuntu2~18.04) over (8-20180414-1ubuntu2) ...
Selecting previously unselected package libstdc++6:i386.
Preparing to unpack .../libstdc++6_8.2.0-1ubuntu2~18.04_i386.deb ...
Unpacking libstdc++6:i386 (8.2.0-1ubuntu2~18.04) ...
Setting up libstdc++6:amd64 (8.2.0-1ubuntu2~18.04) ...
Setting up libstdc++6:i386 (8.2.0-1ubuntu2~18.04) ...
(Reading database ...
(Reading database ... 5%%
(Reading database ... 10%%
(Reading database ... 15%%
(Reading database ... 20%%
(Reading database ... 25%%
(Reading database ... 30%%
(Reading database ... 35%%
(Reading database ... 40%%
(Reading database ... 45%%
(Reading database ... 50%%
(Reading database ... 55%%
(Reading database ... 60%%
(Reading database ... 65%%
(Reading database ... 70%%
(Reading database ... 75%%
(Reading database ... 80%%
(Reading database ... 85%%
(Reading database ... 90%%
(Reading database ... 95%%
(Reading database ... 100%%
(Reading database ... 428088 files and directories currently installed.)
Preparing to unpack .../00-libquadmath0_8.2.0-1ubuntu2~18.04_amd64.deb ...
Unpacking libquadmath0:amd64 (8.2.0-1ubuntu2~18.04) over (8-20180414-1ubuntu2) ...
Preparing to unpack .../01-libmpx2_8.2.0-1ubuntu2~18.04_amd64.deb ...
Unpacking libmpx2:amd64 (8.2.0-1ubuntu2~18.04) over (8-20180414-1ubuntu2) ...
Preparing to unpack .../02-liblsan0_8.2.0-1ubuntu2~18.04_amd64.deb ...
Unpacking liblsan0:amd64 (8.2.0-1ubuntu2~18.04) over (8-20180414-1ubuntu2) ...
Preparing to unpack .../03-libitm1_8.2.0-1ubuntu2~18.04_amd64.deb ...
Unpacking libitm1:amd64 (8.2.0-1ubuntu2~18.04) over (8-20180414-1ubuntu2) ...
Preparing to unpack .../04-libgomp1_8.2.0-1ubuntu2~18.04_amd64.deb ...
Unpacking libgomp1:amd64 (8.2.0-1ubuntu2~18.04) over (8-20180414-1ubuntu2) ...
Preparing to unpack .../05-libcc1-0_8.2.0-1ubuntu2~18.04_amd64.deb ...
Unpacking libcc1-0:amd64 (8.2.0-1ubuntu2~18.04) over (8-20180414-1ubuntu2) ...
Preparing to unpack .../06-libatomic1_8.2.0-1ubuntu2~18.04_amd64.deb ...
Unpacking libatomic1:amd64 (8.2.0-1ubuntu2~18.04) over (8-20180414-1ubuntu2) ...
Preparing to unpack .../07-libgl1_1.0.0-2ubuntu2.2_amd64.deb ...
Unpacking libgl1:amd64 (1.0.0-2ubuntu2.2) over (1.0.0-2ubuntu2.1) ...
Preparing to unpack .../08-libglx0_1.0.0-2ubuntu2.2_amd64.deb ...
Unpacking libglx0:amd64 (1.0.0-2ubuntu2.2) over (1.0.0-2ubuntu2.1) ...
Preparing to unpack .../09-libgles2_1.0.0-2ubuntu2.2_amd64.deb ...
Unpacking libgles2:amd64 (1.0.0-2ubuntu2.2) over (1.0.0-2ubuntu2.1) ...
Preparing to unpack .../10-libglvnd0_1.0.0-2ubuntu2.2_amd64.deb ...
Unpacking libglvnd0:amd64 (1.0.0-2ubuntu2.2) over (1.0.0-2ubuntu2.1) ...
Selecting previously unselected package libglvnd0:i386.
Preparing to unpack .../11-libglvnd0_1.0.0-2ubuntu2.2_i386.deb ...
Unpacking libglvnd0:i386 (1.0.0-2ubuntu2.2) ...
Setting up libglvnd0:amd64 (1.0.0-2ubuntu2.2) ...
Setting up libglvnd0:i386 (1.0.0-2ubuntu2.2) ...
(Reading database ...
(Reading database ... 5%%
(Reading database ... 10%%
(Reading database ... 15%%
(Reading database ... 20%%
(Reading database ... 25%%
(Reading database ... 30%%
(Reading database ... 35%%
(Reading database ... 40%%
(Reading database ... 45%%
(Reading database ... 50%%
(Reading database ... 55%%
(Reading database ... 60%%
(Reading database ... 65%%
(Reading database ... 70%%
(Reading database ... 75%%
(Reading database ... 80%%
(Reading database ... 85%%
(Reading database ... 90%%
(Reading database ... 95%%
(Reading database ... 100%%
(Reading database ... 428090 files and directories currently installed.)
Preparing to unpack .../libegl1_1.0.0-2ubuntu2.2_amd64.deb ...
Unpacking libegl1:amd64 (1.0.0-2ubuntu2.2) over (1.0.0-2ubuntu2.1) ...
Setting up libegl1:amd64 (1.0.0-2ubuntu2.2) ...
Selecting previously unselected package libelf1:i386.
(Reading database ...
(Reading database ... 5%%
(Reading database ... 10%%
(Reading database ... 15%%
(Reading database ... 20%%
(Reading database ... 25%%
(Reading database ... 30%%
(Reading database ... 35%%
(Reading database ... 40%%
(Reading database ... 45%%
(Reading database ... 50%%
(Reading database ... 55%%
(Reading database ... 60%%
(Reading database ... 65%%
(Reading database ... 70%%
(Reading database ... 75%%
(Reading database ... 80%%
(Reading database ... 85%%
(Reading database ... 90%%
(Reading database ... 95%%
(Reading database ... 100%%
(Reading database ... 428090 files and directories currently installed.)
Preparing to unpack .../00-libelf1_0.170-0.4_i386.deb ...
Unpacking libelf1:i386 (0.170-0.4) ...
Selecting previously unselected package libexpat1:i386.
Preparing to unpack .../01-libexpat1_2.2.5-3_i386.deb ...
Unpacking libexpat1:i386 (2.2.5-3) ...
Selecting previously unselected package libffi6:i386.
Preparing to unpack .../02-libffi6_3.2.1-8_i386.deb ...
Unpacking libffi6:i386 (3.2.1-8) ...
Selecting previously unselected package libdrm2:i386.
Preparing to unpack .../03-libdrm2_2.4.91-2_i386.deb ...
Unpacking libdrm2:i386 (2.4.91-2) ...
Selecting previously unselected package libedit2:i386.
Preparing to unpack .../04-libedit2_3.1-20170329-1_i386.deb ...
Unpacking libedit2:i386 (3.1-20170329-1) ...
Selecting previously unselected package libdrm-amdgpu1:i386.
Preparing to unpack .../05-libdrm-amdgpu1_2.4.91-2_i386.deb ...
Unpacking libdrm-amdgpu1:i386 (2.4.91-2) ...
Selecting previously unselected package libpciaccess0:i386.
Preparing to unpack .../06-libpciaccess0_0.14-1_i386.deb ...
Unpacking libpciaccess0:i386 (0.14-1) ...
Selecting previously unselected package libdrm-intel1:i386.
Preparing to unpack .../07-libdrm-intel1_2.4.91-2_i386.deb ...
Unpacking libdrm-intel1:i386 (2.4.91-2) ...
Selecting previously unselected package libdrm-nouveau2:i386.
Preparing to unpack .../08-libdrm-nouveau2_2.4.91-2_i386.deb ...
Unpacking libdrm-nouveau2:i386 (2.4.91-2) ...
Selecting previously unselected package libdrm-radeon1:i386.
Preparing to unpack .../09-libdrm-radeon1_2.4.91-2_i386.deb ...
Unpacking libdrm-radeon1:i386 (2.4.91-2) ...
Selecting previously unselected package libglapi-mesa:i386.
Preparing to unpack .../10-libglapi-mesa_18.0.5-0ubuntu0~18.04.1_i386.deb ...
Unpacking libglapi-mesa:i386 (18.0.5-0ubuntu0~18.04.1) ...
Selecting previously unselected package libllvm6.0:i386.
Preparing to unpack .../11-libllvm6.0_1%%3a6.0-1ubuntu2_i386.deb ...
Unpacking libllvm6.0:i386 (1:6.0-1ubuntu2) ...
Selecting previously unselected package libsensors4:i386.
Preparing to unpack .../12-libsensors4_1%%3a3.4.0-4_i386.deb ...
Unpacking libsensors4:i386 (1:3.4.0-4) ...
Selecting previously unselected package libgl1-mesa-dri:i386.
Preparing to unpack .../13-libgl1-mesa-dri_18.0.5-0ubuntu0~18.04.1_i386.deb ...
Unpacking libgl1-mesa-dri:i386 (18.0.5-0ubuntu0~18.04.1) ...
Selecting previously unselected package libx11-xcb1:i386.
Preparing to unpack .../14-libx11-xcb1_2%%3a1.6.4-3ubuntu0.1_i386.deb ...
Unpacking libx11-xcb1:i386 (2:1.6.4-3ubuntu0.1) ...
Selecting previously unselected package libxcb-dri2-0:i386.
Preparing to unpack .../15-libxcb-dri2-0_1.13-1_i386.deb ...
Unpacking libxcb-dri2-0:i386 (1.13-1) ...
Selecting previously unselected package libxcb-dri3-0:i386.
Preparing to unpack .../16-libxcb-dri3-0_1.13-1_i386.deb ...
Unpacking libxcb-dri3-0:i386 (1.13-1) ...
Selecting previously unselected package libxcb-glx0:i386.
Preparing to unpack .../17-libxcb-glx0_1.13-1_i386.deb ...
Unpacking libxcb-glx0:i386 (1.13-1) ...
Selecting previously unselected package libxcb-present0:i386.
Preparing to unpack .../18-libxcb-present0_1.13-1_i386.deb ...
Unpacking libxcb-present0:i386 (1.13-1) ...
Selecting previously unselected package libxcb-sync1:i386.
Preparing to unpack .../19-libxcb-sync1_1.13-1_i386.deb ...
Unpacking libxcb-sync1:i386 (1.13-1) ...
Selecting previously unselected package libxdamage1:i386.
Preparing to unpack .../20-libxdamage1_1%%3a1.1.4-3_i386.deb ...
Unpacking libxdamage1:i386 (1:1.1.4-3) ...
Selecting previously unselected package libxfixes3:i386.
Preparing to unpack .../21-libxfixes3_1%%3a5.0.3-1_i386.deb ...
Unpacking libxfixes3:i386 (1:5.0.3-1) ...
Selecting previously unselected package libxshmfence1:i386.
Preparing to unpack .../22-libxshmfence1_1.3-1_i386.deb ...
Unpacking libxshmfence1:i386 (1.3-1) ...
Selecting previously unselected package libglx-mesa0:i386.
Preparing to unpack .../23-libglx-mesa0_18.0.5-0ubuntu0~18.04.1_i386.deb ...
Unpacking libglx-mesa0:i386 (18.0.5-0ubuntu0~18.04.1) ...
Selecting previously unselected package libnvidia-cfg1-390:amd64.
Preparing to unpack .../24-libnvidia-cfg1-390_390.48-0ubuntu3_amd64.deb ...
Unpacking libnvidia-cfg1-390:amd64 (390.48-0ubuntu3) ...
Selecting previously unselected package libnvidia-common-390.
Preparing to unpack .../25-libnvidia-common-390_390.48-0ubuntu3_all.deb ...
Unpacking libnvidia-common-390 (390.48-0ubuntu3) ...
Selecting previously unselected package libnvidia-compute-390:i386.
Preparing to unpack .../26-libnvidia-compute-390_390.48-0ubuntu3_i386.deb ...
Unpacking libnvidia-compute-390:i386 (390.48-0ubuntu3) ...
Selecting previously unselected package libnvidia-compute-390:amd64.
Preparing to unpack .../27-libnvidia-compute-390_390.48-0ubuntu3_amd64.deb ...
Unpacking libnvidia-compute-390:amd64 (390.48-0ubuntu3) ...
Selecting previously unselected package libnvidia-decode-390:i386.
Preparing to unpack .../28-libnvidia-decode-390_390.48-0ubuntu3_i386.deb ...
Unpacking libnvidia-decode-390:i386 (390.48-0ubuntu3) ...
Selecting previously unselected package libnvidia-decode-390:amd64.
Preparing to unpack .../29-libnvidia-decode-390_390.48-0ubuntu3_amd64.deb ...
Unpacking libnvidia-decode-390:amd64 (390.48-0ubuntu3) ...
Selecting previously unselected package libnvidia-encode-390:amd64.
Preparing to unpack .../30-libnvidia-encode-390_390.48-0ubuntu3_amd64.deb ...
Unpacking libnvidia-encode-390:amd64 (390.48-0ubuntu3) ...
Selecting previously unselected package libnvidia-encode-390:i386.
Preparing to unpack .../31-libnvidia-encode-390_390.48-0ubuntu3_i386.deb ...
Unpacking libnvidia-encode-390:i386 (390.48-0ubuntu3) ...
Selecting previously unselected package libglx0:i386.
Preparing to unpack .../32-libglx0_1.0.0-2ubuntu2.2_i386.deb ...
Unpacking libglx0:i386 (1.0.0-2ubuntu2.2) ...
Selecting previously unselected package libgl1:i386.
Preparing to unpack .../33-libgl1_1.0.0-2ubuntu2.2_i386.deb ...
Unpacking libgl1:i386 (1.0.0-2ubuntu2.2) ...
Selecting previously unselected package libnvidia-fbc1-390:i386.
Preparing to unpack .../34-libnvidia-fbc1-390_390.48-0ubuntu3_i386.deb ...
Unpacking libnvidia-fbc1-390:i386 (390.48-0ubuntu3) ...
Selecting previously unselected package libnvidia-fbc1-390:amd64.
Preparing to unpack .../35-libnvidia-fbc1-390_390.48-0ubuntu3_amd64.deb ...
Unpacking libnvidia-fbc1-390:amd64 (390.48-0ubuntu3) ...
Selecting previously unselected package libwayland-client0:i386.
Preparing to unpack .../36-libwayland-client0_1.14.0-2_i386.deb ...
Unpacking libwayland-client0:i386 (1.14.0-2) ...
Selecting previously unselected package libwayland-server0:i386.
Preparing to unpack .../37-libwayland-server0_1.14.0-2_i386.deb ...
Unpacking libwayland-server0:i386 (1.14.0-2) ...
Preparing to unpack .../38-libnvidia-gl-390_390.48-0ubuntu3_i386.deb ...
diversion of /usr/lib/i386-linux-gnu/libGL.so.1 to /usr/lib/i386-linux-gnu/libGL.so.1.distrib by nvidia-340
dpkg-divert: error: mismatch on package
when removing 'diversion of /usr/lib/i386-linux-gnu/libGL.so.1 by libnvidia-gl-390'
found 'diversion of /usr/lib/i386-linux-gnu/libGL.so.1 to /usr/lib/i386-linux-gnu/libGL.so.1.distrib by nvidia-340'
dpkg: error processing archive /tmp/apt-dpkg-install-z7xhkI/38-libnvidia-gl-390_390.48-0ubuntu3_i386.deb (--unpack):
new libnvidia-gl-390:i386 package pre-installation script subprocess returned error exit status 2
Preparing to unpack .../39-libnvidia-gl-390_390.48-0ubuntu3_amd64.deb ...
diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 to /usr/lib/x86_64-linux-gnu/libGL.so.1.distrib by nvidia-340
dpkg-divert: error: mismatch on package
when removing 'diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 by libnvidia-gl-390'
found 'diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 to /usr/lib/x86_64-linux-gnu/libGL.so.1.distrib by nvidia-340'
dpkg: error processing archive /tmp/apt-dpkg-install-z7xhkI/39-libnvidia-gl-390_390.48-0ubuntu3_amd64.deb (--unpack):
new libnvidia-gl-390:amd64 package pre-installation script subprocess returned error exit status 2
Selecting previously unselected package libnvidia-ifr1-390:amd64.
Preparing to unpack .../40-libnvidia-ifr1-390_390.48-0ubuntu3_amd64.deb ...
Unpacking libnvidia-ifr1-390:amd64 (390.48-0ubuntu3) ...
Selecting previously unselected package libnvidia-ifr1-390:i386.
Preparing to unpack .../41-libnvidia-ifr1-390_390.48-0ubuntu3_i386.deb ...
Unpacking libnvidia-ifr1-390:i386 (390.48-0ubuntu3) ...
Selecting previously unselected package nvidia-compute-utils-390.
Preparing to unpack .../42-nvidia-compute-utils-390_390.48-0ubuntu3_amd64.deb ...
Unpacking nvidia-compute-utils-390 (390.48-0ubuntu3) ...
Selecting previously unselected package nvidia-kernel-source-390.
Preparing to unpack .../43-nvidia-kernel-source-390_390.48-0ubuntu3_amd64.deb ...
Unpacking nvidia-kernel-source-390 (390.48-0ubuntu3) ...
Selecting previously unselected package nvidia-kernel-common-390.
Preparing to unpack .../44-nvidia-kernel-common-390_390.48-0ubuntu3_amd64.deb ...
Unpacking nvidia-kernel-common-390 (390.48-0ubuntu3) ...
Selecting previously unselected package nvidia-dkms-390.
Preparing to unpack .../45-nvidia-dkms-390_390.48-0ubuntu3_amd64.deb ...
Unpacking nvidia-dkms-390 (390.48-0ubuntu3) ...
Selecting previously unselected package nvidia-utils-390.
Preparing to unpack .../46-nvidia-utils-390_390.48-0ubuntu3_amd64.deb ...
Unpacking nvidia-utils-390 (390.48-0ubuntu3) ...
Selecting previously unselected package xserver-xorg-video-nvidia-390.
Preparing to unpack .../47-xserver-xorg-video-nvidia-390_390.48-0ubuntu3_amd64.deb ...
Unpacking xserver-xorg-video-nvidia-390 (390.48-0ubuntu3) ...
Selecting previously unselected package nvidia-driver-390.
Preparing to unpack .../48-nvidia-driver-390_390.48-0ubuntu3_amd64.deb ...
Unpacking nvidia-driver-390 (390.48-0ubuntu3) ...
Selecting previously unselected package nvidia-prime.
Preparing to unpack .../49-nvidia-prime_0.8.8_all.deb ...
Unpacking nvidia-prime (0.8.8) ...
Errors were encountered while processing:
/tmp/apt-dpkg-install-z7xhkI/38-libnvidia-gl-390_390.48-0ubuntu3_i386.deb
/tmp/apt-dpkg-install-z7xhkI/39-libnvidia-gl-390_390.48-0ubuntu3_amd64.deb
Setting up libquadmath0:amd64 (8.2.0-1ubuntu2~18.04) ...
Setting up libedit2:i386 (3.1-20170329-1) ...
Setting up libgomp1:amd64 (8.2.0-1ubuntu2~18.04) ...
Setting up libatomic1:amd64 (8.2.0-1ubuntu2~18.04) ...
Setting up libexpat1:i386 (2.2.5-3) ...
Setting up libcc1-0:amd64 (8.2.0-1ubuntu2~18.04) ...
Setting up nvidia-kernel-source-390 (390.48-0ubuntu3) ...
Setting up nvidia-prime (0.8.8) ...
dpkg: dependency problems prevent configuration of nvidia-driver-390:
nvidia-driver-390 depends on libnvidia-gl-390 (= 390.48-0ubuntu3); however:
Package libnvidia-gl-390:amd64 is not installed.

dpkg: error processing package nvidia-driver-390 (--configure):
dependency problems - leaving unconfigured
Setting up libelf1:i386 (0.170-0.4) ...
Setting up libtsan0:amd64 (8.2.0-1ubuntu2~18.04) ...
Setting up libxshmfence1:i386 (1.3-1) ...
Setting up libglapi-mesa:i386 (18.0.5-0ubuntu0~18.04.1) ...
Setting up libbsd0:i386 (0.8.7-1) ...
Setting up libdrm2:i386 (2.4.91-2) ...
Setting up liblsan0:amd64 (8.2.0-1ubuntu2~18.04) ...
dpkg: dependency problems prevent configuration of libnvidia-ifr1-390:amd64:
libnvidia-ifr1-390:amd64 depends on libnvidia-gl-390; however:
Package libnvidia-gl-390:amd64 is not installed.

dpkg: error processing package libnvidia-ifr1-390:amd64 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libnvidia-ifr1-390:i386:
libnvidia-ifr1-390:i386 depends on libnvidia-gl-390; however:
Package libnvidia-gl-390:i386 is not installed.

dpkg: error processing package libnvidia-ifr1-390:i386 (--configure):
dependency problems - leaving unconfigured
Setting up libnvidia-compute-390:i386 (390.48-0ubuntu3) ...
Setting up libnvidia-compute-390:amd64 (390.48-0ubuntu3) ...
Setting up nvidia-kernel-common-390 (390.48-0ubuntu3) ...
update-initramfs: deferring update (trigger activated)
Created symlink /etc/systemd/system/multi-user.target.wants/nvidia-fallback.service /lib/systemd/system/nvidia-fallback.service.
Setting up libmpx2:amd64 (8.2.0-1ubuntu2~18.04) ...
Setting up libx11-xcb1:i386 (2:1.6.4-3ubuntu0.1) ...
Setting up libnvidia-cfg1-390:amd64 (390.48-0ubuntu3) ...
Setting up xserver-xorg-video-nvidia-390 (390.48-0ubuntu3) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Setting up libpciaccess0:i386 (0.14-1) ...
Setting up libsensors4:i386 (1:3.4.0-4) ...
Setting up libgles2:amd64 (1.0.0-2ubuntu2.2) ...
Processing triggers for man-db (2.8.3-2) ...
Setting up libnvidia-decode-390:amd64 (390.48-0ubuntu3) ...
Setting up libffi6:i386 (3.2.1-8) ...
Setting up libdrm-radeon1:i386 (2.4.91-2) ...
Setting up libxdmcp6:i386 (1:1.1.2-3) ...
Setting up libdrm-nouveau2:i386 (2.4.91-2) ...
Setting up nvidia-compute-utils-390 (390.48-0ubuntu3) ...
Warning: The home dir /nonexistent you specified can't be accessed: No such file or directory
Adding system user `nvidia-persistenced' (UID 122) ...
Adding new group `nvidia-persistenced' (GID 129) ...
Adding new user `nvidia-persistenced' (UID 122) with group `nvidia-persistenced' ...
Not creating home directory `/nonexistent'.
Setting up libglx0:amd64 (1.0.0-2ubuntu2.2) ...
Setting up libitm1:amd64 (8.2.0-1ubuntu2~18.04) ...
Setting up libxau6:i386 (1:1.0.8-1) ...
Setting up libnvidia-common-390 (390.48-0ubuntu3) ...
Setting up libwayland-server0:i386 (1.14.0-2) ...
Setting up libdrm-amdgpu1:i386 (2.4.91-2) ...
Setting up libllvm6.0:i386 (1:6.0-1ubuntu2) ...
Setting up libnvidia-encode-390:amd64 (390.48-0ubuntu3) ...
Setting up libwayland-client0:i386 (1.14.0-2) ...
Setting up nvidia-utils-390 (390.48-0ubuntu3) ...
Setting up nvidia-dkms-390 (390.48-0ubuntu3) ...
update-initramfs: deferring update (trigger activated)
INFO:Enable nvidia
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/lenovo_thinkpad
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/dell_latitude
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here
Loading new nvidia-390.48 DKMS files...
Building for 4.15.0-33-generic
Building for architecture x86_64
Building initial module for 4.15.0-33-generic
Running in non-interactive mode, doing nothing.
Done.

nvidia:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/4.15.0-33-generic/kernel/drivers/char/drm/

nvidia-modeset.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/4.15.0-33-generic/kernel/drivers/char/drm/

nvidia-drm.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/4.15.0-33-generic/kernel/drivers/char/drm/

nvidia-uvm.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/4.15.0-33-generic/kernel/drivers/char/drm/

depmod...

DKMS: install completed.
Setting up libdrm-intel1:i386 (2.4.91-2) ...
Setting up libgl1:amd64 (1.0.0-2ubuntu2.2) ...
Setting up libxcb1:i386 (1.13-1) ...
Setting up libxcb-present0:i386 (1.13-1) ...
Setting up libxcb-dri2-0:i386 (1.13-1) ...
Setting up libxcb-dri3-0:i386 (1.13-1) ...
Setting up libxcb-glx0:i386 (1.13-1) ...
Setting up libnvidia-fbc1-390:amd64 (390.48-0ubuntu3) ...
Setting up libx11-6:i386 (2:1.6.4-3ubuntu0.1) ...
Setting up libgl1-mesa-dri:i386 (18.0.5-0ubuntu0~18.04.1) ...
Setting up libxcb-sync1:i386 (1.13-1) ...
Setting up libxdamage1:i386 (1:1.1.4-3) ...
Setting up libxext6:i386 (2:1.3.3-1) ...
Setting up libxfixes3:i386 (1:5.0.3-1) ...
Setting up libnvidia-decode-390:i386 (390.48-0ubuntu3) ...
Setting up libxxf86vm1:i386 (1:1.1.4-1) ...
Setting up libglx-mesa0:i386 (18.0.5-0ubuntu0~18.04.1) ...
Setting up libnvidia-encode-390:i386 (390.48-0ubuntu3) ...
Setting up libglx0:i386 (1.0.0-2ubuntu2.2) ...
Setting up libgl1:i386 (1.0.0-2ubuntu2.2) ...
Setting up libnvidia-fbc1-390:i386 (390.48-0ubuntu3) ...
Processing triggers for initramfs-tools (0.130ubuntu3.1) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-33-generic
Processing triggers for libc-bin (2.27-3ubuntu1) ...

I think I'm getting to the point where a clean re-installation is the only option.
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Cannot run Nvidia driver

Post by roblm »

When there are a lot of lines to post, open the Mint Forum reply window and select </> at the top. Press Ctrl+V to paste the copied lines into a code display window.


This line is seen, which suggests there may be an existing file link to the nvidia-340 driver:
found 'diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 to /usr/lib/x86_64-linux-gnu/libGL.so.1.distrib by nvidia-340'

This command was used with success by another user in the linked web page:
I solved the problem by removing nvidia-340's divert. hopefully I don't need to use nvidia-340. Following is an example:
dpkg-divert --package nvidia-340 --remove /usr/lib/i386-linux-gnu/libGL.so.1


If that doesn’t work and you want to pursue this problem, then post the output of these commands:

Code: Select all

ls -l /usr/lib/x86_64-linux-gnu/libGL.so.1*
ls -l /usr/lib/i386-linux-gnu/libGL.so.1*
xed /var/lib/dpkg/status
gewitty
Level 2
Level 2
Posts: 63
Joined: Tue Apr 14, 2009 11:02 am

Re: Cannot run Nvidia driver

Post by gewitty »

I ran the dpkg command on the nvidia 340 package, then rebooted. Nothing seems to have changed. Drivers still shows that nvidia 390 is the active driver, but running $ inxi -G shows this:

Graphics: Card: NVIDIA GM107 [GeForce GTX 750 Ti]
Display Server: x11 (X.Org 1.19.6 )
drivers: nouveau (unloaded: modesetting,fbdev,vesa)
Resolution: 1920x1080@60.00hz
OpenGL: renderer: NV117 version: 4.3 Mesa 18.0.5

I then ran the three commands you listed. The results are as follows:

$ ls -l /usr/lib/x86_64-linux-gnu/libGL.so.1*
lrwxrwxrwx 1 root root 14 Aug 16 17:04 /usr/lib/x86_64-linux-gnu/libGL.so.1 -> libGL.so.1.0.0
-rw-r--r-- 1 root root 567624 Aug 15 07:20 /usr/lib/x86_64-linux-gnu/libGL.so.1.0.0
lrwxrwxrwx 1 root root 14 Aug 15 07:20 /usr/lib/x86_64-linux-gnu/libGL.so.1.distrib -> libGL.so.1.0.0

$ ls -l /usr/lib/i386-linux-gnu/libGL.so.1*
lrwxrwxrwx 1 root root 14 Oct 4 11:16 /usr/lib/i386-linux-gnu/libGL.so.1 -> libGL.so.1.0.0
-rw-r--r-- 1 root root 390680 Aug 15 07:20 /usr/lib/i386-linux-gnu/libGL.so.1.0.0
lrwxrwxrwx 1 root root 14 Aug 15 07:20 /usr/lib/i386-linux-gnu/libGL.so.1.distrib -> libGL.so.1.0.0

$ xed /var/lib/dpkg/status (the output from this was huge and was rejected when I tried to paste it into a code display window.

Your message contains 2646715 characters.
The maximum number of allowed characters is 60000.
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Cannot run Nvidia driver

Post by roblm »

Post the output of this command: dpkg -l | grep -i nvidia


EDITED:

As I looked over the info in that linked article again, this command should also have been used, for the 64 bit package:
dpkg-divert --package nvidia-340 --remove /usr/lib/x86_64-linux-gnu/libGL.so.1

You previously used this command, for the 32 bit package:
dpkg-divert --package nvidia-340 --remove /usr/lib/i386-linux-gnu/libGL.so.1

Use both commands again, both with and without sudo in front of them:

dpkg-divert --package nvidia-340 --remove /usr/lib/x86_64-linux-gnu/libGL.so.1
dpkg-divert --package nvidia-340 --remove /usr/lib/i386-linux-gnu/libGL.so.1


Then:
sudo dpkg-divert --package nvidia-340 --remove /usr/lib/x86_64-linux-gnu/libGL.so.1
sudo dpkg-divert --package nvidia-340 --remove /usr/lib/i386-linux-gnu/libGL.so.1



Then post the output of this command to check if those two diversion lines pointing to the nvidia-340 driver are removed:
dpkg-divert --list
Last edited by roblm on Thu Oct 04, 2018 3:14 pm, edited 1 time in total.
gewitty
Level 2
Level 2
Posts: 63
Joined: Tue Apr 14, 2009 11:02 am

Re: Cannot run Nvidia driver

Post by gewitty »

Here you go:

$ dpkg -l | grep -i nvidia
ii libnvidia-cfg1-390:amd64 390.48-0ubuntu3 amd64 NVIDIA binary OpenGL/GLX configuration library
ii libnvidia-common-390 390.48-0ubuntu3 all Shared files used by the NVIDIA libraries
ii libnvidia-compute-390:amd64 390.48-0ubuntu3 amd64 NVIDIA libcompute package
ii libnvidia-compute-390:i386 390.48-0ubuntu3 i386 NVIDIA libcompute package
ii libnvidia-decode-390:amd64 390.48-0ubuntu3 amd64 NVIDIA Video Decoding runtime libraries
ii libnvidia-decode-390:i386 390.48-0ubuntu3 i386 NVIDIA Video Decoding runtime libraries
ii libnvidia-encode-390:amd64 390.48-0ubuntu3 amd64 NVENC Video Encoding runtime library
ii libnvidia-encode-390:i386 390.48-0ubuntu3 i386 NVENC Video Encoding runtime library
ii libnvidia-fbc1-390:amd64 390.48-0ubuntu3 amd64 NVIDIA OpenGL-based Framebuffer Capture runtime library
ii libnvidia-fbc1-390:i386 390.48-0ubuntu3 i386 NVIDIA OpenGL-based Framebuffer Capture runtime library
iU libnvidia-ifr1-390:amd64 390.48-0ubuntu3 amd64 NVIDIA OpenGL-based Inband Frame Readback runtime library
iU libnvidia-ifr1-390:i386 390.48-0ubuntu3 i386 NVIDIA OpenGL-based Inband Frame Readback runtime library
ii nvidia-compute-utils-390 390.48-0ubuntu3 amd64 NVIDIA compute utilities
ii nvidia-dkms-390 390.48-0ubuntu3 amd64 NVIDIA DKMS package
iU nvidia-driver-390 390.48-0ubuntu3 amd64 NVIDIA driver metapackage
ii nvidia-kernel-common-390 390.48-0ubuntu3 amd64 Shared files used with the kernel module
ii nvidia-kernel-source-390 390.48-0ubuntu3 amd64 NVIDIA kernel source package
ii nvidia-prime 0.8.8 all Tools to enable NVIDIA's Prime
ii nvidia-settings 390.42-0ubuntu1 amd64 Tool for configuring the NVIDIA graphics driver
ii nvidia-utils-390 390.48-0ubuntu3 amd64 NVIDIA driver support binaries
ii xserver-xorg-video-nvidia-390 390.48-0ubuntu3 amd64 NVIDIA binary Xorg driver
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Cannot run Nvidia driver

Post by roblm »

I just edited my previous post with additional info and submitted it right after you submitted your previous post.
gewitty
Level 2
Level 2
Posts: 63
Joined: Tue Apr 14, 2009 11:02 am

Re: Cannot run Nvidia driver

Post by gewitty »

Ran those commands, with results as follows:

$ dpkg-divert --package nvidia-340 --remove /usr/lib/x86_64-linux-gnu/libGL.so.1
Removing 'diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 to /usr/lib/x86_64-linux-gnu/libGL.so.1.distrib by nvidia-340'
dpkg-divert: error: unable to create new file '/var/lib/dpkg/diversions-new': Permission denied

$ dpkg-divert --package nvidia-340 --remove /usr/lib/i386-linux-gnu/libGL.so.1
No diversion 'diversion of /usr/lib/i386-linux-gnu/libGL.so.1 by nvidia-340', none removed.

$ sudo dpkg-divert --package nvidia-340 --remove /usr/lib/x86_64-linux-gnu/libGL.so.1
Removing 'diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 to /usr/lib/x86_64-linux-gnu/libGL.so.1.distrib by nvidia-340'

$ sudo dpkg-divert --package nvidia-340 --remove /usr/lib/i386-linux-gnu/libGL.so.1
No diversion 'diversion of /usr/lib/i386-linux-gnu/libGL.so.1 by nvidia-340', none removed.

$ dpkg-divert --list
diversion of /usr/lib/x86_64-linux-gnu/libEGL.so to /usr/lib/x86_64-linux-gnu/libEGL.so.distrib by nvidia-340
diversion of /usr/share/dict/words to /usr/share/dict/words.pre-dictionaries-common by dictionaries-common
diversion of /usr/lib/i386-linux-gnu/libGLESv2.so.2 to /usr/lib/i386-linux-gnu/libGLESv2.so.2.distrib by nvidia-340
diversion of /usr/lib/x86_64-linux-gnu/libGLESv2.so.2 to /usr/lib/x86_64-linux-gnu/libGLESv2.so.2.distrib by nvidia-340
diversion of /usr/lib/x86_64-linux-gnu/libEGL.so.1 to /usr/lib/x86_64-linux-gnu/libEGL.so.1.distrib by nvidia-340
diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.distrib.1.gz by dash
diversion of /usr/lib/i386-linux-gnu/libGLESv2.so to /usr/lib/i386-linux-gnu/libGLESv2.so.distrib by nvidia-340
diversion of /usr/lib/i386-linux-gnu/libEGL.so to /usr/lib/i386-linux-gnu/libEGL.so.distrib by nvidia-340
diversion of /usr/lib/i386-linux-gnu/libGL.so to /usr/lib/i386-linux-gnu/libGL.so.distrib by nvidia-340
diversion of /usr/lib/libreoffice/share/basic/script.xlc to /usr/lib/libreoffice/share/basic/script.xlc.noaccess by libreoffice-base
diversion of /usr/lib/x86_64-linux-gnu/libGL.so to /usr/lib/x86_64-linux-gnu/libGL.so.distrib by nvidia-340
diversion of /usr/lib/libreoffice/share/basic/dialog.xlc to /usr/lib/libreoffice/share/basic/dialog.xlc.noaccess by libreoffice-base
diversion of /usr/lib/i386-linux-gnu/libEGL.so.1 to /usr/lib/i386-linux-gnu/libEGL.so.1.distrib by nvidia-340
diversion of /bin/sh to /bin/sh.distrib by dash
diversion of /usr/share/initramfs-tools/hooks/klibc to /usr/share/initramfs-tools/hooks/klibc^i-t by klibc-utils
diversion of /usr/lib/x86_64-linux-gnu/libGLESv2.so to /usr/lib/x86_64-linux-gnu/libGLESv2.so.distrib by nvidia-340
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Cannot run Nvidia driver

Post by roblm »

Try reinstalling the nvidia-390 driver again: sudo apt install --reinstall nvidia-driver-390

If that doesn’t work, then use this command: sudo apt install --fix-broken
gewitty
Level 2
Level 2
Posts: 63
Joined: Tue Apr 14, 2009 11:02 am

Re: Cannot run Nvidia driver

Post by gewitty »

Same problem shows up again:

$ sudo apt install --reinstall nvidia-driver-390
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies.
libnvidia-ifr1-390 : Depends: libnvidia-gl-390 but it is not going to be installed
libnvidia-ifr1-390:i386 : Depends: libnvidia-gl-390:i386 but it is not going to be installed
nvidia-driver-390 : Depends: libnvidia-gl-390 (= 390.48-0ubuntu3) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

$ sudo apt install --fix-broken
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
libnvidia-gl-390 libnvidia-gl-390:i386
The following NEW packages will be installed
libnvidia-gl-390 libnvidia-gl-390:i386
0 to upgrade, 2 to newly install, 0 to remove and 206 not to upgrade.
3 not fully installed or removed.
Need to get 0 B/29.1 MB of archives.
After this operation, 147 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 428703 files and directories currently installed.)
Preparing to unpack .../libnvidia-gl-390_390.48-0ubuntu3_i386.deb ...
diversion of /usr/lib/i386-linux-gnu/libGL.so to /usr/lib/i386-linux-gnu/libGL.so.distrib by nvidia-340
dpkg-divert: error: mismatch on package
when removing 'diversion of /usr/lib/i386-linux-gnu/libGL.so by libnvidia-gl-390'
found 'diversion of /usr/lib/i386-linux-gnu/libGL.so to /usr/lib/i386-linux-gnu/libGL.so.distrib by nvidia-340'
dpkg: error processing archive /var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_i386.deb (--unpack):
new libnvidia-gl-390:i386 package pre-installation script subprocess returned error exit status 2
Preparing to unpack .../libnvidia-gl-390_390.48-0ubuntu3_amd64.deb ...
diversion of /usr/lib/x86_64-linux-gnu/libGL.so to /usr/lib/x86_64-linux-gnu/libGL.so.distrib by nvidia-340
dpkg-divert: error: mismatch on package
when removing 'diversion of /usr/lib/x86_64-linux-gnu/libGL.so by libnvidia-gl-390'
found 'diversion of /usr/lib/x86_64-linux-gnu/libGL.so to /usr/lib/x86_64-linux-gnu/libGL.so.distrib by nvidia-340'
dpkg: error processing archive /var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_amd64.deb (--unpack):
new libnvidia-gl-390:amd64 package pre-installation script subprocess returned error exit status 2
Errors were encountered while processing:
/var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_i386.deb
/var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Cannot run Nvidia driver

Post by roblm »

I was afraid this would happen. Now these two lines are listed for libGL.so, but the previous lines for libGl.so.1 are gone:
diversion of /usr/lib/i386-linux-gnu/libGL.so to /usr/lib/i386-linux-gnu/libGL.so.distrib by nvidia-340
diversion of /usr/lib/x86_64-linux-gnu/libGL.so to /usr/lib/x86_64-linux-gnu/libGL.so.distrib by nvidia-340

All the diversion lines pointing to the nvidia-340 driver should have been removed with this command used previously, but it obviously didn’t work:

Code: Select all

for FILE in $(dpkg-divert --list | grep nvidia-340 | awk '{print $3}'); do dpkg-divert --remove $FILE; done

Use these commands to remove them:

sudo dpkg-divert --package nvidia-340 --remove /usr/lib/x86_64-linux-gnu/libGL.so
sudo dpkg-divert --package nvidia-340 --remove /usr/lib/i386-linux-gnu/libGL.so



I’m guessing that all the other diversion lines will appear from the dpkg-divert --list command, so use these commands to remove them:

sudo dpkg-divert --package nvidia-340 --remove /usr/lib/x86_64-linux-gnu/libEGL.so
sudo dpkg-divert --package nvidia-340 --remove /usr/lib/i386-linux-gnu/libEGL.so

sudo dpkg-divert --package nvidia-340 --remove /usr/lib/x86_64-linux-gnu/libGLESv2.so.2
sudo dpkg-divert --package nvidia-340 --remove /usr/lib/i386-linux-gnu/libGLESv2.so.2

sudo dpkg-divert --package nvidia-340 --remove /usr/lib/x86_64-linux-gnu/libGLESv2.so
sudo dpkg-divert --package nvidia-340 --remove /usr/lib/i386-linux-gnu/libGLESv2.so

sudo dpkg-divert --package nvidia-340 --remove /usr/lib/x86_64-linux-gnu/libEGL.so.1
sudo dpkg-divert --package nvidia-340 --remove /usr/lib/i386-linux-gnu/libEGL.so.1


Then use the sudo apt install --fix-broken command
gewitty
Level 2
Level 2
Posts: 63
Joined: Tue Apr 14, 2009 11:02 am

Re: Cannot run Nvidia driver

Post by gewitty »

All of the removals wnet OK. No errors. But the Fix Broken command produced this:

Code: Select all

$ sudo apt install --fix-broken
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libnvidia-gl-390 libnvidia-gl-390:i386
The following NEW packages will be installed
  libnvidia-gl-390 libnvidia-gl-390:i386
0 to upgrade, 2 to newly install, 0 to remove and 206 not to upgrade.
3 not fully installed or removed.
Need to get 0 B/29.1 MB of archives.
After this operation, 147 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 428689 files and directories currently installed.)
Preparing to unpack .../libnvidia-gl-390_390.48-0ubuntu3_i386.deb ...
diversion of /usr/lib/i386-linux-gnu/libGL.so to /usr/lib/i386-linux-gnu/libGL.so.distrib by nvidia-340
dpkg-divert: error: mismatch on package
  when removing 'diversion of /usr/lib/i386-linux-gnu/libGL.so by libnvidia-gl-390'
  found 'diversion of /usr/lib/i386-linux-gnu/libGL.so to /usr/lib/i386-linux-gnu/libGL.so.distrib by nvidia-340'
dpkg: error processing archive /var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_i386.deb (--unpack):
 new libnvidia-gl-390:i386 package pre-installation script subprocess returned error exit status 2
Preparing to unpack .../libnvidia-gl-390_390.48-0ubuntu3_amd64.deb ...
diversion of /usr/lib/x86_64-linux-gnu/libEGL.so to /usr/lib/x86_64-linux-gnu/libEGL.so.distrib by nvidia-340
dpkg-divert: error: mismatch on package
  when removing 'diversion of /usr/lib/x86_64-linux-gnu/libEGL.so by libnvidia-gl-390'
  found 'diversion of /usr/lib/x86_64-linux-gnu/libEGL.so to /usr/lib/x86_64-linux-gnu/libEGL.so.distrib by nvidia-340'
dpkg: error processing archive /var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_amd64.deb (--unpack):
 new libnvidia-gl-390:amd64 package pre-installation script subprocess returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_i386.deb
 /var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Cannot run Nvidia driver

Post by roblm »

I forgot to mention for you to post the output of dpkg-divert --list in case there was still a problem. I don’t know why these two diversion lines are still listed because they were previously removed:

Code: Select all

diversion of /usr/lib/i386-linux-gnu/libGL.so to /usr/lib/i386-linux-gnu/libGL.so.distrib by nvidia-340
diversion of /usr/lib/x86_64-linux-gnu/libEGL.so to /usr/lib/x86_64-linux-gnu/libEGL.so.distrib by nvidia-340

Use these commands again to remove them:

sudo dpkg-divert --package nvidia-340 --remove /usr/lib/i386-linux-gnu/libGL.so
sudo dpkg-divert --package nvidia-340 --remove /usr/lib/x86_64-linux-gnu/libEGL.so



Then use the command dpkg-divert --list to check for any diversion lines that have nvidia-340 at the end. Use the correct commands that were previously used to remove them. If necessary, repeat using the commands until they are gone. Only these lines should remain:

Code: Select all

diversion of /usr/share/dict/words to /usr/share/dict/words.pre-dictionaries-common by dictionaries-common
diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.distrib.1.gz by dash
diversion of /usr/lib/libreoffice/share/basic/script.xlc to /usr/lib/libreoffice/share/basic/script.xlc.noaccess by libreoffice-base
diversion of /usr/lib/libreoffice/share/basic/dialog.xlc to /usr/lib/libreoffice/share/basic/dialog.xlc.noaccess by libreoffice-base
diversion of /bin/sh to /bin/sh.distrib by dash
diversion of /usr/share/initramfs-tools/hooks/klibc to /usr/share/initramfs-tools/hooks/klibc^i-t by klibc-utils

Then use sudo apt install --fix-broken again.
Last edited by roblm on Sun Oct 07, 2018 8:58 am, edited 1 time in total.
gewitty
Level 2
Level 2
Posts: 63
Joined: Tue Apr 14, 2009 11:02 am

Re: Cannot run Nvidia driver

Post by gewitty »

That all appeared to go as planned. No errors were reported. However, when I check the status in Driver Manager, it tells me that "this device is using a manually installed driver". All the alternative driver options are greyed out and a new one has appeared as the selected option. This is labelled as "Continue using a manually installed driver", but it doesn't say what the driver is.

When I run $ inxi -G, I get:

Graphics: Card: NVIDIA GM107 [GeForce GTX 750 Ti]
Display Server: x11 (X.Org 1.19.6 )
drivers: nouveau (unloaded: modesetting,fbdev,vesa)
Resolution: 1920x1080@60.00hz
OpenGL: renderer: NV117 version: 4.3 Mesa 18.0.5

dpkg-divert list shows:

diversion of /usr/share/dict/words to /usr/share/dict/words.pre-dictionaries-common by dictionaries-common
diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.distrib.1.gz by dash
diversion of /usr/lib/libreoffice/share/basic/script.xlc to /usr/lib/libreoffice/share/basic/script.xlc.noaccess by libreoffice-base
diversion of /usr/lib/libreoffice/share/basic/dialog.xlc to /usr/lib/libreoffice/share/basic/dialog.xlc.noaccess by libreoffice-base
diversion of /bin/sh to /bin/sh.distrib by dash
diversion of /usr/share/initramfs-tools/hooks/klibc to /usr/share/initramfs-tools/hooks/klibc^i-t by klibc-utils

which looks pretty much as it should. So it seems that something pretty fundamental must be broken.
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Cannot run Nvidia driver

Post by roblm »

gewitty wrote:However, when I check the status in Driver Manager, it tells me that "this device is using a manually installed driver".
That’s a bug in the operation of Driver Manager. Prior to Mint 19, the only time that message was seen was when a Nvidia driver was downloaded and installed from Nvidia’s website. Now it usually happens when the Nviidia driver is removed from Driver Manager. If you want to remove or change the Nvidia driver, then it will have to be done using the apt commandline package manager.

We need to check if the Nvidia driver was installed and configured correctly. Use these commands and post the output:

Code: Select all

inxi -SMC
ls /lib/modules/`uname -r`/kernel/drivers/char/drm/
lspci -nnk |egrep -A3 -i "3D|VGA"	
ls /etc/modprobe.d
mokutil --sb-state

Also post the Xorg.0.log file. Use this command to open it: xed /var/log/Xorg.0.log
Press Ctrl+A to select the entire file contents. Right click on the screen and select “Copy”. Open the Mint Forum reply window and select </> at the top. Press Ctrl+V to paste the copied lines into a code display window.

If you have problems posting that long file, then it can be uploaded to pastebin. You previously installed pastebinit. Use this command to upload the file: pastebinit /var/log/Xorg.0.log

Post the URL link that displays in the Terminal window.
gewitty
Level 2
Level 2
Posts: 63
Joined: Tue Apr 14, 2009 11:02 am

Re: Cannot run Nvidia driver

Post by gewitty »

Results as follows:

Code: Select all

$ inxi -SMC
System:    Host: dave   Kernel: 4.15.0-33-generic x86_64
           bits: 64
           Desktop: Cinnamon 3.8.8  Distro: Linux Mint 19 Tara
Machine:   Device: desktop Mobo: ASUSTeK model: H110M-R v: Rev X.0x serial: N/A
           UEFI: American Megatrends v: 1802 date: 05/26/2016
CPU:       Quad core Intel Core i5-6600 (-MCP-) cache: 6144 KB
           clock speeds: max: 3900 MHz 1: 800 MHz 2: 800 MHz 3: 800 MHz

$ ls /lib/modules/`uname -r`/kernel/drivers/char/drm/
nvidia-drm.ko  nvidia.ko  nvidia-modeset.ko  nvidia-uvm.ko

$ lspci -nnk |egrep -A3 -i "3D|VGA"
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM107 [GeForce GTX 750 Ti] [10de:1380] (rev a2)
	Subsystem: ASUSTeK Computer Inc. GM107 [GeForce GTX 750 Ti] [1043:84bb]
	Kernel driver in use: nouveau
	Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia

$ ls /etc/modprobe.d
alsa-base.conf                  blacklist-oss.conf
amd64-microcode-blacklist.conf  blacklist-rare-network.conf
blacklist-ath_pci.conf          dkms.conf
blacklist.conf                  intel-microcode-blacklist.conf
blacklist-firewire.conf         iwlwifi.conf
blacklist-framebuffer.conf      nvidia-graphics-drivers.conf
blacklist-modem.conf

$ mokutil --sb-state
SecureBoot enabled
https://pastebin.com/v4y8dHkP
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Cannot run Nvidia driver

Post by roblm »

You enabled Secure Boot on your system after installing Mint, which does add an additional layer of security, but prevents the Nvidia kernel module and driver from loading.

Many distributions require kernel driver modules to be signed when loaded into kernels running on UEFI systems with Secure Boot enabled. You have two options. Either disable Secure Boot in the BIOS/UEFI or generate new signing keys that will be used to sign the Nvidia kernel modules.

Prior to September of this year, I would have told you to disable Secure Boot, but I have just finished a guide for installing the Nvidia driver with Secure Boot enabled, whether that driver is installed with the distro’s package manager or downloaded from Nvidia’s website. Go down to my second post on page 2 in this topic, under the section How to install the Nvidia driver with Secure Boot enabled; for drivers installed using Driver Manager, apt or Synaptic:

viewtopic.php?f=59&t=154932

The Nvidia driver installation on your system created 4 kernel modules that will need to be signed.
Locked

Return to “Graphics Cards & Monitors”