electron: [Bug]: GetVSyncParametersIfAvailable() failed for 1 times!

Preflight Checklist

Electron Version

17.0.0

What operating system are you using?

Other Linux

Operating System Version

Debian GNU/Linux 11 (bullseye)

What arch are you using?

x64

Last Known Working Electron version

16.0.8

Expected Behavior

The command npm start runs electron smoothly without any errors.

Actual Behavior

The command logs out this:

> dinobrowse@1.0.0 start
> electron .

[20676:0204/182046.077429:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[20676:0204/182047.144782:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
[20676:0204/182047.158435:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!

Testcase Gist URL

https://gist.github.com/1787a7f55987914d30b12cc0e4956b7b

Additional Information

No response

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 65
  • Comments: 68 (7 by maintainers)

Most upvoted comments

I am still having this issue on Ubuntu 22. Gives me this error 3 times but the app can run as normal.

Hi I had same problem. after some digging I found that electron uses GPU acceleration by default, in some system it may cause this response. To solve this problem use following code in your main.js file to disable this default electron logic:

app.disableHardwareAcceleration();

It’s obvious a lot of people are still having this issue. To avoid diluting the thread and annoying the Electron maintainers, let’s focus on just upvoting comments rather than adding a bunch of comments saying the same thing. If anyone has pull with the Chromium team, seems like this needs to be addressed by them.

Fwiw, I’m still having this issue with a custom Electron app on Ubuntu Linux.

Running Electron v32.1.2, Ubuntu 22.04.5, I get:

[852348:1122/104316.300464:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[852348:1122/104316.304056:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
[852348:1122/104316.315455:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!

on every single launch of the app.

I’m having the same issue on Ubuntu 22.04

I am still having this issue on Ubuntu 22. Gives me this error 3 times and then shuts down the app. Also it seems like the desktopCapturer function is not working properly

just add this code in bellow your main.js file app.commandLine.appendSwitch(‘ignore-gpu-blacklist’); app.commandLine.appendSwitch(‘disable-gpu’); app.commandLine.appendSwitch(‘disable-gpu-compositing’);

It’s obvious a lot of people are still having this issue. To avoid diluting the thread and annoying the Electron maintainers, let’s focus on just upvoting comments rather than adding a bunch of comments saying the same thing. If anyone has pull with the Chromium team, seems like this needs to be addressed by them.

app.disableHardwareAcceleration();

just add this code in bellow your main.js file app.commandLine.appendSwitch(‘ignore-gpu-blacklist’); app.commandLine.appendSwitch(‘disable-gpu’); app.commandLine.appendSwitch(‘disable-gpu-compositing’);

app.commandLine.appendSwitch('ignore-gpu-blacklist');
app.commandLine.appendSwitch('disable-gpu');
app.commandLine.appendSwitch('disable-gpu-compositing');
app.disableHardwareAcceleration()

This solved it for me, I’m using Arch 😄

I am experiencing the same Issue with: KDE+Wayland on arch linux

I am still having this issue on manjaro. Node 20.4.0 electron 22.3.18

Rebooting my machine fixed this error. on Ubuntu 24 with VSCode.

Same problem on Ubuntu 24.04 beta. gnome-shell 46 and Wayland.

Same issue, different version of Node

[316311:1212/221702.543191:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[316311:1212/221704.916150:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
[316311:1212/221711.076161:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!

Fedora: 39 - Gnome 45 Node: v20.9.0 Chromium 120.0.6099.56 / Electron 28.0.0

Yaps, you can disable hardware acceleration to. Put this code app.disableHardwareAcceleration()

Look the documentation in below. I found this problem on ubuntu.

https://www.electronjs.org/docs/latest/tutorial/offscreen-rendering

sorry for the late reply.I nuked my os with just a simple mistake sudo rm -r /* instead or sudo rm -r ./* but to my suprise after resinstalling my arch linux everything works fine even vscode and min browser

This issue also occurs with KDE with Wayland on arch linux

[19288:0215/030558.960614:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[19288:0215/030601.607436:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
[19288:0215/030601.618438:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!

Same issue, Arch Linux :

  • Node v20.11.0
  • Electron 28.2.3
  • GNOME 45.4 - Wayland

app.disableHardwareAcceleration()

Disabling Hardware Acceleration seem to fix the issue.

Safe to ignore the error ?

I can confirm I am also experiencing this issue.

[134496:1211/215508.844643:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[134496:1211/215513.879458:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
[134496:1211/215521.917993:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!

Fedora 39 - Gnome 45 Node 20.4.0 Electron versions 27.1.3 and 28.0.0

The app appears to function correctly, no white screen appearing as yet, but will update if this happens.

Fedora 38 | Gnome Wayland

VS Code from Snap Store

Version: 1.78.2 Commit: b3e4e68a0bc097f0ae7907b217c1119af9e03435 Date: 2023-05-10T14:47:05.613Z Electron: 22.5.2 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Linux x64 6.2.15-300.fc38.x86_64 snap Sandboxed: No

npm run dev in my app


[22564:0514/135424.421988:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!

[22564:0514/135424.426911:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!

[22564:0514/135427.561441:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!

My app works fine despite the errors.

Happening with me on chrome, chromium and vscode

OS: Arch Linux x86_64

Kernel: 6.2.9-arch1-1

Vscode

[73190:0409/212507.583785:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[73190:0409/212507.584567:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
[main 2023-04-09T15:55:08.572Z] update#checkForUpdates, state =  idle
[main 2023-04-09T15:55:08.572Z] update#setState checking for updates
[main 2023-04-09T15:55:08.572Z] resolveShellEnv(): skipped (VSCODE_CLI is set)
[main 2023-04-09T15:55:08.662Z] update#setState idle
[73154:0409/212538.996431:INFO:CONSOLE(620)] "%cTRACE color: #888 InteractiveSessionService#onWillSaveState: Persisting 0 sessions", source: vscode-file://vscode-app/opt/visual-studio-code/resources/app/out/vs/workbench/workbench.desktop.main.js (620)
[73154:0409/212557.191371:INFO:CONSOLE(1997)] "[[object Object]]s.tmpDir is not a function", source: vscode-file://vscode-app/opt/visual-studio-code/resources/app/out/vs/workbench/workbench.desktop.main.js (1997)
[73154:0409/212557.191405:INFO:CONSOLE(1997)] "TypeError: s.tmpDir is not a function
    at e._sendFirstFileOnDisk (/home/shaquibimdad/.vscode/extensions/msjsdiag.vscode-react-native-1.10.2/dist/rn-extension.js:1:25358)
    at Timeout._onTimeout (/home/shaquibimdad/.vscode/extensions/msjsdiag.vscode-react-native-1.10.2/dist/rn-extension.js:1:24162)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)", source: vscode-file://vscode-app/opt/visual-studio-code/resources/app/out/vs/workbench/workbench.desktop.main.js (1997)
[73154:0409/212639.018297:INFO:CONSOLE(620)] "%cTRACE color: #888 InteractiveSessionService#onWillSaveState: Persisting 0 sessions", source: vscode-file://vscode-app/opt/visual-studio-code/resources/app/out/vs/workbench/workbench.desktop.main.js (620)
[73154:0409/212739.040553:INFO:CONSOLE(620)] "%cTRACE color: #888 InteractiveSessionService#onWillSaveState: Persisting 0 sessions", source: vscode-file://vscode-app/opt/visual-studio-code/resources/app/out/vs/workbench/workbench.desktop.main.js (620)
[73190:0409/212814.705837:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!

Chrome

Log Messages
[1959:1959:0409/140204.192071:WARNING:sandbox_linux.cc(393)] : InitializeSandbox() called with multiple threads in process gpu-process.
[1959:1959:0409/140212.895308:ERROR:gl_surface_presentation_helper.cc(260)] : GetVSyncParametersIfAvailable() failed for 1 times!
[1959:1959:0409/140212.907863:ERROR:gl_surface_presentation_helper.cc(260)] : GetVSyncParametersIfAvailable() failed for 2 times!
[1959:1959:0409/140216.809130:ERROR:gl_surface_presentation_helper.cc(260)] : GetVSyncParametersIfAvailable() failed for 3 times!

Update from my end: My views were simply not updated, because unlike on MacOS, window.on('show',... wouldn’t be called on Linux for some reason. Bounds don’t need to be adjusted in that event anyways, so things load now.

I can clearly tell it uses X with xwayland under Wayland, unless I do app.commandLine.appendSwitch("ozone-platform", "wayland") which breaks rendering as described here.

Updated Chromium bug link: https://issues.chromium.org/issues/40246239

Seems like they closed it as stale, not sure if anyone here has enough sway to reopen it or prioritize it with them?

Any one knows how to disableHardwareAcceleration?

[28615:0106/152709.150872:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[28615:0106/152714.154981:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
[28615:0106/152715.385988:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!

Same problem with Fedora 39 node v20.9.0 electron 26.6.2 GNOME 45.2 Wayland

Same? issue with Obsidian after upgrading electron from 25.9.8 to 28.1.0 version:

2024-01-04 14:19:31 Loading main app package /usr/lib/obsidian/obsidian.asar
Updates disabled.
[16055:0104/171931.839009:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[16055:0104/171932.108530:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
[16055:0104/171932.123955:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!

After this electron upgrade, Obsidian renders empty window and is unusable, downgrade fixed the issue. However, after the downgrade these error messages remain, Obsidian is working. Artix Linux, i3 Node: v21.5.0 Obsidian: v1.5.3

I’m experiencing this issue while running latest version of electron.

I have Fedora 39 workstation , electron version 28.0.0

[8108:1211/084630.301820:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[8108:1211/084634.650710:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
[8108:1211/084646.123532:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!