Using Wayland on Linux with NVIDA graphics card causes written text to flicker and lag behind

Steps to reproduce

On Wayland, using an Nvidia graphics card, open Obsidian and type text anywhere. Bug occurs with text in note titles and in the markdown editor.

Did you follow the troubleshooting guide? [Y/N]

Yes.

Expected result

Text should appear after you type and disappear after you hit backspace, and the cursor should move pretty immediately after you press the arrow keys (or HJKL in Vim mode).

Actual result

When I type, it takes a while for text to show up-- roughly, when the text cursor flashes or the mouse is moved. This also results in flickering in most places where text is edited. Editing the text in a note is way more responsive than editing the title. The title takes about a second to show what you actually typed.

Environment

SYSTEM INFO:
	Obsidian version: v1.5.12
	Installer version: v1.5.11
	Operating system: #1-NixOS SMP PREEMPT_DYNAMIC Tue Mar 26 22:22:53 UTC 2024 6.6.23
	Login status: not logged in
	Insider build toggle: off
	Live preview: on
	Base theme: adapt to system
	Community theme: none
	Snippets enabled: 0
	Restricted mode: on

RECOMMENDATIONS:
	none

Additional information

I encountered this bug when I tried using Obsidian after switching to Hyprland (which uses Wayland) from i3wm (which uses X11 and worked with Obsidian flawlessly besides screentearing). The distro I’m using is NixOS, and I am using a RTX 2060. If needed, here’s a relevant piece of my configuration.nix file (with irrelevant bits and comments in-between thrown out):

  hardware.opengl = {
    enable = true;
    driSupport = true;
    driSupport32Bit = true;
  };

  # Load nvidia driver for Xorg and Wayland
  services.xserver.videoDrivers = ["nvidia"];

  hardware.nvidia = {

    modesetting.enable = true;

    powerManagement.enable = false;

    powerManagement.finegrained = false;

    open = false;

    nvidiaSettings = true;

    package = config.boot.kernelPackages.nvidiaPackages.beta;
  };

I tried setting packages to config.boot.kernelPackages.nvidiaPackages.stable, but this didn’t work so I set it to beta. open was also set to true, but I changed it to check if it would work.

A user on r/hyprland had a similar issue that they fixed by replacing their Nvidia GPU with one from AMD. There’s also this earlier forum topic where a user seems to have the same issue, but it seems like it didn’t go anywhere and the topic closed a few weeks ago.

I’m aware of the situation with Linux, Wayland, and NVIDIA, and that you might not be able to do anything on your part about this. I’ll switch back to i3wm or hypr if it comes down to it, but I’m hoping I’ll be able to use Hyprland with Obsidian. I only switched to Linux a few months back and NixOS is my first distro. I’m eager for advice.

2 Likes

What you are describing sounds like an issue down the stack, electron or more likely wayland or the gpu driver.
You are most likely have to wait until the upstream issues are resolved.

Also, let me remind you that:

For Linux, we only accept bug reports that are reproducible with our Appimage package under Gnome or KDE.

We do not have the manpower to test/support anything else.

That’s what I suspected-- problems between NVIDIA and wayland. Some good news is coming out with NVIDIA’s treatment of Linux drivers (at least I think its good news) so maybe soon I can use Obsidian normally with my setup.

For now though I figured out that executing obsidian with the option --disable-gpu completely resolves the flickering, but of course the CPU doesn’t like rendering things and so some places like the Graph view (which is very useful for worldbuilding, by the way) are laggy.

If anything, I hope others can find this post when they’re having the same issues I had.

TLDR; run obsidian --disable-gpu and everything should be mostly fine.

There’s also an option in the Appearance settings to disable hardware acceleration.

2 Likes