Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux 64 bits v46.0 and above : webgl2 issues not smooth #7497

Closed
onelsonic opened this issue Jun 6, 2020 · 21 comments
Closed

linux 64 bits v46.0 and above : webgl2 issues not smooth #7497

onelsonic opened this issue Jun 6, 2020 · 21 comments
Assignees

Comments

@onelsonic
Copy link

on linux 64 bits,
webGL2.0 is acting crazy on version 46.0 and above
lot of lag and short freeze every 2 other frames.

version below 46.0 are all smooth.

Just run a project with 3D webGL2.0 to see.

@onelsonic onelsonic changed the title linux v46.0 and above : webgl2 issues not fluide linux v46.0 and above : webgl2 issues not smooth Jun 6, 2020
@onelsonic onelsonic changed the title linux v46.0 and above : webgl2 issues not smooth linux 64 bits v46.0 and above : webgl2 issues not smooth Jun 6, 2020
@rogerwang
Copy link
Member

What about the Chromium browser in the same system?

@onelsonic
Copy link
Author

I just tested on chromium version 83.0.4103.61 on ubuntu 64bits and the 3D acceleration in webgl2 is running smoothly, seems like a problem with nwjs.
Could it be something similar to this here : #7281

@DimPaDev
Copy link

DimPaDev commented Jun 6, 2020

I noticed these annoying short freezes too starting from nw.js 0.46.0 with 83.0.4103.61.
Then I tried to run the same project with the latest version of electron (9.0.1) which uses 83.0.4103.94 and there is no lag or freezes, maybe a chromium update to nw.js could be helpful?

@rogerwang
Copy link
Member

@rogerwang
Copy link
Member

@onelsonic could you please provide more information? Like console log, and the content of chrome://gpu page: nw --url=chrome://gpu

@DimPaDev
Copy link

DimPaDev commented Jun 6, 2020

@rogerwang I tested the latest nightly build which now uses chromium 83.0.4103.94 but unfortunately the issue of sudden frame drops persists, I will upload a repo later or video to illustrate it better.

Note that this issue started from 0.46.0. However, since 0.45.0 a new error appeared in the console when you launch nw.js (only on linux), I don't know if these are related :

THIS : [9989:10050:0606/172328.998343:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)

Using nw.js v0.46.2-sdk

[9989:9989:0606/172328.987480:ERROR:sandbox_linux.cc(376)] InitializeSandbox() called with multiple threads in process gpu-process.

[9989:10050:0606/172328.998343:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)

