Skip to content

Conversation

@bb010g
Copy link
Contributor

@bb010g bb010g commented Jan 6, 2025

This is necessary to fix nixGLIntel for at least cage on SteamOS with nixos-unstable using the overlay.

@bb010g
Copy link
Contributor Author

bb010g commented Jan 6, 2025

Test failure looks spurious.

@hweissi
Copy link

hweissi commented Jan 14, 2025

Works for me, also fixes hyprland

@johanneshorner
Copy link

johanneshorner commented Jan 27, 2025

This works for me when I override the nixGL nixpkgs with a more recent version

nixgl = {
  url = "github:johanneshorner/nixGL";
  inputs.nixpkgs.follows = "nixpkgs";
};

otherwise building fails with

ls: cannot access '/nix/store/2l4j4zp09047g61c0hw5ndw8k7lakd0c-mesa-22.1.4-drivers/lib/gbm': No such file or directory
File /nix/store/2l4j4zp09047g61c0hw5ndw8k7lakd0c-mesa-22.1.4-drivers/lib/gbm, referenced in /nix/store/kkbmn75rp8w01vcp92fpmnp0mn7zjjhq-nixGLIntel/bin/nixGLIntel does not exists.

Seems that the offending gbm files were introduced in a recent version of mesa. NixOS/nixpkgs#368379

@Notarin
Copy link

Notarin commented Feb 12, 2025

Not super educated on this, but does this fail to include a dependency?
image
EDIT: I did not fully read the previous comment, oops -_-

my7h3le added a commit to my7h3le/nixGL that referenced this pull request May 10, 2025
This fix was taken from this PR:
nix-community#190.

This fixes the GBM backend related issues when trying to start Hyprland
and some other openGL based apps.
@noar-t
Copy link

noar-t commented May 15, 2025

Is there a path forward to merge this? It solved my problems trying to run hyprland on a non-NixOS Ubuntu host?

@Shuna322
Copy link

Thanks for the patch, fixed the issue on my machine. Similar to noar-t at Ubuntu 24.04.2 LTS with Intel Arc graphics.

@skf-funzt
Copy link

skf-funzt commented Jun 6, 2025

Thank you for this patch. It fixed my issue with Chromium-based bwosers crashing on non-NixOS/generic linux installs in NixOS/nixpkgs#413500

Update:
It fixed the GPU support in Chromium and alike, but not the referenced issue itself.

@sodiboo
Copy link

sodiboo commented Jun 13, 2025

this seems to also be needed for niri to work on non-NixOS. one of my users reports that this fixes their issue. YaLTeR/niri#1780 (comment)

is there any reason it hasn't been merged? seems like a very simple change that fixes an issue affecting, as far as I can tell, probably all compositors? (cage, hyprland, niri)

@Notarin
Copy link

Notarin commented Jun 21, 2025

is there any reason it hasn't been merged?

+1, can we have someone elaborate on exactly what the blocker is here? If none, can we have this merged?

@dyfrgi
Copy link

dyfrgi commented Jul 4, 2025

It looks like nixGL may currently not have any maintainers - the last commit to it was made in April 2024. The previous maintainer transferred ownership to nix-community due to no longer having motivation to work on it. There is also a licensing issue, see #143 #174 https://github.com/orgs/nix-community/discussions/882 for more information about this.

I think if someone wanted to get this library working again, they could take up the task of getting the license fixed. Contacting all the prior contributors might also help find people who are interested in helping maintain it.

I just started a discussion over on the main nix-community discussion page about getting a maintainer for this package. https://github.com/orgs/nix-community/discussions/1884

Copy link

@dyfrgi dyfrgi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests should now pass with #201 merged, but we should re-run.

We don't have good tests to verify this, but several users manually tested this, so I think this is good to merge.

@dyfrgi
Copy link

dyfrgi commented Jul 8, 2025

Tested manually on Debian 12 with Intel and it's working as-is there. @zimbatm can you please merge this one?

@zimbatm zimbatm merged commit a8e1ce7 into nix-community:main Jul 9, 2025
1 check failed
@zimbatm
Copy link
Member

zimbatm commented Jul 9, 2025

can somebody take a look at failing CI on master?

@sodiboo
Copy link

sodiboo commented Jul 9, 2025

can somebody take a look at failing CI on master?

This snippet references a file nvidia_icd.x86_64.json which doesn't actually exist:

nixGL/nixGL.nix

Lines 132 to 138 in a8e1ce7

