Giter VIP home page Giter VIP logo

purge-nvda's Introduction

Header

Script Version macOS Support Github All Releases paypal

PurgeNVDA

purge-nvda.sh is required for certain macs to configure the system further for working external GPU support, alongside purge-wrangler.sh. It may also serve useful for other use cases such as bad discrete GPU chipsets, etc., but is not tested or guaranteed.

Contents

A quick run-through of what's included in this document:

  • Pre-Requisites
    • macOS requirements, pre-system configuration specifics, and more.
  • Installation
    • Installing and running the script.
  • Script Options
    • Available capabilities and options in the script.
  • Recovery
    • Easy way to recover from an unbootable system using the script.
  • Post-Install
    • System configuration after script installation and some other things of note.
  • Known Issues
    • A table of known issues and side effects of using the script.
  • Troubleshooting
    • Additional resources and guides for eGPUs.
  • Disclaimer
    • Please read the disclaimer before using this script.
  • License
    • By using this script, you consent to the license that the script comes bundled with.
  • Support
    • Support the developer if you'd like to.

Pre-Requisites

In case you are not up-to-date, please read Apple's external GPU documentation first to see what is already supported on macOS. The following is a table that summarizes system requirements for using this script:

Configuration Requirement Description
macOS 10.13.4+ Older versions of macOS require different patching mechanisms that this script does not include. Please check eGPU.io for more information.
System Integrity Protection Disabled By default, this prevents system modifications that the script would like to make, and hence must be disabled. SIP can be disabled as described in this article.
Internal GPUs Intel + NVIDIA Presence of both an integrated Intel GPU and discrete NVIDIA GPU is required, i.e., iMacs are not supported. Script may be run on iMacs for experimentation.

Installation

purge-nvda.sh auto-manages itself and provides multiple installation and recovery options. Once the pre-requisites are satisfied, install the script by running the following in Terminal:

curl -q -s "https://api.github.com/repos/mayankk2308/purge-nvda/releases/latest" | grep '"browser_download_url":' | sed -E 's/.*"browser_download_url":[ \t]*"([^"]+)".*/\1/' | xargs curl -L -s -0 > purge-nvda.sh && chmod +x purge-nvda.sh && ./purge-nvda.sh && rm purge-nvda.sh

For future use, only the following will be required:

purge-nvda

In case the command above does not work, you can re-use the long installation command and fix the issue.

Some Notes

After using the script, sometimes you may observe that the system is unbootable. In such a case, boot into single user mode as advised in the pre-requisites and set mux to iGPU to force the mux setting. This needs to be done because in some cases, the setting does not apply (after using option 1, 2, 4, or 5 while in macOS).

Script Options

PurgeNVDA makes it super-easy to perform actions with an interactive menu, and is recommended for most users. Providing no arguments to the script defaults to the menu.

Argument Menu Description
-fa or --fix-amd AMD eGPUs Disables the discrete NVIDIA GPU, sets the gmux to the Intel GPU, allowing any AMD framebuffers to render correctly. Any and all NVIDIA GPUs will be disabled. This patch affects all installations running on the machine and does not modify system files.
-on or --optimize-nv NVIDIA eGPUs Disables only the internal NVIDIA GPU and sets the gmux to Intel GPU to enable OpenCL/GL acceleration and high performance with NVIDIA eGPUs with a combination of NVRAM + NVDA kernel extension patches.
-u or --uninstall Uninstall Reverts and removes any system modifications made using the script. If unsuccessful, attempt using it in Single User Mode (Boot with ⌘ + S).
-sn or --suppress-nv Suppress NVIDIA GPUs Disables all NVIDIA GPUs with fixed cold gmux - therefore affecting all macOS installations running on the machine. This patch does not modify any system files.
-mi or --mux-igpu Set Mux to iGPU Sets the system graphics multiplexer to the integrated Intel GPU, if available. This preference is after a system boots with its discrete GPU enabled (such that macOS may initialize its framebuffer), thus only lasts for one boot unless appropriate measures to curb dGPU activation are in place.
-s or --status Status Shows the currently installed patches on the system. Since the mux commands are consumed, mux status will show as inactive/disabled after the chip has been set.
-d or --donate Donate Launches the default web browser with the set donation link - essentially the same as the PayPal button on this page.

