vscode: VSCode is sluggish and buggy on Fedora 37 with wayland + Nvidia drivers

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.74.1/Insider/Exploration (w/ newer runtime)
  • OS Version: Fedora 37
  • Additional information
item value
Processor AMD Ryzen™ 5 5600X × 12
GPU NVIDIA GeForce GTX 1660 Ti; Driver version 525.60.11
GNOME Version 43
Windowing system Wayland
OS type 64 bit
Memory 32 GB

Similar issue #134255 (closed and didn’t solve my issue) Edit: Similar Upstream issue bugs.chromium.org id=1378258

VSCode stable and insider versions are sometimes unresponsive and buggy on my system when I am using Wayland with NVIDIA drivers on Fedora OS. This happens usually when I am typing on input fields or hovering over buttons. I have tried to find a solutions to this problem like:

  • Enabling Vulkan (--enable-features=Vulkan) (doesn’t work)
  • Disabling GPU (--disable-gpu) (doesn’t work)
  • Switching temporarily to X11 (works)
  • Edit: Adding Wayland window decorations (--ozone-platform="wayland" --enable-features="WaylandWindowDecorations") (doesn’t work)
  • Edit: Disabling GPU sandbox (--disable-gpu-sandbox) (doesn’t work)

Full list of problems (What i have noticed so there might be more problems):

  • VSCode window flickers sometimes (black)
  • Buttons are not always responsive
  • Typing on input fields is buggy

Errors (code --verbose):

  • '[9130:1218/182922.095257:WARNING:bluez_dbus_manager.cc(248)] Floss manager not present, cannot set Floss enable/disable.
  • libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
  • MESA-LOADER: failed to retrieve device information
  • MESA-LOADER: failed to open nvidia-drm: /usr/lib64/dri/nvidia-drm_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib64/dri, suffix _dri)
  • failed to load driver: nvidia-drm
  • MESA-LOADER: failed to open zink: /usr/lib64/dri/zink_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib64/dri, suffix _dri)
  • failed to load driver: zink
  • MESA-LOADER: failed to open kms_swrast: /usr/lib64/dri/kms_swrast_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib64/dri, suffix _dri)
  • failed to load driver: kms_swrast
  • MESA-LOADER: failed to open swrast: /usr/lib64/dri/swrast_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib64/dri, suffix _dri)
  • failed to load swrast driver

All of those errors come on Wayland, not on X11.

Steps to Reproduce:

  1. Open VSCode 1.74.1 or VSCode Insider on Fedora 37 with Wayland/NVIDIA

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 32
  • Comments: 65 (6 by maintainers)

Most upvoted comments

Similar experience on Fedora 38, using propietary Nvidia drivers (530.41.03). Using --enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform=wayland I don’t experience unrendered frames nor flickering - and with the WaylandWindowDecorations feature the window top bar is displayed. However, bear in mind that font scaling is not being applied after applying this feature flags.

I’ve struggled with this for months on end (years? probably) with no result.

On Fedora 38, I seem to get it working finally with

code --ozone-platform=“wayland” --enable-features=“WaylandWindowDecorations”

It seems to be responsive for now and no black pop ups.

The upstream issue has been fixed in 113, can you users give the latest insiders a try https://code.visualstudio.com/insiders which is based on Chromium 114 and see if the issue persists.

unfortunately issues are still there. Black boxes instead of context menus, laggy editor, flickery highlight, and choppy scrolling. Idk. Well, the issues also came back to VSCode Stable…

I am experiencing all of the above on my Arch Linux machine with GNOME + Wayland + Nvidia. But also the writing in the editor feels laggy and slow, the scrolling is acting weird too.

I faced this problem on a fresh KDE Neon (Plasma 6.0.2) install on an AMD platform with an NVIDIA GPU (driver version: 535.161.07). I tried the latest regular code (version: 1.87.2) with various combinations of parameters and nothing fully fixed the black flickering and the jumpiness to the view port and cursor when scrolling.

