Background GPU and Virtual Display Troubleshooting
Background GPU and Virtual Display Troubleshooting
After remote use, an apparently idle Windows desktop may still have a background application waking the discrete GPU, while a Mac virtual ultrawide display remains enabled. These are separate systems and require separate evidence.
On Windows, identify background load with process-level GPU counters before changing graphics preferences. On the Mac, confirm that every RustDesk session has ended before disabling a virtual display. The following checks address each side separately.
1. GPU metrics
Task Manager engines and NVIDIA SMI device utilization, power, and P-state have different semantics. Do not add 3D, Copy, and Video Encode percentages into a device total. Short rendering activity and a 0% device sample can occur in different windows. Task Manager GPU metrics
Fix external displays, power source, MUX/hybrid mode, application windows, and monitoring polling. Align engine/device timestamps before closing a candidate. Do not simultaneously switch GPU mode, update drivers, and disable displays.
| State | Recorded observations | Supported interpretation |
|---|---|---|
| LegionZone running | 30 loops, 26 above-threshold engine records; old Mean 9.1, Peak 20.7; 11.87 W, P5 | Candidate activity, not device-wide average utilization |
| Fully exited | NONE above 1%; 7.61 W, P8 | Activity fell in that window, not strict zero on every engine |
| Preference written and app restarted | NONE above 1%; 7.61 W, P5 | No above-threshold activity, without proof of iGPU migration |
26 counts engine records; multiple engines may match one PID in a sample. It is not a 26/30 time fraction. Mean 9.1 excludes low records. Calls plus sleeps did not produce an exact 60-second span; historical tool execution took about 95 seconds. Use timestamps.
2. Collect engine data
This read-only PowerShell example writes engine samples to a new CSV. English counter paths may be localized; inspect Get-Counter -ListSet first.
$gpuSamples = Get-Counter -Counter '\GPU Engine(*)\Utilization Percentage' `
-SampleInterval 2 -MaxSamples 30 -ErrorAction Stop
$gpuRows = foreach ($sample in $gpuSamples) {
foreach ($counter in $sample.CounterSamples) {
[pscustomobject]@{
Timestamp = $sample.Timestamp.ToString('o')
Instance = $counter.InstanceName
Status = $counter.Status
Value = $counter.CookedValue
}
}
}
$gpuCsv = Join-Path $env:TEMP ('gpu-engines-' + [guid]::NewGuid().ToString('N') + '.csv')
$gpuRows | Export-Csv -LiteralPath $gpuCsv -NoTypeInformation -Encoding UTF8
$gpuCsvKeep PID, adapter LUID, physical index, and engine type. Match process path and start time: a reused PID does not identify an earlier process. Count invalid status, parsing failures, and missing samples separately rather than filling them with zero. Redact personal paths before sharing.
nvidia-smi --query-gpu=timestamp,name,pstate,power.draw,utilization.gpu --format=csv -l 2Keep unsupported fields as N/A; an empty process table is not proof of no graphics workload. NVIDIA SMI
3. Processes and GPU selection
The exit-related decrease supports investigating LegionZone. Repeat A/B/A under fixed conditions to strengthen attribution. The record restored 6 processes but did not sufficiently establish recurrence of the original load.
Do not treat GpuPreference=2; as an integrated-GPU power-saving setting. In the formal DXGI enumeration, 2 means high performance rather than minimum power; that API enum is not a complete registry-format specification. Use Windows Graphics settings to select and verify the named device. DXGI GPU preference
In the actual desktop user's Windows Graphics settings, select the current executable, record its original preference, choose power saving with the named GPU, fully restart it, and confirm its actual engine/device in Task Manager. A maintenance account's HKCU is a different user's configuration. Dedicated-only mode may make the iGPU unavailable. Test tray, sensor, and device-control functions before claiming no functional loss. Windows graphics preference workflow
Restore only that application's original option. P8 after exit and P5 after restart are distinct, even at the same power. Two readings do not establish long-term energy savings.
4. RustDesk sessions
The Mac record aimed to close a 43:18 virtual display 15 minutes after disconnection. Logs contained connection IDs, opened/closed events, and loop-exited messages. A relay transport connection or listening port does not establish active remote desktop use.
tail -n 100 "$HOME/Library/Logs/RustDesk/RustDesk_rCURRENT.log"Observe the installed version's actual format and pair it with a complete connect/disconnect cycle. “Opened” may precede authenticated desktop control. Check the installed version's supported session-query interfaces before relying on logs.
Checking only the last opened connection and its close misses earlier active sessions. Track every unclosed ID, handle rotation/restarts/missing logs, and provide an explicit override when the user manually reopens the display.
5. Idle-state tracking
Run a decision-only observer first:
Read connection events from a known boundary
Track all open connections by process lifetime and connection ID
Any unclosed connection → ACTIVE
Unresolved rotation/restart/missing log/parse failure/clock reversal → UNKNOWN
Continuous trusted observation with all sessions closed → IDLE(last_all_closed)
IDLE for 15 minutes → propose closing the target display only
UNKNOWN or ACTIVE → no display actionA known boundary matters. The last 100 lines cannot establish that older sessions ended. Initial deployment, absent connections, or corrupt logs must not default to idle. Observe a complete cycle to establish continuity, and reset certainty after restart.
| Input | Expected decision |
|---|---|
| A opens, B opens, B closes | ACTIVE: A remains |
| A and B close, trusted idle reaches 15 minutes | May propose closure |
| Missing or unreadable log | UNKNOWN |
| Close without corresponding open | UNKNOWN |
| Unresolved process restart or rotation | UNKNOWN; rebuild baseline |
| User manually reopens the display | Explicit exemption or a new idle cycle |
This state machine is a design and test model, not a deployable display-closing script. Keep the display enabled whenever session state cannot be established.
6. Disable the target display
The old connected@VirtualScreen:160 preference was specific to that object/version. Restarting all of BetterDisplay can affect other displays. Inspect the current supported integration/CLI and identify the target before a single-display trial. BetterDisplay integrations
Record physical and virtual displays, stable identity, state, and original settings. Test closure with an available recovery path; verify the physical display remains usable. Do not mark an action complete after failure. A manual reopen should override automation rather than be undone two minutes later.
Keep collection, session classification, and actions independently stoppable. Disabling actions should preserve telemetry; stop the schedule and restore the display manually when necessary. Windows graphics preferences roll back separately. Moonlight/Sunshine troubleshooting covers encoding failures at another layer.
