Skip to content

Commit

Permalink
Update GPU Whitelist System (#2178)
Browse files Browse the repository at this point in the history
* Compile Winutil

* Update Invoke-WinUtilGPU.ps1

* Re-Formate 'Invoke-WinUtilGPU.ps1' Private Function to be Shorter

* Refactor @blueswills changes

* Change Date to allow for easy merge

---------

Co-authored-by: Marterich <[email protected]>
Co-authored-by: Mr.k <[email protected]>
Co-authored-by: Martin Wiethan <[email protected]>
  • Loading branch information
4 people authored Jun 28, 2024
1 parent 9274c68 commit 5b36925
Showing 1 changed file with 14 additions and 22 deletions.
36 changes: 14 additions & 22 deletions functions/private/Invoke-WinUtilGPU.ps1
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
function Invoke-WinUtilGPU {
$gpuInfo = Get-CimInstance Win32_VideoController

foreach ($gpu in $gpuInfo) {
$gpuName = $gpu.Name
if ($gpuName -like "*NVIDIA*") {
return $true # NVIDIA GPU found
}
}

# GPUs to blacklist from using Demanding Theming
$lowPowerGPUs = (
"*NVIDIA GeForce*M*",
"*NVIDIA GeForce*Laptop*",
"*NVIDIA GeForce*GT*",
"*AMD Radeon(TM)*",
"*UHD*"
)

foreach ($gpu in $gpuInfo) {
$gpuName = $gpu.Name
if ($gpuName -like "*AMD Radeon RX*") {
return $true # AMD GPU Found
}
}
foreach ($gpu in $gpuInfo) {
$gpuName = $gpu.Name
if ($gpuName -like "*UHD*") {
return $false # Intel Intergrated GPU Found
}
}
foreach ($gpu in $gpuInfo) {
$gpuName = $gpu.Name
if ($gpuName -like "*AMD Radeon(TM)*") {
return $false # AMD Intergrated GPU Found
foreach ($gpuPattern in $lowPowerGPUs){
if ($gpu.Name -like $gpuPattern) {
return $false
}
}
}
return $true
}

0 comments on commit 5b36925

Please sign in to comment.