Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modrinth doesn't launch on unstable channel #359820

Open
JonasFranke opened this issue Nov 28, 2024 · 11 comments
Open

Modrinth doesn't launch on unstable channel #359820

JonasFranke opened this issue Nov 28, 2024 · 11 comments
Labels
0.kind: bug Something is broken

Comments

@JonasFranke
Copy link

Describe the bug

The modrinth-app package does not launch when being on unstable channel

Steps To Reproduce

Steps to reproduce the behavior:

  1. add modrinth-app (or modrinth-app-unwrapped) to nixpkgs (unstable)
  2. run nixos-rebuild
  3. try to start modrinth

Expected behavior

Modrinth starts as expected

Screenshots

Additional context

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.63, NixOS, 24.05 (Uakari), 24.05.6818.6f6076c37180`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.8`
 - channels(root): `"home-manager-24.05.tar.gz, nixos-24.05, nixos-unstable"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Notify maintainers

@getchoo


Note for maintainers: Please tag this issue in your PR.


Add a 👍 reaction to issues you find important.

@JonasFranke JonasFranke added the 0.kind: bug Something is broken label Nov 28, 2024
@getchoo
Copy link
Member

getchoo commented Nov 28, 2024

Do you have a NVIDIA card? There are a lot of known bugs with webkitgtk and the drivers currently, including just segfaulting on launch

@JonasFranke
Copy link
Author

Do you have a NVIDIA card? There are a lot of known bugs with webkitgtk and the drivers currently, including just segfaulting on launch

yep, is there a workaround? By e.g. using the integrated graphics?

@getchoo
Copy link
Member

getchoo commented Nov 28, 2024

Integrated graphics is one solution (as Mesa shouldn't be affected by this), but you may also be able to set WEBKIT_DISABLE_DMABUF_RENDERER=1 and/or WEBKIT_DISABLE_COMPOSITING_MODE=1 to fix it. See tauri-apps/tauri#9394 and tauri-apps/tauri#9304 as well

@youwen5
Copy link
Member

youwen5 commented Dec 11, 2024

$ ModrinthApp
fish: Job 1, 'ModrinthApp' terminated by signal SIGSEGV (Address boundary error)

I get the above whenever I try to launch Modrinth. None of the environment variables seem to do anything. Any idea if this could be nixpkgs related, or should I open an issue in Modrinth?

@getchoo
Copy link
Member

getchoo commented Dec 11, 2024

Any idea if this could be nixpkgs related, or should I open an issue in Modrinth?

This is more likely to be a webkitgtk & NVIDIA issue rather than either us or Modrinth. It happens across all Tauri apps

@youwen5
Copy link
Member

youwen5 commented Dec 11, 2024

Any idea if this could be nixpkgs related, or should I open an issue in Modrinth?

This is more likely to be a webkitgtk & NVIDIA issue rather than either us or Modrinth. It happens across all Tauri apps

Weird, cause I do Tauri development on my local machine and I'm able to compile and run using both a Nix derivation and Cargo directly. I will investigate webkitgtk further, I guess.

@getchoo
Copy link
Member

getchoo commented Dec 12, 2024

You'll probably want to see the upstream (Tauri) issues above. They in turn link to most of the webkitgtk bug reports

@CrazyWolf13
Copy link

CrazyWolf13 commented Jan 10, 2025

Hi
I can confirm this behaviour, I get this error:

2025-01-10T21:56:15.449730028+01:00  INFO theseus_gui: Initialized tracing subscriber. Loading Modrinth App!
2025-01-10T21:56:15.453688323+01:00  INFO theseus_gui: Initializing app...

Issue happens since I switched from default nixos to the proprietary nvidia drivers.

I've set:

	environment.sessionVariables = {
		"WEBKIT_DISABLE_DMABUF_RENDERER" = "1";
		"WEBKIT_DISABLE_COMPOSITING_MODE" = "1";
	};

And I'm also on wayland, though this did not fix anything, anything else I coud try?

The other things mentioned in the linked tauri issues either don't seem to apply to me or also don't fix the issue.

EDIT:
I finally found a fix on an older reddit thread:

adding GDK_BACKEND=x11 makes it work again.
(NixOS Wayland Gnome)

@CrazyWolf13
Copy link

@getchoo
Is there any good way on adding this to my nixos config? Or even directly to the packagebuild?

Applying GDK_Backend=x11 globally to my whole system is not really something that seems like a good idea to me.

@getchoo
Copy link
Member

getchoo commented Jan 20, 2025

Not tested, but I believe something like this should work

{ pkgs, ... }:

{
  environment.systemPackages = [
    (pkgs.modrinth-app.overrideAttrs (oldAttrs: {
      buildCommand =
        ''
          gappsWrapperArgs+=(
             --set GDK_BACKEND x11
             --set OTHER_ENVVAR VALUE
          )
        ''
        + oldAttrs.buildCommand;
    }))
  ];
}

(with OTHER_ENVVAR and VALUE being placeholders for anything else you may want to set)

@CrazyWolf13
Copy link

Thank you soooo much!
This snippet worked for me:

	environment.systemPackages =  
	with pkgs; [
		(modrinth-app.overrideAttrs (oldAttrs: {
			buildCommand = 
				''
					gappsWrapperArgs+=(
						--set GDK_BACKEND x11
						--set WEBKIT_DISABLE_DMABUF_RENDERER 1
					)
				''
				+ oldAttrs.buildCommand;
		}))

	];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

4 participants