{"id":24641759,"url":"https://github.com/abh80/windows-gpu-management-script","last_synced_at":"2025-03-20T12:52:56.105Z","repository":{"id":187670948,"uuid":"677351500","full_name":"abh80/windows-gpu-management-script","owner":"abh80","description":"Simple scripts to manage your GPU with Power Source. Turn GPU on when plugged in and turn GPU off when on battery!","archived":false,"fork":false,"pushed_at":"2023-08-11T12:00:35.000Z","size":147,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-25T12:44:37.678Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abh80.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-11T11:01:35.000Z","updated_at":"2023-08-11T11:58:01.000Z","dependencies_parsed_at":"2023-08-11T17:39:35.734Z","dependency_job_id":null,"html_url":"https://github.com/abh80/windows-gpu-management-script","commit_stats":null,"previous_names":["abh80/windiws-gpu-management-script"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abh80%2Fwindows-gpu-management-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abh80%2Fwindows-gpu-management-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abh80%2Fwindows-gpu-management-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abh80%2Fwindows-gpu-management-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abh80","download_url":"https://codeload.github.com/abh80/windows-gpu-management-script/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244618030,"owners_count":20482315,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-25T12:44:41.940Z","updated_at":"2025-03-20T12:52:56.082Z","avatar_url":"https://github.com/abh80.png","language":"PowerShell","readme":"# windows-gpu-management-script\n\nSimple scripts to manage your GPU with Power Source. Turn GPU on when plugged in and turn GPU off when on battery!\n\nTired of gpu induced battery drain? Do this\n\n\u003e ⚠️ Tested only on Windows 10 and 11. Use at your own risk\n\n# Usage\n\n- Clone the repo or the two files named `disable_gpu.ps1` and `enable_gpu.ps1` (Both are independent of each other).\n- Launch the `Task Scheduler` program on windows. (Preinstalled on all Windows version)\n- Task Scheduler Library \u003e Create Task\n- Name is anything you want, I will name it `Plug In Script`. Enable the `Run with highest privileges option`\n\n  ![Alt text](ASSETS/image.png)\n\n- Click on the `Triggers` tab \u003e New \u003e Select `On an event`. Check the highlighted areas in the ASSETS/image below then click on `New Event Filter`\n\n  ![Alt text](ASSETS/image-2.png)\n\n- Select the `XML` tab and enable the `Edit query manually option`. Check the highlighted areas in the ASSETS/image below\n\n  ![Alt text](ASSETS/image-3.png)\n\n- Paste the following for Plug In:\n\n  ```xml\n  \u003cQueryList\u003e\n  \u003cQuery Id=\"0\" Path=\"System\"\u003e\n  \t\u003cSelect Path=\"System\"\u003e*[System[(EventID=105)]] and *[System[Provider[@Name=\"Microsoft-Windows-Kernel-Power\"]]] and *[EventData[Data[@Name=\"AcOnline\"] and (Data='true')]]\u003c/Select\u003e\n  \u003c/Query\u003e\n  \u003c/QueryList\u003e\n  ```\n\n- Click `Ok` then again `Ok` until you reach the `Create Task` window.\n- Check the ASSETS/image below for `Settings` and `Conditions` tab. This will be same for both Plugin In and Out script.\n\n  ![Alt text](ASSETS/image-4.png)\n\n  ![Alt text](ASSETS/image-5.png)\n\n- Click on `Actions` \u003e `New`.\n- In the `Program/Script` enter your powershell install location, by default it is `C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`.\n- 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).\n\n  ![Alt text](ASSETS/image-6.png)\n\n- Repeat the same for the `disable_gpu.ps1` with the changes as necessary.\n\n    Use this query for the Step 7:\n\n    ```xml\n    \u003cQueryList\u003e\n    \u003cQuery Id=\"0\" Path=\"System\"\u003e\n\t\u003cSelect Path=\"System\"\u003e*[System[(EventID=105)]] and *[System[Provider[@Name=\"Microsoft-Windows-Kernel-Power\"]]] and *[EventData[Data[@Name=\"AcOnline\"] and (Data='false')]]\u003c/Select\u003e\n    \u003c/Query\u003e\n    \u003c/QueryList\u003e\n    ```\n\n\nThank you for following this guide. If you are like me who has to save battery on a gaming laptop then this is perfect.\n\n# Credits\n\nBig 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!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabh80%2Fwindows-gpu-management-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabh80%2Fwindows-gpu-management-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabh80%2Fwindows-gpu-management-script/lists"}