All the issues went away for me by running the latest code-insider version from the Microsoft PPA (version: 1.88.0-1711043310) with the flags: --enable-features=UseOzonePlatform --ozone-platform=wayland. Like that it works flawlessly and responsively. Frankly, it’s the smoothest vscode experience I’ve had so far.

I wasn’t sure how to pass those parameters permanently to code-insiders. The ~/.config/code-flags.conf file didn’t seem to work. What I did instead was to edit the code-insiders.desktop launcher so the flags are in the arguments and to make a shell alias (in ~/.bashrc) like this:

alias code='code-insiders --enable-features=UseOzonePlatform --ozone-platform=wayland'

Only slight annoyance is that it prints the Warning: 'enable-features' is not in the list of known options, but still passed to Electron/Chromium. every time code is started from the terminal.

Based on the recent comments there is a mix of users who have the issue resolved and others still facing the issue. Can users still facing the issue, confirm that they are running the wayland backend by passing the flag --ozone-platform=wayland and also try it with latest insiders https://code.visualstudio.com/insiders, code-insiders --ozone-platform=wayland

vscode is literally unusable on Gnome/Wayland/Nvidia/Archlinux. It flickers like a disco ball.

gnome 45.0-1 code 1.84.2-1 nvidia 545.29.06-2

Upd. 1.81. Added --enable-features=UseOzonePlatform --ozone-platform=wayland flags.

I thought the flags were there all the time and not only in this update, or am I wrong?

Sorry, I’m afraid there can be misunderstanding between us. VSCode does not enable these flags by default. And did not add this for a long time.

Hmm? Those flags are known for a very long time.

Yes of course, but for some reason it worked now. Again misunderstanding ig. I meant I didn’t add these flags. Ofc VSCode had those flag for quite some time.

Can you tell me how to add these flags ? I’m new to fedora

From /usr/local/share/applications/(it might actually be /usr/share/applications/) copy code.desktop to ~/.local/share/applications/ and append these flags at the end of line which starts with Exec. Or if you’re on KDE you can just modify the entry using KDE tools.(just edit the applications menu)

The upstream issue has been fixed in 113, can you users give the latest insiders a try https://code.visualstudio.com/insiders which is based on Chromium 114 and see if the issue persists.

Yep, got the same issues, jumpy cursor, laggy scrolling, black menu bars. All under Wayland on Fedora 38 with Nvidia GTX1650, proprietary 535 akmod driver.

I have similar experiences as well on Fedora 38 with Wayland, since I installed the Nvidia drivers.

I noticed that flickering started when the window wasn’t in focus. My problem fixed with --enable-features=UseOzonePlatform --ozone-platform=wayland or at least greatly reduced. KDE Plasma 5.26.5, NVIDIA Drivers 525.85.05.

//edit after 15mins no flickers.

For anybody wondering if these issues have been fixed by the latest nvidia driver version 545, that supposedly fixes many Wayland-related issues… - no, not much has been fixed. Still laggy and unrendered frames.


Nvidia Driver Version: 545.29.02


VSCode:

Version: 1.84.1 Commit: 2b35e1e6d88f1ce073683991d1eff5284a32690f Date: 2023-11-06T12:35:31.181Z Electron: 25.9.2 ElectronBuildId: 24603566 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Linux x64 6.5.9-arch2-1

Well, Screenshot_20230822_165926 Still problems on Stable 1.81… Same btw with Insiders.

ok, i dont know how, but after install chromium package(i use it for selenium), the problem dissapeared at all. Idk how, i was using Code in Xorg, doing my work. Then I relogged in Wayland session. Opened VSCode, and the was no such issue anymore. No text highlight flickering, no choppy scrolling, no text editor lagging, no black boxes instead of context menus(i do use custom headerbar tho). I have no flags, neither in config file, nor in .desktop file. If anybody can try to reproduce, try installing chromium and chromium-common(not sure if chromedriver is necessary tho). Idk really what happened…

@istadem2077 I have installed chromium and relogged in Wayland session, but I have the same issue. What your driver version, kernel and display resolution?