${
lib.optionalString (api == "Vulkan")
''export VK_ICD_FILENAMES=${nvidiaLibsOnly}/share/vulkan/icd.d/nvidia_icd.x86_64.json${
lib.optionalString enable32bits
":${nvidiaLibsOnly.lib32}/share/vulkan/icd.d/nvidia_icd.i686.json"
}"''${VK_ICD_FILENAMES:+:$VK_ICD_FILENAMES}"''
}

There's no .x86_64.json variant of that file.

dr-xr-xr-x   - /nix/store/2g3qs3ww7vj5zprl7a8908jik9rq95b4-nvidia-x11-440.82-nixGL/share/vulkan/icd.d
.r--r--r-- 212 └── nvidia_icd.json

It also references an nvidia_icd.i686.json, but i'm not sure how it looks in the i686 equivalent of the package; if i try to evaluate it, i get a null version so it's not referencing any specific version of the drivers.

There's also a comment acknowledging it probably doesn't work on i686:

nixGL/nixGL.nix

Line 115 in a8e1ce7

# TODO: 32bit version? Not tested.

Perhaps a better way to get around this issue would be to change the offending code to glob all files in ${nvidiaLibsOnly}/share/vulkan/icd.d/ to include them in that path? i'm not sure how "correct" that is as i barely understand what half of these environment variables do, and i have no NVIDIA card to test any functionality with, but it seems reasonable to me at a glance.

@ramblehead
Copy link

This PR seems to break my home-manager settings on Debian 12 with the following output:

error: builder for '/nix/store/fx4yl9rxp0swnzpygm16c4ijix3vdnag-nixGLIntel.drv' failed with exit code 255;
       last 2 log lines:
       > ls: cannot access '/nix/store/1iylw6kf8dai0m2b6iwz4jqgi5mvrn32-mesa-24.2.8-drivers/lib/gbm': No such file or directory
       > File /nix/store/1iylw6kf8dai0m2b6iwz4jqgi5mvrn32-mesa-24.2.8-drivers/lib/gbm, referenced in /nix/store/9ll4932ghd64c34d41c9hjj3bvr5f4rc-nixGLIntel/bin/nixGLIntel does not exists.
       For full logs, run 'nix log /nix/store/fx4yl9rxp0swnzpygm16c4ijix3vdnag-nixGLIntel.drv'.
error: 1 dependencies of derivation '/nix/store/1cqlvmgdkqd4mhijrwjpqhx05jjsgbcg-nixGLCombinedWrapper-Intel.drv' failed to build
error: 1 dependencies of derivation '/nix/store/mpyc3m03c4riixjk3769aib6svm3shgs-nixGLMesa.drv' failed to build
error: 1 dependencies of derivation '/nix/store/8dggmx5kbmp7laqzcyw9vhpy3zgjvn1g-home-manager-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/ghf3jrq18skcfj7n5qa03kjpnr93cygs-home-manager-generation.drv' failed to build

Reverting to previous commit fixes it.

@bb010g
Copy link
Contributor Author

bb010g commented Sep 6, 2025

@ramblehead Could you provide a minimal working example flake that reproduces that error? It might be necessary to conditionally attempt construction of the lib/gbm search path. (My current guess is that your Nixpkgs version is older, or that you've specifically got a weirder setup that results in mesa-drivers in particular being older. /nix/store/1iylw6kf8dai0m2b6iwz4jqgi5mvrn32-mesa-24.2.8-drivers matches one of the outputs of build 298401442 of job nixos:release-24.11:nixpkgs.mesa.x86_64-linux on Hydra, the latest build for that job.)

If you are on nixos-24.11, would upgrading to nixos-25.05 be a feasible solution?

@ramblehead
Copy link

@bb010g this error occurred when updating nixos-24.11 branch. I tried switching to unstable just for nixgl package and it did not work.

This is my nixgl-related config:
https://github.com/ramblehead/nix-config/blob/main/flake.nix#L221
https://github.com/ramblehead/nix-config/blob/main/hm/hosts/qt-dl1.nix#L10

I just updated my NixOS PCs to nixos-25.05 yesterday. I will try updating Debian 12 box to nixos-25.05 on Monday and report back on the results.

@ramblehead
Copy link

Switching to nixos-25.05 and back to nixGL/main resolves the issue.

Perhaps, it worth mentioning somewhere in README.md that main branch is not backward-compatible with nixos-24.11 and pointing to the latest working commit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.