Recovery

If you are unable to boot into macOS, boot while pressing ⌘ + S, then enter the following commands:

mount -uw /
purge-nvda -u

This will restore your system to a clean state as documented above.

Post-Install

After installing the script, all settings as described in pre-requisites must persist. For instance, system integrity protection must remain disabled as long as the system is in the patched state.

Known Issues

purge-nvda.sh implements solutions that bring with it multiple undesirable side effects. The following table lists issues and their potential impact on daily usage.

Issue Workaround Description
Unbootable System Set Mux to iGPU Because of the unknown impact of the mux variable in EFI, the patches are sometimes partially applied, thus resulting in an unbootable system. Booting into single user mode and running the workaround re-sets the mux correctly and completes the patch.
Sleep & Brightness None Use of this patch on applicable macs disables proper sleep and brightness controls completely, including the loss of clamshell sleep modes, that is, the display will not turn off even if the laptop lid is closed. Uninstall recommended for on-the-go use. I cannot investigate further workarounds, but I believe some Hackintosh solutions to enable sleep on iGPU might be applicable.
dGPU Power Draw None Discrete GPU draws power and emits heat even though it is disabled. I do not have an applicable machine to test further, but this script unfortunately does not include workarounds to address this issue. Perhaps some tweaking with power management and GPU control kexts could make a difference.

Troubleshooting

Troubleshooting plays an important role in any kind of hack/patch. New OSes and hardware tend to bring with them new problems and challenges. The hardware chart aims to cover all variances of problems with eGPUs so far, but there can be some specific missed edge cases. The following is a list of additional resources rich in information:

Resource Description
eGPU.io Build Guides See builds for a variety of systems and eGPUs. If you don't find an exact match, look for similar builds.
eGPU.io Troubleshooting Guide Learn about some basics of eGPUs in macOS and find out what means what. This guide does not cover any Windows/Bootcamp-related efforts.
eGPU.io Community The eGPU.io forums are a great place to post concerns and doubts about your setup. Be sure to search the forum before posting as there might be high chance your doubt has already been answered.
eGPU Community on Reddit The reddit community is a wonderful place to request additional help for your new setup, and a good place to find fellow eGPU users.

My username on both communities is @mac_editor. Feel free to mention my username on eGPU.io posts - I get an email notifying me of the same. In any case, with thousands of members, the community is a welcoming place. Don't be shy!

Disclaimer

This script moves core system files associated with macOS. While any of the potential issues with its application are recoverable, please use this script at your discretion. I will not be liable for any damages to your operating system.

License

The bundled license allows commercial use and redistribution for any purposes. This software comes without any warranty or guaranteed support. By using the script, you agree to adhere to the MIT license. For more information, please see the LICENSE.

Support

If you loved purge-nvda.sh, consider starring the repository or if you would like to, donate via PayPal:

paypal

Thank you for using purge-nvda.sh. This project is currently maintained for any discovered bugs/errors.

purge-nvda's People

Contributors

icedawn avatar mayankk2308 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

purge-nvda's Issues

Issue with sleep, logout + clamshell sleep = shutdown

I test three ways, as follows

  1. directly cover, will not sleep display and macos, consuming the power
  2. lock and cover, will not sleep display and macos, consuming the power
  3. log out and cover, after a short time, it's okay, but even a bit longer time, it will be shut down incidentally
    In conclusion, at current this script will disable the normal function of sleeping macbook.

I can not enter the script menu

I can not restore the factory settings after turning off the NVIDIA video card. I'm getting this message
This script only supports macs with discrete NVIDIA GPUs.

Will this work for internal NVIDIA GPUs in MP 7,1?

Just stumbled over this project while searching for a solution with the new NVIDIA Ampere Cards (i.e. 3080s and 3090s) in the Mac Pro 2019. Most of these - but apparently not all models - have problems with sleep in macOS, i.e. the OS crashes when going into sleep or waking up.

Any idea if this script also might help in this case, or - if not - any ideas how to make macOS ignore the NVIDIA card, and/or do some patches so that sleep does work with such a card? Of course we are aware that those cards are not supported with macOS, but they are usable with bootcamp. Still, not being able to sleep with such a card under macOS is a dealbreaker for many of us, so any insights are greatly appreciated!

