diff options
author | Someone Serge <sergei.kozlukov@aalto.fi> | 2022-06-12 17:25:38 +0300 |
---|---|---|
committer | Someone Serge <sergei.kozlukov@aalto.fi> | 2023-04-02 01:08:41 +0300 |
commit | 6dc90880de87451252e33aa6ea5af3012b6b36f8 (patch) | |
tree | bc9c3f8e1bc53a592481237ab1082fb27fd8475d /pkgs/development/compilers/cudatoolkit/common.nix | |
parent | a3694989165105fdb0058d7a4a3799c1d180c269 (diff) | |
download | nixpkgs-6dc90880de87451252e33aa6ea5af3012b6b36f8.tar nixpkgs-6dc90880de87451252e33aa6ea5af3012b6b36f8.tar.gz nixpkgs-6dc90880de87451252e33aa6ea5af3012b6b36f8.tar.bz2 nixpkgs-6dc90880de87451252e33aa6ea5af3012b6b36f8.tar.lz nixpkgs-6dc90880de87451252e33aa6ea5af3012b6b36f8.tar.xz nixpkgs-6dc90880de87451252e33aa6ea5af3012b6b36f8.tar.zst nixpkgs-6dc90880de87451252e33aa6ea5af3012b6b36f8.zip |
cudaPackages.cudatoolkit: use autoPatchelf
...to ensure correctness (in the sense that all DT_NEEDED libraries are verified to be discoverable through the runpaths)
Diffstat (limited to 'pkgs/development/compilers/cudatoolkit/common.nix')
-rw-r--r-- | pkgs/development/compilers/cudatoolkit/common.nix | 94 |
1 files changed, 87 insertions, 7 deletions
diff --git a/pkgs/development/compilers/cudatoolkit/common.nix b/pkgs/development/compilers/cudatoolkit/common.nix index 894c0b8fb52..a3054f49b2d 100644 --- a/pkgs/development/compilers/cudatoolkit/common.nix +++ b/pkgs/development/compilers/cudatoolkit/common.nix @@ -5,6 +5,8 @@ args@ , name ? "" , developerProgram ? false , runPatches ? [] +, autoPatchelfHook +, autoAddOpenGLRunpathHook , addOpenGLRunpath , alsa-lib , expat @@ -16,15 +18,25 @@ args@ , glibc , gtk2 , lib +, libxkbcommon +, libkrb5 +, krb5 , makeWrapper , ncurses5 +, numactl +, nss , perl -, python3 +, python3 # FIXME: CUDAToolkit 10 may still need python27 +, pulseaudio , requireFile , backendStdenv # E.g. gcc11Stdenv, set in extension.nix , unixODBC +, wayland , xorg , zlib +, freeglut +, libGLU +, libsForQt5 }: backendStdenv.mkDerivation rec { @@ -52,12 +64,80 @@ backendStdenv.mkDerivation rec { outputs = [ "out" "lib" "doc" ]; - nativeBuildInputs = [ perl makeWrapper addOpenGLRunpath ]; - buildInputs = [ gdk-pixbuf ]; # To get $GDK_PIXBUF_MODULE_FILE via setup-hook + nativeBuildInputs = [ + perl + makeWrapper + addOpenGLRunpath + autoPatchelfHook + autoAddOpenGLRunpathHook + ] ++ lib.optionals (lib.versionOlder version "11") [ + libsForQt5.wrapQtAppsHook + ]; + buildInputs = [ + # To get $GDK_PIXBUF_MODULE_FILE via setup-hook + gdk-pixbuf + + # For autoPatchelf + ncurses5 + expat + python3 + zlib + glibc + xorg.libX11 + xorg.libXext + xorg.libXrender + xorg.libXt + xorg.libXtst + xorg.libXi + xorg.libXext + xorg.libXdamage + xorg.libxcb + xorg.xcbutilimage + xorg.xcbutilrenderutil + xorg.xcbutilwm + xorg.xcbutilkeysyms + pulseaudio + libxkbcommon + libkrb5 + krb5 + gtk2 + glib + fontconfig + freetype + numactl + nss + unixODBC + alsa-lib + wayland + ] ++ lib.optionals (lib.versionOlder version "11") [ + libsForQt5.qt5.qtwebengine + freeglut + libGLU + ]; + + # Prepended to runpaths by autoPatchelf. + # The order inherited from older rpath preFixup code runtimeDependencies = [ - ncurses5 expat python3 zlib glibc - xorg.libX11 xorg.libXext xorg.libXrender xorg.libXt xorg.libXtst xorg.libXi xorg.libXext - gtk2 glib fontconfig freetype unixODBC alsa-lib + (placeholder "lib") + (placeholder "out") + "${placeholder "out"}/nvvm" + # Is it not handled by autoPatchelf automatically? + "${lib.getLib backendStdenv.cc.cc}/lib64" + "${placeholder "out"}/jre/lib/amd64/jli" + "${placeholder "out"}/lib64" + "${placeholder "out"}/nvvm/lib64" + ]; + + autoPatchelfIgnoreMissingDeps = [ + # This is the hardware-dependent userspace driver that comes from + # nvidia_x11 package. It must be deployed at runtime in + # /run/opengl-driver/lib or pointed at by LD_LIBRARY_PATH variable, rather + # than pinned in runpath + "libcuda.so.1" + + # The krb5 expression ships libcom_err.so.3 but cudatoolkit asks for the + # older + "libcom_err.so.2" ]; unpackPhase = '' @@ -198,7 +278,7 @@ backendStdenv.mkDerivation rec { preFixup = let rpath = lib.concatStringsSep ":" [ - (lib.makeLibraryPath (runtimeDependencies ++ [ "$lib" "$out" "$out/nvvm" ])) + (lib.makeLibraryPath (buildInputs ++ [ "$lib" "$out" "$out/nvvm" ])) # The path to libstdc++ and such # |