dotnet / dotnet/wpf

WPF applications will prevent Nvidia Control Panel to change display modes

Open
#9,286 10 comments 2 reactions 0 assignees View on GitHub
External Non-WPF Issue Investigate
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

### Description

We have identified a recurring issue with applications developed using the WPF, which prevents the NVIDIA Control Panel from changing display modes on laptops.
Specifically, when the WPF-based application (v2rayN) is running, the NVIDIA Control Panel fails to automatically switch between integrated and dedicated GPUs.
This issue has been observed across multiple versions of the v2rayN application and various laptop models and configurations

Attempts to resolve this issue by modifying hardware acceleration settings in the WPF application have been failed.
https://github.com/2dust/v2rayN/pull/3493/files#diff-96773009aed874ddc50e8da8fb0d2a82ba83e862fb01c323de31a8e573bbadfdR203

### Reproduction Steps

1. Set the display mode of the NVIDIA control panel to automatic on the laptop;
2. Start v2rayN or other WPF software;
3. Attempt to start a game or software that can normally switch display modes on the NVIDIA control panel;
4. You will see a pop-up message in the bottom left corner saying "Unable to change display mode".
Click this message to enter the NVIDIA control panel, and a pop-up window will appear saying "Applications blocking display mode change". v2rayN will be listed in the window.
![image](https://github.com/dotnet/wpf/assets/45081750/227a7009-66e7-41e3-a7c9-62e42073c1b8)
![image](https://github.com/dotnet/wpf/assets/45081750/fa68faaf-47d9-467f-ac2f-652f8ea01b36)
![image](https://github.com/user-attachments/assets/95c20cf4-9d77-49f5-85a8-6f8cdb3971aa)

This is a minimal example of creating a WPF program without any modifications using Visual Studio
https://github.com/2dust/v2rayN/issues/5255#issuecomment-2182387585

### Expected behavior

It should not have any impact on the automatic switching feature of this display mode

### Actual behavior

See a pop-up message in the bottom left corner saying "Unable to change display mode"

### Regression?

_No response_

### Known Workarounds

_No response_

### Impact

Probably a laptop with an Nvidia graphics card and an integrated graphics card.
Although my previous laptop also had this configuration (R7 5800H, RTX 3060), but there were no relevant settings in the Nvidia Control Panel and I couldn't test them

### Configuration
- [ASUS G14 (2023)](https://github.com/microsoft/PowerToys/issues/31825)
- [ASUS TUF Gaming A17 FA707NU-HX321 2023. AMD Ryzen 7 7735HS - RTX 4050](https://github.com/QL-Win/QuickLook/issues/1450#issuecomment-2381348516)
- [Acer Predator Helios 300](https://github.com/2dust/v2rayN/issues/3695)
- [ThinkBook 16+](https://github.com/2dust/v2rayN/issues/5255)

### Other information

Related issue:
https://github.com/2dust/v2rayN/issues/5255
https://github.com/2dust/v2rayN/issues/3695
https://github.com/2dust/v2rayN/issues/2981
https://github.com/QL-Win/QuickLook/issues/1126
https://github.com/QL-Win/QuickLook/issues/1450#issuecomment-2381348516
https://github.com/microsoft/PowerToys/issues/31825
https://github.com/microsoft/PowerToys/issues/27684
https://github.com/microsoft/PowerToys/issues/14677

[Closing Blocking Programs](https://www.nvidia.com/content/Control-Panel-Help/vLatest/en-us/mergedProjects/nv3d/Closing_Blocking_Programs.htm)
[NVIDIA Advanced Optimus Overview](https://nvidia.custhelp.com/app/answers/detail/a_id/5097/)
[Steamwebhelper.exe blocking Advanced Optimus notebook display mode switch](https://nvidia.custhelp.com/app/answers/detail/a_id/5526/)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.