[GFX1-]: unexpected remote texture size: Size(0,0) expected: Size(630,500) WebGL
Categories
(Core :: Graphics: CanvasWebGL, defect, P3)
Tracking
()
People
(Reporter: o2q2tcedsh0, Assigned: sotaro)
References
(Depends on 1 open bug)
Details
Attachments
(3 files)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/117.0
Steps to reproduce:
Debian Stable Gnome Wayland - Kernel(Sid) - 6.4.0-3-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.4.11-1 (2023-08-17) x86_64 GNU/Linu
Firefox 117(unpacked to /opt) from download-installer.cdn.mozilla.net... Firefox executed native with env MOZ_ENABLE_WAYLAND=1.
Hardware: Intel i5-10400 (UHD 630)
Got to:
https://www.wetteronline.de/wettertrend/berlin?start=8
Actual results:
This often appears in the terminal.
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_17
libva info: va_openDriver() returns 0
[GFX1-]: unexpected remote texture size: Size(0,0) expected: Size(630,500)
WebGL(0x7f718a4a5600)::LoseContext(0)
Expected results:
I think this should not appear. [GFX1-]: unexpected remote texture size: Size(0,0) expected: Size(630,500)
WebGL(0x7f718a4a5600)::LoseContext(0)
Comment 1•1 year ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Graphics' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•1 year ago
|
||
Thanks for the bug report. Could you please navigate to about:support, copy the information to your clipboard then attach it to this bug?
Sotaro, any ideas what could be causing this remote texture issue?
Assignee | ||
Comment 5•1 year ago
•
|
||
(In reply to Jamie Nicol [:jnicol] from comment #2)
Thanks for the bug report. Could you please navigate to about:support, copy the information to your clipboard then attach it to this bug?
Sotaro, any ideas what could be causing this remote texture issue?
It seemed to be a side effect of lose context, though it is not yet clear what caused the lose context.
Assignee | ||
Comment 6•1 year ago
|
||
(In reply to Maddi from comment #0)
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_17
libva info: va_openDriver() returns 0
:stransky, do you have any idea about the log?
Assignee | ||
Updated•1 year ago
|
Comment 7•1 year ago
|
||
(In reply to Sotaro Ikeda [:sotaro] from comment #6)
(In reply to Maddi from comment #0)
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_17
libva info: va_openDriver() returns 0:stransky, do you have any idea about the log?
This is not related - should be disabled in 118 (Bug 1839615).
Comment 8•1 year ago
|
||
You may run with MOZ_LOG="Dmabuf:5" env variable and see if there's any dmabuf frame buffer allocation error.
(In reply to Martin Stránský [:stransky] (ni? me) from comment #8)
You may run with MOZ_LOG="Dmabuf:5" env variable and see if there's any dmabuf frame buffer allocation error.
[Parent 8304: CanvasRenderer]: D/Dmabuf DMABufSurfaceRGBA::ImportSurfaceDescriptor() UID 2809 size 630 x 500
[Parent 8304: CanvasRenderer]: D/Dmabuf failed to get DMABuf file descriptor: Zu viele offene Dateien
[Parent 8304: CanvasRenderer]: D/Dmabuf DMABufSurfaceRGBA::ReleaseTextures() UID 2809
[Parent 8304: CanvasRenderer]: D/Dmabuf DMABufSurface::ReleaseDMABuf() UID 2809
[Child 8586: Main Thread]: D/Dmabuf DMABufDevice::IsDMABufWebGLEnabled: UseDMABuf 1 sUseWebGLDmabufBackend 1 widget_dmabuf_webgl_enabled 1
[GFX1-]: unexpected remote texture size: Size(0,0) expected: Size(630,500)
[Parent 8304: CanvasRenderer]: D/Dmabuf DMABufSurfaceRGBA::Create() UID 2811 size 630 x 500
[Parent 8304: CanvasRenderer]: D/Dmabuf Creating with modifiers
[Parent 8304: CanvasRenderer]: D/Dmabuf Success
[Parent 8304: CanvasRenderer]: D/Dmabuf DMABufSurfaceRGBA::CreateTexture() UID 2811
[Parent 8304: CanvasRenderer]: D/Dmabuf DMABufSurfaceRGBA::ReleaseTextures() UID 2807
[Parent 8304: CanvasRenderer]: D/Dmabuf DMABufSurfaceRGBA::ReleaseTextures() UID 2807
[Parent 8304: CanvasRenderer]: D/Dmabuf DMABufSurface::ReleaseDMABuf() UID 2807
[Parent 8304: CanvasRenderer]: D/Dmabuf DMABufSurfaceRGBA::Serialize() UID 2811
[Parent 8304: CanvasRenderer]: D/Dmabuf DMABufSurfaceRGBA::ImportSurfaceDescriptor() UID 2811 size 630 x 500
[Parent 8304: CanvasRenderer]: D/Dmabuf failed to get DMABuf file descriptor: Zu viele offene Dateien
Reporter | ||
Comment 10•1 year ago
|
||
Comment 11•1 year ago
|
||
Yes, so we're running out of free file descriptors.
Updated•1 year ago
|
Assignee | ||
Comment 12•1 year ago
•
|
||
Since Firefox 118, WebGL recycles DMABUF by Bug 1848171. I wonder if it might affect to the problem.
Assignee | ||
Comment 13•1 year ago
|
||
Hi Maddi, can you check if the problem happens with Firefox 118 or Firefox nightly?
Reporter | ||
Comment 14•1 year ago
|
||
(In reply to Sotaro Ikeda [:sotaro] from comment #13)
Hi Maddi, can you check if the problem happens with Firefox 118 or Firefox nightly?
This also happens with Firefox 118.0b3 and Firefox nightly(firefox-119.0a1.de.linux-x86_64.tar.bz2). The tabs crashed allways after some time.
With Firefox Nightly, the entire browser crashed and Crashreporter opened and was able to send a bug report.
Firefox Nightly crashreport
https://crash-stats.mozilla.org/report/index/6b9aa9c1-1fa5-49d5-b423-4b5620230901
Firefox Beta log:
[GFX1-]: Failed to get RenderTextureHost for extId:5041
[GFX1-]: unexpected remote texture size: Size(0,0) expected: Size(630,360)
[GFX1-]: MozFramebuffer::CreateImpl(size:Size(630,500), samples:0, depthAndStencil:false, colorTarget:0xde1, colorName:0): Incomplete: 0x0
...
[Child 8328: Main Thread]: D/Dmabuf DMABufDevice::IsDMABufWebGLEnabled: UseDMABuf 1 sUseWebGLDmabufBackend 1 widget_dmabuf_webgl_enabled 1
[Parent 7920: CanvasRenderer]: D/Dmabuf DMABufSurfaceRGBA::Create() UID 6099 size 630 x 500
[Parent 7920: CanvasRenderer]: D/Dmabuf Creating with modifiers
[Parent 7920: CanvasRenderer]: D/Dmabuf Success
[Parent 7920: CanvasRenderer]: D/Dmabuf DMABufSurfaceRGBA::CreateTexture() UID 6099
[Parent 7920: CanvasRenderer]: D/Dmabuf DMABufSurfaceRGBA::Serialize() UID 6099
[Parent 7920: CanvasRenderer]: D/Dmabuf DMABufSurfaceRGBA::ImportSurfaceDescriptor() UID 6099 size 630 x 500
[Parent 7920: CanvasRenderer]: D/Dmabuf failed to get DMABuf file descriptor: Zu viele offene Dateien
[Parent 7920: CanvasRenderer]: D/Dmabuf DMABufSurfaceRGBA::ReleaseTextures() UID 6099
[Parent 7920: CanvasRenderer]: D/Dmabuf DMABufSurface::ReleaseDMABuf() UID 6099
[Child 8478: Main Thread]: D/Dmabuf DMABufDevice::IsDMABufWebGLEnabled: UseDMABuf 1 sUseWebGLDmabufBackend 1 widget_dmabuf_webgl_enabled 1
[Parent 7920: CanvasRenderer]: D/Dmabuf DMABufSurfaceRGBA::Serialize() UID 2281
[Child 8328: Main Thread]: D/Dmabuf DMABufDevice::IsDMABufWebGLEnabled: UseDMABuf 1 sUseWebGLDmabufBackend 1 widget_dmabuf_webgl_enabled 1
[Parent 7920: CanvasRenderer]: D/Dmabuf DMABufSurfaceRGBA::Create() UID 6101 size 630 x 500
[Parent 7920: CanvasRenderer]: D/Dmabuf Creating with modifiers
[Parent 7920: CanvasRenderer]: D/Dmabuf Success
[Parent 7920: CanvasRenderer]: D/Dmabuf DMABufSurfaceRGBA::CreateTexture() UID 6101
[Parent 7920: CanvasRenderer]: D/Dmabuf DMABufSurfaceRGBA::Serialize() UID 6101
[Child 8478: Main Thread]: D/Dmabuf DMABufDevice::IsDMABufWebGLEnabled: UseDMABuf 1 sUseWebGLDmabufBackend 1 widget_dmabuf_webgl_enabled 1
[Child 8328: Main Thread]: D/Dmabuf DMABufDevice::IsDMABufWebGLEnabled: UseDMABuf 1 sUseWebGLDmabufBackend 1 widget_dmabuf_webgl_enabled 1
[Parent 7920, IPC I/O Parent] WARNING: Message needs unreceived descriptors channel:7f24d2e4bce0 message-type:11665413 header()->num_handles:1 num_fds:0 fds_i:0: file /builds/worker/checkouts/gecko/ipc/chromium/src/chrome/common/ipc_channel_posix.cc:467
Exiting due to channel error.
[Parent 7920: CanvasRenderer]: D/Dmabuf DMABufSurfaceRGBA::Create() UID 6102 size 630 x 360
[Parent 7920: CanvasRenderer]: D/Dmabuf Creating with modifiers
[Parent 7920: CanvasRenderer]: D/Dmabuf Success
[Parent 7920: CanvasRenderer]: D/Dmabuf DMABufSurfaceRGBA::CreateTexture() UID 6102
[Parent 7920: CanvasRenderer]: D/Dmabuf DMABufSurfaceRGBA::Serialize() UID 6102
[Parent 7920: CanvasRenderer]: D/Dmabuf DMABufSurfaceRGBA::ImportSurfaceDescriptor() UID 6102 size 630 x 360
[Parent 7920: CanvasRenderer]: D/Dmabuf failed to get DMABuf file descriptor: Zu viele offene Dateien
[Parent 7920: CanvasRenderer]: D/Dmabuf DMABufSurfaceRGBA::ReleaseTextures() UID 6102
Reporter | ||
Comment 15•1 year ago
|
||
With Firefox 117 Snap in Ubuntu 23.04 the memory goes from 1.5GB up to 10.5GB. Mit Fedora 38 und Firefox 117 steigt die CPU-Auslastung auf 98%. Only on this website.
Comment 16•1 year ago
|
||
Maddi, can you try to set widget.dmabuf-webgl.enabled to false at about:config, restart browser and try again?
Thanks.
Reporter | ||
Comment 17•1 year ago
|
||
With Firefox 117 Snap in Ubuntu everything is okay. No more high memory consumption with these parameters(widget.dmabuf-webgl.enabled).
In Debian Stable with Firefox 117 in /opt now all work fine. No mor crash anymore.
Firefox 117 from Fedora Repo seem now okay with these parameters.
I must correct my statement above. In Fedora Firefox 117 Flatpak has big CPU usage(98%). Mabye it is an other problem, but just only on this website.
Log:
[Parent 2: Main Thread]: D/Dmabuf DMABufDevice::Configure()
[Parent 2: Main Thread]: D/Dmabuf Loading DMABuf system library libgbm.so.1 ...
[Parent 2: Main Thread]: D/Dmabuf We're missing DRM render device!
libEGL warning: wayland-egl: could not open /dev/dri/renderD128 (Datei oder Verzeichnis nicht gefunden)
libEGL warning: failed to get driver name for fd 0
libEGL warning: MESA-LOADER: failed to retrieve device information
libEGL warning: failed to get driver name for fd 0
Comment 18•1 year ago
|
||
Thanks, looks like the issue is caused by dmabuf buffers for WebGL which are not released (or some part of them) so we're running out of free file descriptors. I can reproduce that on https://www.wetteronline.de/wettertrend/berlin?start=8 too with 117.0.
Updated•1 year ago
|
Comment 20•1 year ago
|
||
This is not related to the particular site only. I can clearly reproduce it with WebGL samples. There are such logs:
[Parent 62420: CanvasRenderer]: D/Dmabuf failed to get GL fence file descriptor: Too many open files
[Parent 62420: CanvasRenderer]: D/Dmabuf failed to get DMABuf file descriptor: Too many open files
Reproduction steps:
- Go to https://webglsamples.org/
- Open all samples together, one per tab
- cycle between opened samples by CTRL+PgUp/Down
- see page crashes (I see even whole browser crashes)
Comment 21•1 year ago
|
||
It's easier to reproduce on 144Hz monitor but I can reproduce it on 60Hz too but it takes more time. Looks like we keep the WebGL back buffers too long so frame descriptors are really exhausted. When Firefox is closed after reproduction steps from comment 20 I see lots of dmabuf buffer release.
Comment 22•1 year ago
|
||
As the dmabuf is allocated directly at GPU there's limited amount of GPU memory available. We may provide a fallback if dmabuf is exhausted.
Assignee | ||
Comment 23•1 year ago
|
||
:stransky, thank you for the information! It helps a lot!
Assignee | ||
Updated•1 year ago
|
Comment 24•1 year ago
|
||
I did more testing and it looks like a bug in WebGL code. If 1-2 tabs with WebGL samples are opened, 10 dmabuf buffers per tab is used. If another one is opened (say 3-4), dmabuf buffer num rises suddenly to 200 and for more tabs is 700-800. I'll investigate it today.
Comment 25•1 year ago
•
|
||
I use this command to list open dmabuf file descriptors:
lsof -a -p webgl_process_PID | grep "dmabuf" | wc
Comment 26•1 year ago
|
||
Okay, may found what's going on. Looks like if we hide a page with WebGL content, we still generate WebGL frames for some time but they're not processed yet. So all dmabuf buffers are hold in queue and block file descriptors infinitely as the generated queue is not released.
While plain WebGL sample uses 10 dmabuf frames for rendering as framebuffers, if it's switched from it number of dmabuf buffer is ~ 80 and it's kept until the page is shown again or closed.
So we need to release rendered frames if we don't paint them.
Moving pack to gfx and there's nothing to do n dmabuf/linux side.
Reproduction steps:
- open https://webglsamples.org/
- open aquarium test in another tab
- check number of opened dmabuf buffers by
lsof -a -p firefox_parent_PID | grep "dmabuf" | wc
you may see ~10 buffers used
- switch page back to https://webglsamples.org/, check number of buffers. You may see ~ 80 buffers opened.
Assignee | ||
Comment 27•1 year ago
|
||
The problem might be related to Bug 1851377.
Comment 29•1 year ago
|
||
Yes, it's solved now!
Description
•