Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GPU Whitelist System #2178

Merged
merged 8 commits into from
Jun 28, 2024
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
}