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:
- 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)
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 theWaylandWindowDecorations
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.
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 thecode-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
From
/usr/local/share/applications/
(it might actually be/usr/share/applications/
) copycode.desktop
to~/.local/share/applications/
and append these flags at the end of line which starts withExec
. 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,
Still problems on Stable 1.81… Same btw with Insiders.
Kernel 6.4.6, driver akmod-nvidia-535, 1920x1080 display.
@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:
What I have experienced this problem on:
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?
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@nlavalle
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 linesinto it.
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 aWarning: '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. Runningcode-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.
Yep, all I did was creating a
code-flags.conf
file in my .config folder with this inside (and code - oss works perfect again):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.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 backupsI can provide logs if needed
@LukaHietala can you check if the issue persists with our exploration builds that comes with a newer runtime. Thanks!
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.