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

NixGL-like wrapper for Nix on Ubuntu? #163

Open
hacker1024 opened this issue Nov 28, 2023 · 1 comment
Open

NixGL-like wrapper for Nix on Ubuntu? #163

hacker1024 opened this issue Nov 28, 2023 · 1 comment

Comments

@hacker1024
Copy link

The packages in this repository are also quite useful on NVIDIA's Ubuntu distribution. OpenGL and Vulkan applications, however, do not work out of the box. Instead, a wrapper like NixGL needs to be made.

I have attempted to make such a wrapper. It works for OpenGL applications, but when testing Vulkan with vkcube, I get a segmentation fault. Has anyone got Vulkan working?

{ lib
, writeShellApplication
, jetpack
, libglvnd
, vulkan-validation-layers
}:

writeShellApplication {
  name = "jetson-gl";
  text = ''
    export LD_LIBRARY_PATH="${lib.makeLibraryPath (with jetpack; [ libglvnd l4t-3d-core vulkan-validation-layers ])}''${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
    export __EGL_VENDOR_LIBRARY_DIRS="${jetpack.l4t-3d-core}/share/glvnd/egl_vendor.d''${__EGL_VENDOR_LIBRARY_DIRS:+:$__EGL_VENDOR_LIBRARY_DIRS}"
    export VK_LAYER_PATH='${vulkan-validation-layers}/share/vulkan/explicit_layer.d'
    export VK_ICD_FILENAMES="${jetpack.l4t-3d-core}/share/vulkan/icd.d/nvidia_icd.json''${VK_ICD_FILENAMES:+:$VK_ICD_FILENAMES}"
    exec "$@"
  '';
}
@SomeoneSerge
Copy link

SomeoneSerge commented Dec 11, 2023

Note that NixGL is attempting something pretty complex: it's trying to find in nixpkgs the userspace drivers that are compatible with the currently running kernel. OTOH, https://github.com/numtide/nix-gl-host just locates the host system's userspace drivers.

Note also for certain applications (CUDA) neither is really sufficient and instead/in addition we need something like NixOS/nixpkgs#267247. CC #160

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

No branches or pull requests

2 participants