electron: [Bug]: error 'eglQueryDeviceAttributeXT: Bad attribute'

Preflight Checklist

Electron Version

32.0.0 & 32.0.1

Build Tool

electron-vite: 2.3.0

What operating system(s) are you using?

macOS

Operating System Version

Sonoma 14.6.1

What arch are you using?

x64

Last Known Working Electron version

31.4.0

Expected Behavior

I don’t want to encounter the error 'eglQueryDeviceAttributeXT: Bad attribute

Actual Behavior

When I started the development environment (npm run dev), the console reported the following error, and it was continuously outputting this error:

[18489:0822/130231.159571:ERROR:gl_display.cc(497)] EGL Driver message (Error) eglQueryDeviceAttribEXT: Bad attribute.
[18489:0822/130231.525693:ERROR:gl_display.cc(497)] EGL Driver message (Error) eglQueryDeviceAttribEXT: Bad attribute.
[18489:0822/130231.758610:ERROR:gl_display.cc(497)] EGL Driver message (Error) eglQueryDeviceAttribEXT: Bad attribute.
[18489:0822/130232.026468:ERROR:gl_display.cc(497)] EGL Driver message (Error) eglQueryDeviceAttribEXT: Bad attribute.
[18489:0822/130232.358755:ERROR:gl_display.cc(497)] EGL Driver message (Error) eglQueryDeviceAttribEXT: Bad attribute.
[18489:0822/130232.526215:ERROR:gl_display.cc(497)] EGL Driver message (Error) eglQueryDeviceAttribEXT: Bad attribute.
[18489:0822/130232.966085:ERROR:gl_display.cc(497)] EGL Driver message (Error) eglQueryDeviceAttribEXT: Bad attribute.

Testcase Gist URL

No response

Additional Information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 31
  • Comments: 39

Commits related to this issue

Most upvoted comments

Please reopen, still issue in electron 34.

This issue has been resolved in version 33.0.0

same issue macOS 10.15.6 electron v32.0.1 node v16.20.0

This works for me.

@ccrvlh seems the issues is from chromium project, although that info will not cause problem but annoying.

Issue still present in Electron 33.0.0 with Chromium v130.0.6723.59 on macOS 12.7.6 Monterey. Can reproduce also in Google Chrome version 130.0.6723.59:

[32323:259:1018/011918.672903:ERROR:gl_display.cc(497)] EGL Driver message (Error) eglQueryDeviceAttribEXT: Bad attribute.
Attempting to use a delegate that only supports static-sized tensors with a graph that has dynamic-sized tensors (tensor#141 is a dynamic-sized tensor).
[32323:259:1018/011919.174036:ERROR:gl_display.cc(497)] EGL Driver message (Error) eglQueryDeviceAttribEXT: Bad attribute.
[32323:259:1018/011919.672593:ERROR:gl_display.cc(497)] EGL Driver message (Error) eglQueryDeviceAttribEXT: Bad attribute.

Seems that this should be a bug filed against Chromium instead? 🤷

Here is the chrome://gpu report from Google Chrome:

about-gpu-2024-10-18T07-37-19-650Z.txt

app.commandLine.appendSwitch("disable-gpu") works for me, but not --disable-gpu on the actual Electron command line. Version 32.1.1. I did not use app.disableHardwareAcceleration() or app.commandLine.appendSwitch("disable-software-rasterizer")

It seems that this issue depends on the OS version and hardware. Some people use OpenCore to run newer macOS versions on old MacBooks, which appears to cause this problem.

Can we reopen this?

app.commandLine.appendSwitch("disable-gpu") works for me, but not --disable-gpu on the actual Electron command line. Version 32.1.1. I did not use app.disableHardwareAcceleration() or app.commandLine.appendSwitch("disable-software-rasterizer")

This works also as a temporarily fix, but depending on you application the performance will be not good.

add to main js file:

import { app, BrowserWindow, ipcMain } from 'electron';
import os from 'os';
if (os.platform() === 'darwin' && os.arch() === 'x64') {
  app.disableHardwareAcceleration();
}

same issue macOS 10.15.6 electron v32.0.1 node v16.20.0 This works for me.

Thanks for your reply! I am using app. disableHardwareAcceleration(); Then the console indeed stopped reporting errors. But is this just a temporary solution?

I’m not sure. However, I think this is a Chromium implementation detail and not a bug in Electron.