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

Use driverLink where possible #192

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ in
# l4t-core provides - among others - libnvrm_gpu.so and libnvrm_mem.so.
# The l4t-core/lib directory is directly set in the DT_RUNPATH of
# l4t-cuda's libcuda.so, thus the standard driver doesn't need them to be
# added in /run/opengl-driver.
# added in ${driverLink}.
#
# However, this isn't the case for cuda_compat's driver currently, which
# is why we're including this derivation in extraPackages.
Expand Down Expand Up @@ -269,6 +269,7 @@ in
};

# Used by libEGL_nvidia.so.0
environment.etc."egl/egl_external_platform.d".source = "/run/opengl-driver/share/egl/egl_external_platform.d/";
environment.etc."egl/egl_external_platform.d".source =
"${pkgs.addOpenGLRunpath.driverLink}/share/egl/egl_external_platform.d/";
};
}
5 changes: 3 additions & 2 deletions pkgs/l4t/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ stdenv
, stdenvNoCC
, addOpenGLRunpath
, lib
, fetchurl
, fetchpatch
Expand Down Expand Up @@ -94,15 +95,15 @@ let
# l4t-core. Unfortunately, calling dlopen from libnvos.so instead of the
# original library/executable means that dlopen will use the DT_RUNPATH
# from libnvos.so instead of the binary/library which called it. We
# typically just need /run/opengl-driver/lib anyway, so lets add it to
# typically just need ${driverLink}/lib anyway, so lets add it to
# libnvos.so here instead.
#
# We append a postFixupHook since we need to have this happen after
# autoPatchelfHook, which itself also runs as a postFixupHook.
# TODO: Use runtimeDependencies instead
preFixup = ''
postFixupHooks+=('
patchelf --add-rpath /run/opengl-driver/lib $out/lib/libnvos.so
patchelf --add-rpath ${addOpenGLRunpath.driverLink}/lib $out/lib/libnvos.so
')
'';
};
Expand Down
Loading