MacBook Pro 15 retina 2012 with bad NV graphics

I have MacBook MacBook Pro 15 retina 2012 with bad working NV graphics.
All solutions for removing Nvidia drivers do not allow using only integrated graphics with a working sleep and a dimmer control. When removing the Nvidia drivers and using this script (https://github.com/0xbb/gpu-switch), at the start of the system, you can use the laptop fully. Adjust the backlight and sleep work. But the script does not work on macOS 10.12.4+.
Please tell me, does your program allow me to use only integrated graphics when starting my laptop without NVidia drivers?

Brightness control workaround

User @mayankk2308 pointed out in #1 that there is an app called "Brightness Slider" for macOS which is free and can be found on the App Store.
This information is valuable as it's the only workaround I found to get back brightness adjustment for the laptop display.
Maybe this issue could stay open or these informations could be integrated in the readme.

Notes:

  • make sure that the "Brightness Slider" app is not running during patching and first reboot (after reboot the brightness set itself to minimum)
  • set the brightness to maximum before patching and first reboot as "Brightness Slider" won't be able to set the brightness above the last value set.

My system:
15" Retina MacBook (mid 2012), AMD RX 580

Question on how Suppress NVIDIA GPUs works

Hi there! Love your work.

I was wondering how option 5, Suppress NVIDIA GPUs is supposed to work. I saw in the source code it turns off automatic graphic switching agc=-1 and sets the NVRAM to prefer the integrated graphics card IG_POWER_PREF="%01%00%00%00".

I have option 5 enabled and curiously (to my surprise) the NVIDIA internal dGPU is still working during playback in Final Cut Pro X.

Screen Shot 2020-05-28 at 8 42 22 AM

Screen Shot 2020-05-28 at 8 45 34 AM

My machine specs are:

  • MacBookPro9,1 (15-inch, Mid 2012)
  • Mac OS X 10.14.6 Mojave (fresh re-install)
  • NVIDIA GeForce GT 650M 1 GB
  • Final Cut Pro X 10.4.8

Can certain applications, like Final Cut, essentially bypass the setting and access the dGPU?

Brightness doesn't work on 2014 15' Macbook Pro Mojave and 3.0.1

When the AMD fix is enabled, I can't change the brightness of the internal display. The brightness slider disappers from settings, too. Uninstalling allows me to change the brightness again.

What works is disabling the backlight with ctrl+shift+power key.

This happens on macOS 10.14.1 (18B75), on a MacBookPro11,3 with PrugeNVDA (3.0.1) with a Radeon RX 580 in an Akitio Node Pro. Let me know if there's something I can do to help!

Purge via native app does not apply

A mind-boggling issue where the NVRAM power pref variable does not apply when the binary is called via a script, which in turn is called via a native macOS app. Boot args are applied fine, so the cause of this is unknown.

Discrete GPU consuming additional 10W

After installed script, the power consumption of the Macbook(10.13beta4) always increased 10-watt than no-script, I tested with Istat(software) and plug power meter(hardware).

When I uninstalled the script, it backed normal instantly.

It over and over again with install and uninstall.

Safe-boot compatible with AMD-eGPU

Both Nvidia web driver and Apple official driver are compatible with eGPU-sapphire-RX580.
In safe boot, Luxmark no display supported OpenCL cards that iGPU, nGPU, eGPU, but with DP(mdp) output signal of Macbook's nGPU and eGPU's RX580, external screen work fine, so nGPU and eGPU are both activated in safe boot.
Diff: loaded different kexts.
kext.zip

Only black screens after purged NVIDIA dGPU

I'm using a mid-2014 15 inch Macbook pro with NVIDIA dGPU:
image
My eGPU setup is HP Omen Accelerator + AMD RX 580, connected with TB3 + TB3 -> TB2 converter.

I installed purge-wrangler, and then used purge-nvda to install NVIDIA suppression. Whenever I connect to the eGPU, all my external monitors would power up but stay dark; and the system would freeze (can only move cursor)... I've tried the methods detailed on https://egpu.io/forums/mac-setup/script-enable-egpu-on-tb1-2-macs-on-macos-10-13-4/paged/1/ but had no luck (the macbook freezes after hot plugging eGPU and I am not able to log out at all 😕).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.