AdguardForWindows icon indicating copy to clipboard operation
AdguardForWindows copied to clipboard

AdGuard interferes with NVIDIA Advanced Optimus

Open Aydinv13 opened this issue 10 months ago • 18 comments

AdGuard version

7.17

Browser version

OS version

What filters do you have enabled?

No response

What Stealth Mode options do you have enabled?

No response

Support ticket ID

No response

Issue Details

Steps to reproduce: As reported in this issue

  1. Enable advanced optimus
  2. Make sure laptop is in integrated GPU mode
  3. Start a game
  4. Make sure laptop in discrete GPU mode and some game is running
  5. Exit a game

Actual Behavior

Windows shows notification from Nvidia control panel telling it is unable to switch GPU mode

Expected Behavior

Laptop change GPU mode

Screenshots

Screenshot: image

Additional Information

No response

Aydinv13 avatar Apr 22 '24 14:04 Aydinv13

А вот и я

notaleksiej avatar Apr 22 '24 16:04 notaleksiej

@Aydinv13 ZD 895994, direct contact.

ihurin avatar Apr 22 '24 16:04 ihurin

Having the same issue. A few things I can note:

  • Forcing Adguard to use the iGPU (via System > Display > Graphics), as was recommended in the previous (now closed) issue regarding this, does not fix the issue.
  • The issue only happens when returning to "Optimus" mode from "Nvidia GPU only" mode, not switching to "Nvidia GPU only" mode.
  • If there were a way for the browser extension to automatically run if the "service" were running (instead of the full WPF desktop app), it would be a viable workaround for most cases, as the service doesn't interfere with Advanced Optimus. As it stands, it is possible to workaround, but you have to either (a) disable AdGuard on startup, but manually re-enable the browser extension each time you start the browser, or (b) enable AdGuard on startup, but manually click "Close AdGuard, but continue filtering" in the system tray every time you start the computer - neither of these are ideal.

For added context - this is "Advanced" Optimus, so it is more akin to automatically toggling a MUX switch (which allows the dGPU to directly send frames to the screen), rather than traditional Optimus (where, when active, the dGPU sends frames "through" the iGPU).

This is basically handled via virtual displays in the system - in essence, the same display is considered under-the-hood to be 2 displays, one coming from the iGPU and one coming from the dGPU, and Advanced Optimus switches between them when launching games.

Velgus avatar May 20 '24 18:05 Velgus

@Velgus @notaleksiej @koguroff could you please check if the issue is gone with this build? @ihurin @cryptopatik222 @PavelParkhomenko please advise the build to anyone affected.

Here is the instruction:

  1. Install the build
  2. Go to Settings -> General Settings -> Advanced Settings and search for Use software rendering then turn it on
  3. Save the settings
  4. Restart AdGuard app
  5. Enable Advanced Optimus

Aydinv13 avatar Jun 14 '24 14:06 Aydinv13

Oddly, software rendering seems to have made the issue even worse. When enabled, it also throws the error when "enabling" the "NVIDIA GPU only" mode (not just disabling it, like before). So games will launch with the iGPU in use instead of switching to the dGPU.

I tested twice (verifying the settings change and restarting AdGuard) to make sure.

Velgus avatar Jun 14 '24 18:06 Velgus

@Velgus could you collect the debug logs then:

Instruction
  1. Collect the debug log as it's explained here.
  2. Remember the exact time when the issue was reproduced. We will need it to find the corresponding records in the log file.
  3. Send the archive to [email protected] and mention this issue number in the subject.

Also could you check if it persists in case you run AdGuard VPN along with AdGuard app

Aydinv13 avatar Jun 14 '24 19:06 Aydinv13

I am reproducing and will send it. I do not use AdGuard VPN.

Velgus avatar Jun 14 '24 19:06 Velgus

@Velgus @notaleksiej @koguroff could you please check if the issue is gone with this build?

@ihurin @cryptopatik222 @PavelParkhomenko please advise the build to anyone affected.

Here is the instruction:

  1. Install the build

  2. Go to Settings -> General Settings -> Advanced Settings and search for Use software rendering then turn it on

  3. Save the settings

  4. Restart AdGuard app

  5. Enable Advanced Optimus

No, the issue remains

notaleksiej avatar Jun 15 '24 09:06 notaleksiej

I've sent the logs

notaleksiej avatar Jun 15 '24 09:06 notaleksiej

@Velgus @notaleksiej @koguroff please, check out this build. We forced the software rendering in it. https://uploads.adguard.org/AdGuard-v7.18.4760.15.exe

northis avatar Jun 17 '24 11:06 northis

@Velgus @notaleksiej @koguroff please, check out this build. We forced the software rendering in it. https://uploads.adguard.org/AdGuard-v7.18.4760.15.exe

Nope, still doesn't work, I am sending the logs

notaleksiej avatar Jun 17 '24 15:06 notaleksiej

image

notaleksiej avatar Jun 17 '24 15:06 notaleksiej

@Velgus @notaleksiej

For the AdGuard Ad blocker, we are planning to switch to a new GUI engine, so it would be helpful if you could check how AdGuard VPN will behave with NVIDIA Optimus, since AdGuard VPN already has this new engine in it.

Aydinv13 avatar Jun 24 '24 10:06 Aydinv13

@Velgus @notaleksiej to help us resolve this issue, you can run our Advanced Uninstaller from here https://cdn.adtidy.org/distr/windows/Uninstall_Utility.zip (it described in our knowledge base). Just run Adguard.UninstallUtility.exe file and check if it blocks the display mode. This utility is written in WPF, just like AdGuard itself.

northis avatar Jun 24 '24 14:06 northis

@Velgus

or (b) enable AdGuard on startup, but manually click "Close AdGuard, but continue filtering" in the system tray every time you start the computer - neither of these are ideal.

As a workaround, you can check Enable filtering at system start-up in Advanced Settings and disable autorun for the UI.

northis avatar Jun 25 '24 15:06 northis

Just run Adguard.UninstallUtility.exe file and check if it blocks the display mode. This utility is written in WPF, just like AdGuard itself.

The Uninstaller being open did not cause issues enabling "Nvidia GPU only" mode, but did cause issues going back to Optimus (integrated graphics) - same as the AdGuard app. So the same as the original issue - pre-"software rendering" option.

As a workaround, you can check Enable filtering at system start-up in Advanced Settings and disable autorun for the UI.

I tried this, but it does not seem to automatically enable the Web Browser extension when enabled, so it's still "not ideal" in the ways I mentioned in this post. It's a minor issue, but still, it would be nice if having that setting enabled meant that, when opening the web browser, it would default the extension to being enabled, so you don't have to toggle it on every time.

Velgus avatar Jun 28 '24 20:06 Velgus

Unfortunately, this is really a WPF-related issue: https://developercommunity.visualstudio.com/t/wpf-prevent-NVDIA-Dynamic-Display-Switch/10687376. We can hope Microsoft will offer a solution for this.

I tried this, but it does not seem to automatically enable the Web Browser extension when enabled

AdGuard Assistant starts as you run the browser. You can examine its status by clicking on its icon

northis avatar Jul 01 '24 11:07 northis

AdGuard Assistant starts as you run the browser. You can examine its status by clicking on its icon

This is not the case. Restarting the computer with that setting enabled, and opening the web browser, defaults to AdGuard Assistant being disabled.

Velgus avatar Jul 02 '24 22:07 Velgus