image

Kernel 6.4.6, driver akmod-nvidia-535, 1920x1080 display.

image

@milden6 Fedora + Electron + Wayland + nvidia will run but in my experience it is bad enough of an experience to be unusable. This is the only combination where I have experienced this issue. Switching to X11 on Fedora works fine. I also recall turning down the display resolution (mine runs natively at 4K) mitigates this issue somewhat. I swapped out my Nvidia GPU for an AMD one and it works flawlessly. I don’t know what it is about the nvidia drivers on Fedora.

What I have tried using vscode on and did not have this problem:

  1. NixOS with Wayland + Nvidia
  2. Linux Mint running Gnome + Wayland
  3. Linux Mint with Cinnamon + X11
  4. Pop!_OS (with X11)
  5. Fedora 36,37,38 with X11
  6. M1 MacBook Pro running Asahi Fedora Remix + Wayland
  7. Virtual machines of several distributions, including Fedora.

What I have experienced this problem on:

  1. Fedora 36,37,38 with Wayland + Nvidia.

I also experience similar issues with other electron apps such as Slack, Obsidian, and Discord. No other apps have this issue. It seems like Electron + Wayland + Nvidia drivers from Fedora repositories is a bad combination; so much so that virtual machines and drivers written from scratch by the Asahi Linux team perform better than the Nvidia drivers from Fedora repositories. I will be trying this with AMD graphics in the coming days so I can find out if this is specific to Nvidia.

Most annoyances were solved for me with those commands. I had menus that were black and only when putting mouse on top of the menu items, the items became visible. Then there were laggy scrolling and also bad and very annoying lag in the file tree, for example when renaming files. Both of these issues are now gone, at least with quick testing.

The permission denied items are still in verbose log. Also, with the start parameters I also get the below warnings.

Warning: ‘ozone-platform’ is not in the list of known options, but still passed to Electron/Chromium. Warning: ‘enable-features’ is not in the list of known options, but still passed to Electron/Chromium.

Running with Fedora 38, Nvidia driver version 535.54.03 (GTX 1660 Ti).

Version: 1.79.2 Commit: 695af097c7bd098fbf017ce3ac85e09bbc5dda06 Date: 2023-06-14T08:59:55.818Z Electron: 22.5.7 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Linux x64 6.3.8-200.fc38.x86_64

There is not much we can do here given this is an issue in the runtime, you can use the Xwayland workaround mentioned in upstream to use --ozone-platform=X11

I am also not sure that is this a problem with Electron or Wayland with Nvidia drivers.

Problem still persists on F40 KDE Spin + Nvidia 550.76 + vscode 1.88.1 Followed the steps mentioned by @larspontoppidan and it worked great. Will this ever be addressed?

@nlavalle

I’m on a fresh install of Fedora 39 workstation running an Nvidia 3060 with wayland, the code-flags.conf didn’t seem to work for me, running code --ozone-platform=wayland I get a Warning: ‘ozone-platform’ is not in the list of known options, but still passed to Electron/Chromium. and see spinning but then it seems to die out, no notifications. Running code-insiders --ozone-platform=wayland returns the same message but loads code insiders and doesn’t appear to have the buggy issue.

I’m guessing you’re launching vscode from the terminal by code --ozone-platform=wayland , resulting in the warning message. You should create a file in ~/.config/code-flags.conf, and write the two lines

--enable-features=UseOzonePlatform
--OzonePlatform=wayland

into it.

Weird… After reinstalling vscode through dnf, this method no longer work for me. So for now, I just disable hardware acceleration by ctrl+shift+p preference:configure runtime arguments, and uncomment the line

“disable-hardware-acceleration”: true, The version of my vscode is 1.86.1

@nlavalle

I’m on a fresh install of Fedora 39 workstation running an Nvidia 3060 with wayland, the code-flags.conf didn’t seem to work for me, running code --ozone-platform=wayland I get a Warning: ‘ozone-platform’ is not in the list of known options, but still passed to Electron/Chromium. and see spinning but then it seems to die out, no notifications. Running code-insiders --ozone-platform=wayland returns the same message but loads code insiders and doesn’t appear to have the buggy issue.

