[Solved] Uninstall Nvidia Web Driver?

Discussion in 'Graphics' started by coolnitman, Mar 2, 2016.

  1. coolnitman

    coolnitman

    Joined:
    Sep 3, 2012
    Messages:
    92
    Mobo:
    ASUS Z170 PRO GAMING
    CPU:
    Intel® Core™ i7-6700
    Graphics:
    NVIDIA 1050 Ti
    Mac:
    iMac, MacBook Pro
    Mobile Phone:
    Android, iOS
    Mar 2, 2016 at 5:42 PM #1
    coolnitman

    coolnitman

    Joined:
    Sep 3, 2012
    Messages:
    92
    Mobo:
    ASUS Z170 PRO GAMING
    CPU:
    Intel® Core™ i7-6700
    Graphics:
    NVIDIA 1050 Ti
    Mac:
    iMac, MacBook Pro
    Mobile Phone:
    Android, iOS
    How to Uninstall Nvidia Web Driver?
     
  2. BreBo

    BreBo Moderator

    Joined:
    Oct 17, 2011
    Messages:
    4,993
    Mobo:
    Gigabyte GA-Z87X-OC
    CPU:
    Intel Core i7-4770K
    Graphics:
    Asus Strix GTX 970
    Mar 2, 2016 at 5:53 PM #2
    BreBo

    BreBo Moderator

    Joined:
    Oct 17, 2011
    Messages:
    4,993
    Mobo:
    Gigabyte GA-Z87X-OC
    CPU:
    Intel Core i7-4770K
    Graphics:
    Asus Strix GTX 970
    According to the additional information here.

    To uninstall the NVIDIA Web Driver and the NVIDIA Driver Manager, follow the steps below:

    STEP 1: Open the NVIDIA Driver Manager from the System Preferences or through the menu bar item.

    STEP 2: Click on the padlock icon and enter an Administrator password.

    STEP 3: Click the Open Uninstaller button.

    STEP 4: Click Uninstall and then Continue Uninstallation on the Warning screen: The Warning screen lets you know that you will need to restart your system once the installation process is complete.

    STEP 5: Re-enter an Administrator password and click OK. Once the NVIDIA Web Driver and NVIDIA Driver Manager have been removed from the system, click Restart.
     
    Wuttodo and Adam1203 like this.
  3. coolnitman

    coolnitman

    Joined:
    Sep 3, 2012
    Messages:
    92
    Mobo:
    ASUS Z170 PRO GAMING
    CPU:
    Intel® Core™ i7-6700
    Graphics:
    NVIDIA 1050 Ti
    Mac:
    iMac, MacBook Pro
    Mobile Phone:
    Android, iOS
    Mar 2, 2016 at 6:01 PM #3
    coolnitman

    coolnitman

    Joined:
    Sep 3, 2012
    Messages:
    92
    Mobo:
    ASUS Z170 PRO GAMING
    CPU:
    Intel® Core™ i7-6700
    Graphics:
    NVIDIA 1050 Ti
    Mac:
    iMac, MacBook Pro
    Mobile Phone:
    Android, iOS

    Thanks.
     
  4. dwhitla

    dwhitla

    Joined:
    May 11, 2012
    Messages:
    85
    Mobo:
    ASUS Prime X299 Deluxe
    CPU:
    i9 7900X
    Graphics:
    EVGA GTX 1080Ti Founders Edition
    Mac:
    MacBook Pro
    Oct 5, 2017 at 12:29 PM #4
    dwhitla

    dwhitla

    Joined:
    May 11, 2012
    Messages:
    85
    Mobo:
    ASUS Prime X299 Deluxe
    CPU:
    i9 7900X
    Graphics:
    EVGA GTX 1080Ti Founders Edition
    Mac:
    MacBook Pro
    Sometimes you may need to do this from a CLI because you are only able to SSH back in to your bricked hackintosh following a failed WebDriver install (like I am doing right now :)).

    In such a circumstance it may be useful to know that the uninstaller can be invoked from a terminal.

    Recall that the Nvidia PrefPane has an Uninstall option.

    <TLDR>
    As root, unpack /Library/PreferencePanes/NVIDIA\ Driver\ Manager.prefPane/Contents/MacOS/NVIDIA\ Web\ Driver Uninstaller.app/Contents/Resources/NVUninstall.pkg to a temporary location and run <unpacked>/Scripts/postinstall
    </TLDR>

    This is what I found poking around my bricked hack over SSH:
    Code (Text):

    root@x:/Library/PreferencePanes/NVIDIA Driver Manager.prefPane/Contents/MacOS/NVIDIA Web Driver Uninstaller.app/Contents# pkgutil --expand Resources/NVUninstall.pkg /tmp/foo
    root@x:/Library/PreferencePanes/NVIDIA Driver Manager.prefPane/Contents/MacOS/NVIDIA Web Driver Uninstaller.app/Contents# ll /tmp/foo/
    total 8
    -rw-r--r--  1 root     wheel  475  5 Oct 17:10 PackageInfo
    drwxr-xr-x  3 dwhitla  admin   96  5 Oct 17:10 Scripts
    root@x:/Library/PreferencePanes/NVIDIA Driver Manager.prefPane/Contents/MacOS/NVIDIA Web Driver Uninstaller.app/Contents# pushd /tmp/foo
    /tmp/foo /Library/PreferencePanes/NVIDIA Driver Manager.prefPane/Contents/MacOS/NVIDIA Web Driver Uninstaller.app/Contents
    root@x:/tmp/foo# ll
    total 8
    -rw-r--r--  1 root     wheel  475  5 Oct 17:10 PackageInfo
    drwxr-xr-x  3 dwhitla  admin   96  5 Oct 17:10 Scripts
    root@x:/tmp/foo# cat PackageInfo
    <?xml version="1.0" encoding="utf-8"?>
    <pkg-info overwrite-permissions="true" relocatable="false" identifier="com.nvidia.combo-uninstall-pkg" postinstall-action="none" version="0" format-version="2" generator-version="InstallCmds-662 (17A347)" auth="root">
        <bundle-version/>
        <upgrade-bundle/>
        <update-bundle/>
        <atomic-update-bundle/>
        <strict-identifier/>
        <relocate/>
        <scripts>
            <postinstall file="./postinstall"/>
        </scripts>
    </pkg-info>root@x:/tmp/foo# ll
    total 8
    -rw-r--r--  1 root     wheel  475  5 Oct 17:10 PackageInfo
    drwxr-xr-x  3 dwhitla  admin   96  5 Oct 17:10 Scripts
    root@x:/tmp/foo# ll Scripts
    total 8
    -r-xr-xr-x  1 dwhitla  admin  3932  7 Sep 03:08 postinstall
    root@x:/tmp/foo#cat Scripts/postinstall
    #!/usr/bin/perl
    #
    # NVUninstall postinstall script
    #

    use strict;

    print "Starting...\n";

    ## We only support uninstalling the Web Driver on the boot volume "/"
    if ($ARGV[2] ne "/")
    {
        print "Error: invalid target \"$ARGV[2]\"\n";

        exit(1);
    }

    my $appSupportPath = "/Library/Application Support/NVIDIA";
    my $osBuild = `defaults read /System/Library/CoreServices/SystemVersion.plist ProductBuildVersion`;
    chomp($osBuild);

    ## Create a directory in /tmp to move items for deletion to
    my $uuid = `uuidgen`;
    chomp($uuid);
    my $ToBeDeleted = "/tmp/$uuid";
    mkdir($ToBeDeleted, 0755);

    print "Clearing NVRAM settings\n";
    removeWebDriverBootArg();

    print "Removing pref pane launchd plists\n";
    removePrefPaneLaunchdPlists();

    print "Removing pref pane bundle\n";
    removePrefPaneBundle();

    print "Removing var tmp directories\n";
    removeVarTmpDirs();

    print "Removing driver components\n";
    removeWebDriverComponents();    # now /Library/Extensions too

    print "Removing legacy web release files\n";
    removeLegacyWebReleaseFiles();

    print "Removing preference files\n";
    removeNVUserPrefs();

    print "Done\n";

    ##################################
    ## Work routines from here down ##
    ##################################

    sub removeNVUserPrefs()
    {
        my @users = `ls /Users 2> /dev/null`;

        foreach my $user (@users)
        {
            chomp($user);

            ##
            ## for some reason, `ls` includes entries that start
            ## with dot. so, explicitly skip it here.
            ##
            next if ($user =~ /^\./);

            my $prefsPath = "/Users/$user/Library/Preferences/ByHost";
            my @prefs = `ls $prefsPath/com.nvidia.nvagent.* $prefsPath/com.nvidia.nvprefpane.* 2> /dev/null`;

            foreach my $pref (@prefs)
            {
                chomp($pref);
                stageToDelete($pref);
            }
        }
    }

    sub removeLegacyWebReleaseFiles()
    {
        stageToDelete("/Library/Application Support/NVIDIA/NVIDIA Driver Restore.mpkg");
        stageToDelete("/usr/bin/NVIDIARecovery");
    }

    sub removeWebDriverComponents()
    {
        # also works with old kext location
        my @les = `/bin/ls -1 /Library/Extensions | egrep '^NVDA.*Web.kext\$|^GeForce.*Web.*\$'`;
        my @sles = `/bin/ls -1 /System/Library/Extensions | egrep '^NVDA.*Web.kext\$|^GeForce.*Web.*\$'`;

        foreach my $le (@les)
        {
            chomp($le);
            stageToDelete("/Library/Extensions/$le");
        }

        foreach my $sle (@sles)
        {
            chomp($sle);
            stageToDelete("/System/Library/Extensions/$sle");
        }
    }

    sub removePrefPaneLaunchdPlists()
    {
        my $agentPlist = "/Library/LaunchAgents/com.nvidia.nvagent.plist";
        my $helperPlist = "/Library/LaunchDaemons/com.nvidia.nvroothelper.plist";

        # Delete agent plist
        stageToDelete($agentPlist);

        ## Delete root helper plist
        stageToDelete($helperPlist);
    }

    sub removePrefPaneBundle()
    {
        stageToDelete("/Library/PreferencePanes/NVIDIA Driver Manager.prefPane");
    }

    sub removeVarTmpDirs()
    {
        my @files = qw(nvmenu nvprefpane nvagent nvroothelper);

        foreach (@files)
        {
            stageToDelete("/var/tmp/com.nvidia/com.nvidia.$_");
        }
    }

    sub stageToDelete($)
    {
        my $path = shift;

        if (-e $path)
        {
            system("/bin/mv -f '$path' $ToBeDeleted/.");
        }
    }

    sub removeWebDriverBootArg()
    {
        ##
        ## $ nvram boot-args
        ## boot-args    debug=0x14e -v nvda_drv=1
        ##

        ## Create array of args from nvram
        my @args = split(/\s/, `nvram boot-args 2> /dev/null`);

        ## remove "boot-args" at the beginning
        shift(@args);

        ## remove "nvda_drv" and "nvda_drv=*"
        my @cleanArgs = grep {!/^nvda_drv$/ && !/^nvda_drv=/} @args;

        ## skip nvram if nothing has changed
        if (@args != @cleanArgs)
        {
            if (@cleanArgs)
            {
                system("/usr/sbin/nvram boot-args=\"@cleanArgs\"");
            }
            else
            {
                ## if the new args is empty, delete the boot-args entry.
                system("/usr/sbin/nvram -d boot-args");
            }
        }
    }
     
    Theophilius likes this.
  5. stratos75

    stratos75

    Joined:
    Apr 24, 2017
    Messages:
    14
    Mobo:
    GIGABYTE GA-Z270X-UD5
    CPU:
    Intel i7 7700K
    Graphics:
    Asus Strix Geforce 970
    Mac:
    MacBook Air, Mac mini
    Mobile Phone:
    iOS
    Oct 5, 2017 at 5:53 PM #5
    stratos75

    stratos75

    Joined:
    Apr 24, 2017
    Messages:
    14
    Mobo:
    GIGABYTE GA-Z270X-UD5
    CPU:
    Intel i7 7700K
    Graphics:
    Asus Strix Geforce 970
    Mac:
    MacBook Air, Mac mini
    Mobile Phone:
    iOS
    Thanks for that @dwhitla I am in the same situation. Incredibly frustrating. Forgive my dumb question, would I need to type ALL OF THAT by hand in terminal (assuming in recovery mode)? Is there an easier way. Did this eliminate the Web Drivers?

    Thanks again!
     
  6. slim.jim

    slim.jim Moderator

    Joined:
    Dec 17, 2014
    Messages:
    3,878
    Mobo:
    MSI Z97 Gaming 9 AC
    CPU:
    i7-4790K
    Graphics:
    MSI GTX 970 Gaming 4G
    Mac:
    MacBook Pro, Mac Pro
    Classic Mac:
    PowerBook
    Mobile Phone:
    iOS
    Oct 6, 2017 at 3:46 AM #6
    slim.jim

    slim.jim Moderator

    Joined:
    Dec 17, 2014
    Messages:
    3,878
    Mobo:
    MSI Z97 Gaming 9 AC
    CPU:
    i7-4790K
    Graphics:
    MSI GTX 970 Gaming 4G
    Mac:
    MacBook Pro, Mac Pro
    Classic Mac:
    PowerBook
    Mobile Phone:
    iOS
    Can you not boot using the flag nv_disable=1?
     
  7. dwhitla

    dwhitla

    Joined:
    May 11, 2012
    Messages:
    85
    Mobo:
    ASUS Prime X299 Deluxe
    CPU:
    i9 7900X
    Graphics:
    EVGA GTX 1080Ti Founders Edition
    Mac:
    MacBook Pro
    Oct 6, 2017 at 7:15 AM #7
    dwhitla

    dwhitla

    Joined:
    May 11, 2012
    Messages:
    85
    Mobo:
    ASUS Prime X299 Deluxe
    CPU:
    i9 7900X
    Graphics:
    EVGA GTX 1080Ti Founders Edition
    Mac:
    MacBook Pro
    No. The uninstall script won't run in recovery mode (you can however perform equivalent steps manually in the Recovery Partition Terminal utility). To just run the script though, you need to have remote terminal access over SSH. All you need to do is:

    - be able to boot to a black screen or the looping screen clear with IOConsoleUser debug message - basically as long as the machine doesn't spontaneously reboot you should be able to SSH in as long as you previously enabled remote login in Sharing preferences (you should always do this as soon as you have a bootable system)
    - from another machine, SSH to your target machine
    - as root, unpack the nvidia uninstall package like so - pkgutil --expand /Library/PreferencePanes/NVIDIA\ Driver\ Manager.prefPane/Contents/MacOS/NVIDIA\ Web\ Driver\ Uninstaller.app/Contents/Resources/NVUninstall.pkg /tmp/foo
    - as root run the uninstall script like so - /tmp/foo/Scripts/postinstall 0 0 /
    - reboot and at the Clover boot screen hit spacebar and select the nv_disable option before choosing Boot with selected options
    - edit your Clover config.plist to remove either the nvda_drv=1 boot arg or NvidiaWeb system parameter (whichever one you were using)
    - reinstall the WebDriver (if that is your aim) by rebooting this time with SIP enabled CsrActiveConfig = 0x0 (if you can't boot with SIP enabled for some reason try booting with SIP enabled in Safe Mode - this worked for me
     
    Last edited: Oct 8, 2017
  8. vulgo

    vulgo

    Joined:
    Jul 24, 2015
    Messages:
    1,240
    Mobo:
    MSI H81i
    CPU:
    i5-4570
    Graphics:
    GTX 970
    Mac:
    iMac
    Mobile Phone:
    Android
    Oct 6, 2017 at 8:05 AM #8
    vulgo

    vulgo

    Joined:
    Jul 24, 2015
    Messages:
    1,240
    Mobo:
    MSI H81i
    CPU:
    i5-4570
    Graphics:
    GTX 970
    Mac:
    iMac
    Mobile Phone:
    Android
    If you want to uninstall them from recovery you can do the following, replacing Macintosh HD with your root disk label
    Code (Text):
    # v="/Volumes/Macintosh HD"
    remove the drivers and update folder timestamps
    Code (Text):
    # cd "$v"/Library/Extensions
    # rm -rf GeForce*
    # rm -rf NVDA*
    # touch .
    # cd "$v"/System/Library/Extensions
    # rm -rf GeForce*Web*
    # touch .
    rebuild cache
    Code (Text):
    # kextcache -u "$v"
    # reboot
     
    karea12 and onmybikedrunk like this.
  9. dwhitla

    dwhitla

    Joined:
    May 11, 2012
    Messages:
    85
    Mobo:
    ASUS Prime X299 Deluxe
    CPU:
    i9 7900X
    Graphics:
    EVGA GTX 1080Ti Founders Edition
    Mac:
    MacBook Pro
    Oct 6, 2017 at 8:30 AM #9
    dwhitla

    dwhitla

    Joined:
    May 11, 2012
    Messages:
    85
    Mobo:
    ASUS Prime X299 Deluxe
    CPU:
    i9 7900X
    Graphics:
    EVGA GTX 1080Ti Founders Edition
    Mac:
    MacBook Pro
    This will remove the kexts but the installer installed more than kexts. Thats why I posted the perl script - if you want you can just perform the equivalent steps manually in recovery mode.
     
    Theophilius likes this.
  10. Scott1204

    Scott1204

    Joined:
    Dec 14, 2016
    Messages:
    132
    Mobo:
    Gigabyte Z170X-UD3 ULTRA
    CPU:
    i7700K
    Graphics:
    EVGA Nvidia GTX 1080Ti
    Mobile Phone:
    iOS
    Oct 7, 2017 at 6:08 PM #10
    Scott1204

    Scott1204

    Joined:
    Dec 14, 2016
    Messages:
    132
    Mobo:
    Gigabyte Z170X-UD3 ULTRA
    CPU:
    i7700K
    Graphics:
    EVGA Nvidia GTX 1080Ti
    Mobile Phone:
    iOS
    What about uninstalling from the desktop? Tried Nivida uninstall, rebooted, nothing changed. Do I have to force it through terminal or maybe is it a SIP issue?
     

Share This Page