level-zero: add setup-hook for Intel OpenGL driver lookups
The Level Zero package requires /run/opengl-driver/lib and /run/opengl-driver-32/lib to be in LD_LIBRARY_PATH for the Intel GPU driver to function correctly. This change adds a setup-hook that prepends these paths if they exist, ensuring runtime linker can find the necessary driver libraries in NixOS and other Linux systems without manual environment modifications.
This commit is contained in:
@@ -29,6 +29,8 @@ stdenv.mkDerivation rec {
|
||||
addDriverRunpath $out/lib/libze_loader.so
|
||||
'';
|
||||
|
||||
setupHook = ./setup-hook.sh;
|
||||
|
||||
passthru = {
|
||||
tests = {
|
||||
inherit intel-compute-runtime openvino;
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
if [ -d /run/opengl-driver/lib ]; then
|
||||
export LD_LIBRARY_PATH="/run/opengl-driver/lib${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH:-}"
|
||||
fi
|
||||
|
||||
if [ -d /run/opengl-driver-32/lib ]; then
|
||||
export LD_LIBRARY_PATH="/run/opengl-driver-32/lib${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH:-}"
|
||||
fi
|
||||
Reference in New Issue
Block a user