[9989:10050:0606/172328.998417:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[9989:10050:0606/172328.998472:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[9989:10050:0606/172328.998546:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[9989:10050:0606/172328.998609:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)

[9989:10050:0606/172328.998671:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[9989:10050:0606/172328.998730:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[9989:10050:0606/172328.998800:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)

[9989:10050:0606/172328.998861:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[9989:10050:0606/172328.998914:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[9989:10050:0606/172328.998963:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)

[9989:10050:0606/172328.999026:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[9989:10050:0606/172328.999080:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[9989:10050:0606/172328.999134:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[9989:10050:0606/172328.999185:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)

[9989:10050:0606/172328.999239:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[9989:10050:0606/172328.999276:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[9989:10050:0606/172328.999326:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[9989:10050:0606/172328.999377:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[9989:10050:0606/172328.999420:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)

[9989:10050:0606/172328.999474:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[9989:10050:0606/172328.999550:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[9989:10050:0606/172328.999600:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[9989:10050:0606/172328.999646:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)

[9989:10050:0606/172328.999709:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[9989:10050:0606/172328.999755:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[9989:10050:0606/172328.999830:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)

[9989:10050:0606/172328.999879:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[9989:10050:0606/172328.999928:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[9989:10050:0606/172328.999978:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)

[9989:10050:0606/172329.000041:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[9989:10050:0606/172329.000090:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)

@CosmoMyzrailGorynych
Copy link

CosmoMyzrailGorynych commented Jul 31, 2020

I have frame drops on v0.46.4 as well. Fun fact: if you start profiling your page, it suddenly starts running smoothly.

https://cdn.discordapp.com/attachments/737076992498860143/738548186850918530/2020-07-31_12-05-25.mp4

Edit:

v0.45.6 works smoothly
v0.46.x and v0.47.1 have regular framedrops.

About my setup: the game is shown in an iframe and has a debugger attached to it, in another iframe. If I start profiling the game's iframe, frame drops disappear. If I start profiling in the root document, I have frame drops, but there are no signs of potential causes in the profiler's result.

I mean that this remediation while using a profiler for a game is at least suspicious.

CosmoMyzrailGorynych added a commit to ct-js/ct-js-old that referenced this issue Jul 31, 2020
@octylFractal
Copy link

Here with my 0.45 chrome://gpu report: https://gist.github.com/octylFractal/f790f0308b9ca5e901d151a017b910fd
And the 0.48 chrome://gpu report doesn't appear when I run ./nw --url=chrome://gpu under NVIDIA, unlike with 0.45, so I have no idea how to access it for a perfect match. Under my integrated graphics: https://gist.github.com/octylFractal/652b2d6a8ee4cdc9a7c9739812bfe8b0

0.45 logs this:

[564525:564525:0907/170852.375798:ERROR:component_loader.cc(169)] Failed to parse extension manifest.

0.48 logs this under NVIDIA:

[565292:565297:0907/171032.667771:ERROR:media_history_store.cc(363)] Failed to create or update the media history store.
[565292:565292:0907/171032.674564:ERROR:component_loader.cc(183)] Failed to parse extension manifest.

and this under integrated graphics:

[565837:565854:0907/171201.952160:ERROR:media_history_store.cc(363)] Failed to create or update the media history store.
[565837:565837:0907/171201.957930:ERROR:component_loader.cc(183)] Failed to parse extension manifest.
[565862:565862:0907/171202.077675:ERROR:sandbox_linux.cc(376)] InitializeSandbox() called with multiple threads in process gpu-process.

Hopefully this helps.

@onelsonic
Copy link
Author

onelsonic commented Oct 2, 2020

Webgl2.0 3D acceleration is still having an issue on linux for all versions above v0.45.6.
I just tested v0.48.3 on a fresh Ubuntu 64bits install and the same problem occurs.
While on chromium webgl 2.0 is smooth.

@rogerwang rogerwang self-assigned this Oct 3, 2020
@rogerwang
Copy link
Member

Could you provide a webgl2 demo page which has issues there? I tried this sample and it works well here without any freezes.

btw, I'm trying 0.46.0 under Ubuntu 20.4.1 in VirtualBox in macOS.

@CosmoMyzrailGorynych
Copy link

CosmoMyzrailGorynych commented Oct 6, 2020

@rogerwang but it does lag
https://cdn.discordapp.com/attachments/432424248426889216/763149633555136562/2020-10-07_09-23-34.mp4
The same happens when I load the page in the top window object.

This page slowly lags more and more, blocking renderer or layout engine (not sure, but if I resize the window, the page doesn't realign "view source" link at the bottom-right corner.)

Any other info we can provide? Maybe it is specific to hardware

Tested with nw v0.48.4:
изображение

I'm using X11; @rogerwang do you use X11, too? Or Wayland? (top-right corner -> Setting -> About, and scroll a bit down)

изображение

@chaoskagami
Copy link

chaoskagami commented Oct 13, 2020

I'm just going to pop in and say I've also encountered this on the Iris driver recently. Opening devtools and profiling fixes the issue until profiling is stopped (which makes no sense) as does downgrading to the mentioned working version (all versions after have the micro-stutters. )

Adding --force-cpu-draw seems to reduce the frequency of micro-stutters, but does not fix them. This also doesn't really seem like something you would normally want to do.

Comparing chrome://gpu reports shows absolutely no differences between the older functional version and newer versions aside from wording changes due to chromium updates.

My test case is any RPG Maker MV game. Run it using any nw not provided with the game, e.g. one in your $PATH.

@rogerwang
Copy link
Member

Comparing chrome://gpu reports shows absolutely no differences between the older functional version and newer versions aside from wording changes due to chromium updates.

Are the reports you are comparing from NW.js or the Chrome browser? Thanks.

btw, I'm still trying to find a system where I can reproduce this.

@CosmoMyzrailGorynych
Copy link

Oh no, I've found a similar issue on Windows on v0.45.6.
Now, this particular issue is only observed on Windows with WebGL games, and only on mouse move. (Moving mouse continuously completely prevents rendering.) It seems that it is a completely separate issue, but the thing is that running a profiler disables these lags, too.
I tried disabling mouse listeners (didn't help), so I'm pretty sure it is not my code.

I will provide additional testing over different versions once I'm finished with my game for a game jam :D

@onelsonic
Copy link
Author

onelsonic commented Oct 17, 2020

Hi @rogerwang here are the two reports they are native using a graphic card and from a fresh ubuntu install:
(for your test, I am not sure if the 3D acceleration is running the same from a VM)

There are some discrepancies between chrome and nwjs (last version v0.49.0) and the problem still occurs.
I can see that chrome on this system is using OpenGL 2.0
and nwjs is using OpenGL 4.2.

chrome report: chrome://gpu

nwjs report : ./nw --url=chrome://gpu

I hope this helps 👍

@CosmoMyzrailGorynych : if you use the last windows version v0.49.0 you should not see the mouse bug.

@rogerwang
Copy link
Member

rogerwang commented Oct 18, 2020

@onelsonic thanks. the report is helpful. From them I guess here is a workaround: is there any difference after adding the command line argument --use-cmd-decoder=passthrough ?

@onelsonic
Copy link
Author

tested on v0.48.3 the periodic FPS lags/hiccups remain the same even with the --use-cmd-decoder=passthrough parameter
then in both cases after a few minutes of running the 3D application everything just freeze (seems like the GPU memory is been totally filled up)
While the same WebGL2 application is running normally on both chromium and firefox ubuntu with no lags/no freeze.

@travankor
Copy link

This one affects both the ozone and x11 platform on Linux. I didn't notice this before because I wasn't testing any WebGL heavy applications. I'll see if changing flags have any effect.

rogerwang added a commit to nwjs/chromium.src that referenced this issue Oct 22, 2020
@rogerwang
Copy link
Member

This should be fixed in this build:
https://dl.nwjs.io/live-build/nw49/20201022-140828/1e6f61f30/v0.49.1/nwjs-sdk-v0.49.1-linux-x64.tar.gz

@DimPaDev
Copy link

@rogerwang Thank you, I confirm this is fixed now using the build you posted!

CosmoMyzrailGorynych added a commit to ct-js/ct-js-old that referenced this issue Oct 28, 2020
As nwjs/nw.js#7497 is now closed, issues with WebGL on Linux are gone
@onelsonic
Copy link
Author

@rogerwang thank you 👍. It's working fine again with the current version on linux, great! Many thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants