Skip to content

Commit fd57180

Browse files
authored
Fix pnputil to only restart NVIDIA display adapters (NVIDIA#1582)
The previous `pnputil /disable-device /class Display` command disabled and re-enabled all display devices including non-NVIDIA adapters like the QEMU VGA Graphics Adapter. This uses Get-PnpDevice to filter to only NVIDIA display adapters before cycling them.
1 parent eec6988 commit fd57180

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

ci/tools/install_gpu_driver.ps1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

@@ -72,8 +72,13 @@ function Install-Driver {
7272
Write-Output "Unknown driver mode: $driver_mode"
7373
exit 1
7474
}
75-
pnputil /disable-device /class Display
76-
pnputil /enable-device /class Display
75+
# Only restart NVIDIA display adapters, not other display devices (e.g. QEMU VGA)
76+
$nvidia_devices = Get-PnpDevice -Class Display -FriendlyName "NVIDIA*"
77+
foreach ($device in $nvidia_devices) {
78+
Write-Output "Restarting device: $($device.FriendlyName) ($($device.InstanceId))"
79+
pnputil /disable-device "$($device.InstanceId)"
80+
pnputil /enable-device "$($device.InstanceId)"
81+
}
7782
# Give it a minute to settle:
7883
Start-Sleep -Seconds 5
7984
}

0 commit comments

Comments
 (0)