I’m guessing you’re launching vscode from the terminal by code --ozone-platform=wayland , resulting in the warning message. You should create a file in ~/.config/code-flags.conf, and write the two lines

--enable-features=UseOzonePlatform
--OzonePlatform=wayland

into it.

Based on the recent comments there is a mix of users who have the issue resolved and others still facing the issue. Can users still facing the issue, confirm that they are running the wayland backend by passing the flag --ozone-platform=wayland and also try it with latest insiders https://code.visualstudio.com/insiders, code-insiders --ozone-platform=wayland

I’m on a fresh install of Fedora 39 workstation running an Nvidia 3060 with wayland, the code-flags.conf didn’t seem to work for me, running code --ozone-platform=wayland I get a Warning: 'ozone-platform' is not in the list of known options, but still passed to Electron/Chromium. and see spinning but then it seems to die out, no notifications. Running code-insiders --ozone-platform=wayland returns the same message but loads code insiders and doesn’t appear to have the buggy issue.

Happy to try other steps if you’d like.

Based on the recent comments there is a mix of users who have the issue resolved and others still facing the issue. Can users still facing the issue, confirm that they are running the wayland backend by passing the flag --ozone-platform=wayland and also try it with latest insiders https://code.visualstudio.com/insiders, code-insiders --ozone-platform=wayland

Yep, all I did was creating a code-flags.conf file in my .config folder with this inside (and code - oss works perfect again):

--enable-features=UseOzonePlatform
--ozone-platform=wayland

Upd. 1.81. Added --enable-features=UseOzonePlatform --ozone-platform=wayland flags. Works well, though idk if that’s update’s feature, or the fact that I’m on KDE.

Version: 1.81.1
Commit: 6c3e3dba23e8fadc360aed75ce363ba185c49794
Date: 2023-08-09T22:18:39.991Z
Electron: 22.3.18
ElectronBuildId: 22689846
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Linux x64 6.4.11-200.fc38.x86_64
[itagizade@fedora ~]$ sudo dnf list --installed | grep akmod
akmod-nvidia.x86_64                                  3:535.98-1.fc38                     @rpmfusion-nonfree-nvidia-driver
akmods.noarch                                            0.5.7-10.fc38                          @fedora    
[itagizade@fedora ~]$ cat /etc/os-release 
NAME="Fedora Linux"
VERSION="38 (Workstation Edition)"
ID=fedora
VERSION_ID=38
VERSION_CODENAME=""
PLATFORM_ID="platform:f38"
PRETTY_NAME="Fedora Linux 38 (Workstation Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:38"
DEFAULT_HOSTNAME="fedora"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f38/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=38
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=38
SUPPORT_END=2024-05-14
VARIANT="Workstation Edition"
VARIANT_ID=workstation

I have the same issue. Fedora 38, Wayland, RTX4070Ti. Driver 535.86.05. Kernel 6.4.6

I have the same configution except I use Fedora Silverblue 37, and I run vscode in a toolbox. But I have often the same problem, vscode tends to be unresponsive sometimes and the screen is flickering in black too.

Without the --enable-features=UseOzonePlatform --ozone-platform=wayland args I just have a white window. With them, everything is fine but still with the problems mentioned before.

Adding --disable-gpu-sandbox makes vscode freeze when I want to quit it with the messabe Disabling backups

I can provide logs if needed

@LukaHietala can you check if the issue persists with our exploration builds that comes with a newer runtime. Thanks!

I am seeing the same logs, that logs occurs when running an all of electron app in wayland environment, and I use Arch + Wayland and it outputs the same log but no problem at all then I think maybe VSCode is slow because of other issue

Yeah, it appears that the issue exist outside of VSCode and likely is related to Electron, which is why this issue has been labeled as an upstream issue.

I use Chromium as my primary web browser and it works just fine.