Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abh80/windows-gpu-management-script
Simple scripts to manage your GPU with Power Source. Turn GPU on when plugged in and turn GPU off when on battery!
https://github.com/abh80/windows-gpu-management-script
Last synced: 2 days ago
JSON representation
Simple scripts to manage your GPU with Power Source. Turn GPU on when plugged in and turn GPU off when on battery!
- Host: GitHub
- URL: https://github.com/abh80/windows-gpu-management-script
- Owner: abh80
- Created: 2023-08-11T11:01:35.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-11T12:00:35.000Z (over 1 year ago)
- Last Synced: 2023-08-11T17:39:30.908Z (over 1 year ago)
- Language: PowerShell
- Size: 144 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# windows-gpu-management-script
Simple scripts to manage your GPU with Power Source. Turn GPU on when plugged in and turn GPU off when on battery!
Tired of gpu induced battery drain? Do this
> ⚠️ Tested only on Windows 10 and 11. Use at your own risk
# Usage
- Clone the repo or the two files named `disable_gpu.ps1` and `enable_gpu.ps1` (Both are independent of each other).
- Launch the `Task Scheduler` program on windows. (Preinstalled on all Windows version)
- Task Scheduler Library > Create Task
- Name is anything you want, I will name it `Plug In Script`. Enable the `Run with highest privileges option`![Alt text](ASSETS/image.png)
- Click on the `Triggers` tab > New > Select `On an event`. Check the highlighted areas in the ASSETS/image below then click on `New Event Filter`
![Alt text](ASSETS/image-2.png)
- Select the `XML` tab and enable the `Edit query manually option`. Check the highlighted areas in the ASSETS/image below
![Alt text](ASSETS/image-3.png)
- Paste the following for Plug In:
```xml
*[System[(EventID=105)]] and *[System[Provider[@Name="Microsoft-Windows-Kernel-Power"]]] and *[EventData[Data[@Name="AcOnline"] and (Data='true')]]
```- Click `Ok` then again `Ok` until you reach the `Create Task` window.
- Check the ASSETS/image below for `Settings` and `Conditions` tab. This will be same for both Plugin In and Out script.![Alt text](ASSETS/image-4.png)
![Alt text](ASSETS/image-5.png)
- Click on `Actions` > `New`.
- In the `Program/Script` enter your powershell install location, by default it is `C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe`.
- In the `Add arguments` enter `-NoProfile -ExecutionPolicy Bypass -File "/path/to/enable_gpu.ps1" -Name "NVIDIA GeForce GTX 1650 Ti"` (replace `/path/to` and `NVIDIA GeForce GTX 1650 Ti` to your needs).![Alt text](ASSETS/image-6.png)
- Repeat the same for the `disable_gpu.ps1` with the changes as necessary.
Use this query for the Step 7:
```xml
*[System[(EventID=105)]] and *[System[Provider[@Name="Microsoft-Windows-Kernel-Power"]]] and *[EventData[Data[@Name="AcOnline"] and (Data='false')]]
```Thank you for following this guide. If you are like me who has to save battery on a gaming laptop then this is perfect.
# Credits
Big shoutout to this [reddit](https://www.reddit.com/r/Surface/comments/6coxgp/how_to_run_a_task_when_plugged_into_ac_or_losing/) post for providing with events!