brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.53k stars 2.27k forks source link

Brave 139.111 extremely laggy with hardware acceleration enabled (Nvidia) #23254

Open ahydronous opened 2 years ago

ahydronous commented 2 years ago

Description

Since the latest Brave update, my browser has been extremely laggy when scrolling an watching video. The latest Edge or Chrome do not have this issue. I am on Windows 11.

Steps to Reproduce

  1. Install Brave 139.111 or even the most recent nightly (141.33)
  2. Scroll or watch a video
  3. See heavy lag (<10 FPS performance)

Actual result:

Laggy browser

Expected result:

Smooth browser

Reproduces how often:

Always

Brave version (brave://version info)

139.111

Version/Channel Information:

Stable 139.111 and Nightly 141.33

Other Additional Information:

Miscellaneous Information:

I run an Nvidia 3070Ti with the most recent driver (512.95) Turning off 'Hardware Acceleration' fixes the extreme lag

ahydronous commented 2 years ago

This is still an issue with the latest Brave version (1.39.122)

Fooughhy commented 2 years ago

How is it possible that all of these issues with hardware acceleration keep being down-prioritized? They are triaged, tagged as priority/P5, or just downright ignored...

I would like to mention one thing, though. Because I actually got this working. Has a lot of issues with Brave specifically being slow. I had forced a 122Hz refreshrate for all applications using "RivatunerStatisticsServer". So I added a profile for "brave.exe" which essentially disabled Rivatuner for that application. I also have/had "Fast-Sync" enabled globally (so a type of V-sync) in the Nvidia Control Panel (or specifically with NvidiaProfileInspector). I think I only changed the Rivatuner setting, as I still seem to have "Fast-Sync" for brave.exe in NvidiaProfileInspector. But this has at least fixed it for me.

image

ahydronous commented 2 years ago

@Fooughhy I also have a high Hz monitor (144Hz) with Freesync (or as Nvidia calls it, 'Gsync Compatible'). Just tested setting V-sync to 'off' for Brave in Nvidia Control Panel, and setting Hardware Acceleration to 'on'. I still get janky scrolling.

Fooughhy commented 2 years ago

Just to confirm, did you restart brave in-between?

And also, do you have any other framerate-limiters enabled?

ahydronous commented 2 years ago

I have found the culprit! (I did restart Brave inbetween beforehand, but your frame-limiter question did it).

Global 'Background Application Frame Rate' is set to '60'. Setting it to unlimited fixes the problems.

It seems that, unlike Edge or Chrome, Brave reports itself as being a background application even when in focus. This seems a pretty severe bug that could impact many things @rebron.

Fooughhy commented 2 years ago

Wow, nice that you got it working! I had no idea that was the explanation for the issue though. But yeah, that explain why other browsers works fine at least! Nice man 👍

rebron commented 2 years ago

cc: @atuchin-m @iefremov

lazymonkey2 commented 2 years ago

I have a laptop with intel cpu (i7-7700HQ), nvidia (gtx 1050) and intel integrated gfx card (hd graphics 630). Not the latest hardware, but not too bad. Brave was slow on this device: the ui was slow to react to input, in particular scrolling (chrome instead was working fine). To fix the issue I had to disable hardware acceleration. Now thanks to @ahydronous I got the idea to check nvidia control panel. I have found that brave was set to use nvidia hardware, while chrome and firefox were set to use intel video card. After setting brave to use intel video card (and enabliing hardware acceleration) the ui seems now smoother. Also vivaldi and edge were set to use nvidia instead of intel card, so it seems that nvidia drivers automatically recognise both chrome and firefox, but not other browsers. I think Brave developers should contact nvidia and ask to automatically set Brave to use intel graphics on computers like mine, which have two gfx cards.

Fooughhy commented 2 years ago

@424344 I do not think this is correct. You would want to use your actual GPU for the hardware acceleration, and not the CPU. I may be wrong, but I don't think the integrated GPU is actually active when you have a dedicated GPU as well. So this seems weird. I guess you are using a CPU for hardware acceleration in this case?

To add to this, I would assume your issue was fixed because it is the combination of Nvidia GPU and Brave that causes the issue.

lazymonkey2 commented 2 years ago

I believe that I'm not using the cpu, but the gpu that intel integrated into the cpu. Also I think that both the intel and nvidia gpu are active, after all the nvidia driver let me choose which one I want to use. Having the ability to choose which gpu to use is the purpose of having two gpus on a laptop: to use less battery I'll use the intel gpu, to get more 3d performance, at the cost of increased battery usage, I'll use the nvidia gpu. Surely the internal intel gpu is not as fast as the nvidia one, but for just browsing the web I believe it is enough. Probably a web page that uses heavy 3D will be slower when run on intel gpu, but then I'll get again the slow user interface.

LubomirBednar commented 1 year ago

Hi. I have noticed the severe lagging of the browser after AMD and NVidia driver updates. I have followed the advice of disabling hardware acceleration in Brave, which fixed the issue. Then I did some digging and saw that my AMD graphics were disabled in device manager for some reason. After enabling it again, I switched the hardware acceleration back on and everything runs as smoothly as before. As to why that is, I haven't the faintest, but I'm hoping it will shed some light on the issue for the more enlightened among us.

EaglePPP commented 1 year ago

I have found the culprit! (I did restart Brave inbetween beforehand, but your frame-limiter question did it).

Global 'Background Application Frame Rate' is set to '60'. Setting it to unlimited fixes the problems.

It seems that, unlike Edge or Chrome, Brave reports itself as being a background application even when in focus. This seems a pretty severe bug that could impact many things @rebron.

Holy cow, this is the kinda solution (better than none) Ive set Background Framelimit to 20 so its laggy as hell When I turn it off, and turned on Brave Hardware acc it works (not perfectly thou) Youtube videos are still having framedrops When my two monitors play videos simultaneously not even both of thm are 1080p, they both stutters sometimes. But in general much better than before thx!

AFilthyLeaf commented 1 year ago

This is still an issue with the latest Brave version (1.39.122)

This is still an issue on 1.51.110 lol.

But just so anyone new who finds this thread knows. This is caused by Background Application Max Framerate on NVIDIA. Change the option in program settings to off and restart brave to fix it.

Wish I found your post about this, would've saved me my troubleshooting adventures. This issue has existed for almost a year now apparently.

Edit: NVIDIA appears to set exceptions for chrome.exe, msedge.exe, and firefox.exe. They didn't add smaller browsers (Brave and Vivaldi) to this exceptions list.

JeanLuX commented 1 year ago

This is still an issue with the latest Brave version (1.39.122)

This is still an issue on 1.51.110 lol.

But just so anyone new who finds this thread knows. This is caused by Background Application Max Framerate on NVIDIA. Change the option in program settings to off and restart brave to fix it.

Wish I found your post about this, would've saved me my troubleshooting adventures. This issue has existed for almost a year now apparently.

Edit: NVIDIA appears to set exceptions for chrome.exe, msedge.exe, and firefox.exe. They didn't add smaller browsers (Brave and Vivaldi) to this exceptions list.

Hello and thanks you !

I had the same problem and this option solved it. In my case it was a bit unusual in that it only happened when an external monitor was present, because in this case the dedicated graphics card (dGPU) is used instead of the integrated one (iGPU).

image

My laptop is an XMG Fusion 15, Intel Core i7-9750H, 32 GB RAM + NVIDIA GeForce 1660 Ti Mobile

deathuman commented 11 months ago

Same issue here with Version 1.58.137 only on Brave, it works fine in both Chrome and Edge. Setting "Background Application Max Frame Rate" to Off finally fixed it but having to find a github issue for a solution is not ideal.

rafalohaki commented 10 months ago

same issue here

DF-wu commented 10 months ago

same issue here with RTX 3080. Brave version: 1.59.124 Nvidia driver version: 545.84 The report of brave://gpu/

seaque commented 9 months ago

This is still an issue with the latest Brave version (1.39.122)

This is still an issue on 1.51.110 lol.

But just so anyone new who finds this thread knows. This is caused by Background Application Max Framerate on NVIDIA. Change the option in program settings to off and restart brave to fix it.

Wish I found your post about this, would've saved me my troubleshooting adventures. This issue has existed for almost a year now apparently.

Edit: NVIDIA appears to set exceptions for chrome.exe, msedge.exe, and firefox.exe. They didn't add smaller browsers (Brave and Vivaldi) to this exceptions list.

I had been having this problem on Brave, Vivaldi, LibreWolf, Opera GX for years. This was the reason I quit using these, I could only use Ungoogled Chromium and official Firefox. Can't believe it existed because of this setting, thank you.

geekyBoogiepop commented 8 months ago

I think this issue needs more attention. I have an ASUS TUF Dash F15 Laptop with Nvidia 3070 Laptop, I stopped using Brave because of this issue a year ago, but I decided to try again but the issue is still there. I recently found this thread after searching a lot, and tried to do the solution provided above, but in my case the 3d settings for Brave are greyed out and can't change anything.

However, Background Application Max Frame Rate is disabled on the Global Settings.

The weird thing is that Brave uses the Nvidia GPU automatically while Chrome and Edge do not, at least this is what I found using the Armoury Crate app that ASUS provides, but the Nvidia Control Panel reports that it should use the integrated card, which is extremely odd.

image

image Brave supposedly should use the integrated graphics.

image Brave using the Nvidia Graphics Card.

The issues I'm experiencing are:

One thing I've noticed is that when I plug the charger to my Laptop, it switches to Performance mode and all these issues disappear.

geekyBoogiepop commented 8 months ago

I finally found a fix for this issue with a Hybrid GPU Setup, I urge the Brave team to apply this solution to people using hybrid setup or at least provide a section like "Nvidia common issues" in the download page and refer to the solutions provided in this thread.

I had the program settings in Nvidia control panel greyed out, to enable them I had to switch to Ultimate mode in Armoury Crate app from ASUS (this requires a reboot and switches completely to the NVIDIA GPU), then I could change the settings with NVIDIA Control Panel, but I found that Background Application Max Frame Rate was disabled by default, so I switched back to "Standard" mode again which uses MSHybrid technology provided by Windows and the one causing the issue with Hybrid Setups because Windows decides to use the NVIDIA GPU with Brave while others Web Browsers, Windows don't use the NVIDIA graphics card by default.

ApplicationFrameHost_yoiFkp9jIo

nvcplui_3JM30OZqyD

To fix this issue you have to go to the settings app, System > Display > Graphics, add Brave to the list and choose Power Saving (which uses the intel graphics) and restart the app if you had it opened. Now I have a very smooth experience with hardware acceleration enabled in Brave.

image

If you ever decide to use the NVIDIA GPU with Brave, you should switch to "Let Windows Decide" or "High Performance" but the issues come back unless you plug in the laptop which switch enables the Nvidia Graphics Card and everything works fine.

image

I'm not sure if you can automate this on the brave installer, but a FAQ for NVIDIA Users in the download page would be useful and surely bring a ton of users back to Brave.

@rebron @atuchin-m @iefremov

mirh commented 5 months ago

https://github.com/microsoft/vscode/issues/107016#issuecomment-1879744895 and https://github.com/WaterfoxCo/Waterfox/issues/2979#issuecomment-1445175653 speculate other browsers may be working not because of some better implementation or practice, but just because they are being special pleaded by dedicated app profiles.

Does it make any difference if you rename brave's executable to msedge.exe or chrome.exe?

richardhttps commented 4 months ago

microsoft/vscode#107016 (comment) and BrowserWorks/Waterfox#2979 (comment) speculate other browsers may be working not because of some better implementation or practice, but just because they are being special pleaded by dedicated app profiles.

Does it make any difference if you rename brave's executable to msedge.exe or chrome.exe?

Renaming brave's executable to chrome.exe did the trick for me! Though I'd like to have a rather permanent solution to this issue. My dGPU is Arc and not Nvidia so I can't apply the suggested solutions above.

mirh commented 4 months ago

A quick and dumb grep showed the executable names inside igd10um32xe.dll/igd10um64xe.dll, igdgmm32/igdgmm64.dll and IntelControlLib.dll/IntelControlLib32.dll. Of course it's even dirtier this way, but just to understand if we are in the right direction you might want to try to hex edit "chrome" to some other phony name and see if that's enough to influence renamed brave.exe. Also.. Open an issue on their dev forums perhaps?

R-Delgado1203 commented 3 months ago

can confirm this is still an issue, unfortunately had my NVME with my OS on it implode last night, after re installing everything, i usually have youtube running on my second monitor while gaming on the primary, had Destiny 2 open while watching videos, the video would stutter, only thing that solved the issue was disabling hardware acceleration in Brave, no max background set in nvdia, gsync if off and im running 165hz refresh on both monitors.

geekyBoogiepop commented 3 months ago

microsoft/vscode#107016 (comment) and BrowserWorks/Waterfox#2979 (comment) speculate other browsers may be working not because of some better implementation or practice, but just because they are being special pleaded by dedicated app profiles.

Does it make any difference if you rename brave's executable to msedge.exe or chrome.exe?

I can confirm renaming brave.exe to chrome.exe FIXED all the issues. The GPU is properly selected when I run brave. I tested it on a clean Windows 11 Installation with no changes made to the Windows Power Settings. I want to add that before renaming it to chrome.exe I tried to add brave.exe to the Google Chrome profile with the NVIDIA Inspector and this DID NOT FIX the issue. Please @rebron @iefremov reconsider renaming brave.exe to chrome.exe as you did in the past and update brave as soon as possible, I've seen a lot of people not using brave because of a ton of GPU related issues because of this NVIDIA Profile bs.

I found that you already renamed brave.exe to chrome.exe in the past, why did you revert it? EDIT: My bad, it was the GPU process name that was renamed.

29113

mirh commented 3 months ago

Because it's literally mentioned and linked there? They just renamed the gpu process, perhaps they are missing another.

Separately, an additional idea to help would be to use profile inspector to check on chrome's knobs, to see which one is responsible for the magic when applied to others.

EaglePPP commented 1 month ago

microsoft/vscode#107016 (comment) and BrowserWorks/Waterfox#2979 (comment) speculate other browsers may be working not because of some better implementation or practice, but just because they are being special pleaded by dedicated app profiles. Does it make any difference if you rename brave's executable to msedge.exe or chrome.exe?

I can confirm renaming brave.exe to chrome.exe FIXED all the issues. The GPU is properly selected when I run brave. I tested it on a clean Windows 11 Installation with no changes made to the Windows Power Settings. I want to add that before renaming it to chrome.exe I tried to add brave.exe to the Google Chrome profile with the NVIDIA Inspector and this DID NOT FIX the issue. Please @rebron @iefremov reconsider renaming brave.exe to chrome.exe as you did in the past and update brave as soon as possible, I've seen a lot of people not using brave because of a ton of GPU related issues because of this NVIDIA Profile bs.

I found that you already renamed brave.exe to chrome.exe in the past, why did you revert it? EDIT: My bad, it was the GPU process name that was renamed. #29113

use the method in the issue is the correct way to solve this, instead of changing background frame rate higher.

ahydronous commented 1 month ago

@rebron @LaurenWags

I know this is not your area and I hate to keep tagging you like this occasionally, but in the past you've been angels in getting issues alerted to the proper team. This seems like a rather important one, and I imagine that with Brave's current popularity it should be possible to contact Nvidia and get brave.exe added to Nvidia their browser whitelist?

On top of that, the "workaround:disable-hw-acceleration" tag is wrong, I'm not sure if you have the rights to remove that.

iefremov commented 1 month ago

@ahydronous can you try running brave with --enable-features=ModuleFileNamePatch ?

geekyBoogiepop commented 1 month ago

@iefremov here are the reports for both, ModuleFileNamePatch argument and without it. The issue is still there, the NVIDIA GPU is automatically used when I open brave, this doesn't happen with any other Chromium browser or Firefox. about-gpu-2024-07-25T01-46-07-692Z.txt ModuleFileNamePatch-about-gpu-2024-07-25T01-44-55-405Z.txt

Tell me if I can provide you any other information, please.

geekyBoogiepop commented 1 month ago

I've been using Brave v1.68.131 for a couple of days now, and I haven't noticed this bug. Brave is using the integrated GPU. I haven't set Brave to Power Saving mode in the Windows graphics settings either. Can anyone check if the issue is fixed on their end, too?

ahydronous commented 1 month ago

@iefremov I don't have access to an Nvidia GPU atm (long story).

@geekyBoogiepop do you have Background Max Application Frame Rate set to 60?

If not, you are talking about the separate issue of a hybrid GPU setup. Perhaps it would be better to create a separate issue for that, although if it is fixed, that won't be necessary haha

geekyBoogiepop commented 1 month ago

@ahydronous False alarm. The issue happened today, again, it is not fixed, who knows what happened during the last two days.