Loading pkgs/development/compilers/cudatoolkit/common.nix +4 −2 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ args@ , python3 # FIXME: CUDAToolkit 10 may still need python27 , pulseaudio , requireFile , stdenv , backendStdenv # E.g. gcc11Stdenv, set in extension.nix , unixODBC , wayland Loading Loading @@ -136,8 +137,8 @@ backendStdenv.mkDerivation rec { (placeholder "lib") (placeholder "out") "${placeholder "out"}/nvvm" # Is it not handled by autoPatchelf automatically? "${lib.getLib backendStdenv.cc.cc}/lib64" # NOTE: use the same libstdc++ as the rest of nixpkgs, not from backendStdenv "${lib.getLib stdenv.cc.cc}/lib64" "${placeholder "out"}/jre/lib/amd64/jli" "${placeholder "out"}/lib64" "${placeholder "out"}/nvvm/lib64" Loading Loading @@ -219,6 +220,7 @@ backendStdenv.mkDerivation rec { mv pkg/builds/nsight_systems/target-linux-x64 $out/target-linux-x64 mv pkg/builds/nsight_systems/host-linux-x64 $out/host-linux-x64 rm $out/host-linux-x64/libstdc++.so* ''} ${lib.optionalString (lib.versionAtLeast version "11.8") # error: auto-patchelf could not satisfy dependency libtiff.so.5 wanted by /nix/store/.......-cudatoolkit-12.0.1/host-linux-x64/Plugins/imageformats/libqtiff.so Loading pkgs/development/compilers/cudatoolkit/extension.nix +10 −4 Original line number Diff line number Diff line Loading @@ -10,11 +10,17 @@ final: prev: let finalVersion = cudatoolkitVersions.${final.cudaVersion}; # Exposed as cudaPackages.backendStdenv. # We don't call it just "stdenv" to avoid confusion: e.g. this toolchain doesn't contain nvcc. # Instead, it's the back-end toolchain for nvcc to use. # We also use this to link a compatible libstdc++ (backendStdenv.cc.cc.lib) # This is what nvcc uses as a backend, # and it has to be an officially supported one (e.g. gcc11 for cuda11). # # It, however, propagates current stdenv's libstdc++ to avoid "GLIBCXX_* not found errors" # when linked with other C++ libraries. # E.g. for cudaPackages_11_8 we use gcc11 with gcc12's libstdc++ # Cf. https://github.com/NixOS/nixpkgs/pull/218265 for context backendStdenv = prev.pkgs."${finalVersion.gcc}Stdenv"; backendStdenv = final.callPackage ./stdenv.nix { nixpkgsStdenv = prev.pkgs.stdenv; nvccCompatibleStdenv = prev.pkgs.buildPackages."${finalVersion.gcc}Stdenv"; }; ### Add classic cudatoolkit package cudatoolkit = Loading pkgs/development/compilers/cudatoolkit/redist/build-cuda-redist-package.nix +5 −4 Original line number Diff line number Diff line { lib , stdenv , backendStdenv , fetchurl , autoPatchelfHook Loading Loading @@ -30,11 +31,11 @@ backendStdenv.mkDerivation { ]; buildInputs = [ # autoPatchelfHook will search for a libstdc++ and we're giving it a # "compatible" libstdc++ from the same toolchain that NVCC uses. # # autoPatchelfHook will search for a libstdc++ and we're giving it # one that is compatible with the rest of nixpkgs, even when # nvcc forces us to use an older gcc # NB: We don't actually know if this is the right thing to do backendStdenv.cc.cc.lib stdenv.cc.cc.lib ]; dontBuild = true; Loading pkgs/development/compilers/cudatoolkit/stdenv.nix 0 → 100644 +17 −0 Original line number Diff line number Diff line { nixpkgsStdenv , nvccCompatibleStdenv , overrideCC , wrapCCWith }: overrideCC nixpkgsStdenv (wrapCCWith { cc = nvccCompatibleStdenv.cc.cc; # This option is for clang's libcxx, but we (ab)use it for gcc's libstdc++. # Note that libstdc++ maintains forward-compatibility: if we load a newer # libstdc++ into the process, we can still use libraries built against an # older libstdc++. This, in practice, means that we should use libstdc++ from # the same stdenv that the rest of nixpkgs uses. # We currently do not try to support anything other than gcc and linux. libcxx = nixpkgsStdenv.cc.cc.lib; }) pkgs/development/libraries/science/math/cudnn/generic.nix +5 −3 Original line number Diff line number Diff line { { stdenv, backendStdenv, lib, zlib, Loading Loading @@ -26,7 +26,6 @@ maxCudaVersion, }: assert useCudatoolkitRunfile || (libcublas != null); let inherit (backendStdenv) cc; inherit (lib) lists strings trivial versions; # majorMinorPatch :: String -> String Loading Loading @@ -63,7 +62,10 @@ in # Used by autoPatchelfHook buildInputs = [ cc.cc.lib # libstdc++ # Note this libstdc++ isn't from the (possibly older) nvcc-compatible # stdenv, but from the (newer) stdenv that the rest of nixpkgs uses stdenv.cc.cc.lib zlib cudatoolkit_root ]; Loading Loading
pkgs/development/compilers/cudatoolkit/common.nix +4 −2 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ args@ , python3 # FIXME: CUDAToolkit 10 may still need python27 , pulseaudio , requireFile , stdenv , backendStdenv # E.g. gcc11Stdenv, set in extension.nix , unixODBC , wayland Loading Loading @@ -136,8 +137,8 @@ backendStdenv.mkDerivation rec { (placeholder "lib") (placeholder "out") "${placeholder "out"}/nvvm" # Is it not handled by autoPatchelf automatically? "${lib.getLib backendStdenv.cc.cc}/lib64" # NOTE: use the same libstdc++ as the rest of nixpkgs, not from backendStdenv "${lib.getLib stdenv.cc.cc}/lib64" "${placeholder "out"}/jre/lib/amd64/jli" "${placeholder "out"}/lib64" "${placeholder "out"}/nvvm/lib64" Loading Loading @@ -219,6 +220,7 @@ backendStdenv.mkDerivation rec { mv pkg/builds/nsight_systems/target-linux-x64 $out/target-linux-x64 mv pkg/builds/nsight_systems/host-linux-x64 $out/host-linux-x64 rm $out/host-linux-x64/libstdc++.so* ''} ${lib.optionalString (lib.versionAtLeast version "11.8") # error: auto-patchelf could not satisfy dependency libtiff.so.5 wanted by /nix/store/.......-cudatoolkit-12.0.1/host-linux-x64/Plugins/imageformats/libqtiff.so Loading
pkgs/development/compilers/cudatoolkit/extension.nix +10 −4 Original line number Diff line number Diff line Loading @@ -10,11 +10,17 @@ final: prev: let finalVersion = cudatoolkitVersions.${final.cudaVersion}; # Exposed as cudaPackages.backendStdenv. # We don't call it just "stdenv" to avoid confusion: e.g. this toolchain doesn't contain nvcc. # Instead, it's the back-end toolchain for nvcc to use. # We also use this to link a compatible libstdc++ (backendStdenv.cc.cc.lib) # This is what nvcc uses as a backend, # and it has to be an officially supported one (e.g. gcc11 for cuda11). # # It, however, propagates current stdenv's libstdc++ to avoid "GLIBCXX_* not found errors" # when linked with other C++ libraries. # E.g. for cudaPackages_11_8 we use gcc11 with gcc12's libstdc++ # Cf. https://github.com/NixOS/nixpkgs/pull/218265 for context backendStdenv = prev.pkgs."${finalVersion.gcc}Stdenv"; backendStdenv = final.callPackage ./stdenv.nix { nixpkgsStdenv = prev.pkgs.stdenv; nvccCompatibleStdenv = prev.pkgs.buildPackages."${finalVersion.gcc}Stdenv"; }; ### Add classic cudatoolkit package cudatoolkit = Loading
pkgs/development/compilers/cudatoolkit/redist/build-cuda-redist-package.nix +5 −4 Original line number Diff line number Diff line { lib , stdenv , backendStdenv , fetchurl , autoPatchelfHook Loading Loading @@ -30,11 +31,11 @@ backendStdenv.mkDerivation { ]; buildInputs = [ # autoPatchelfHook will search for a libstdc++ and we're giving it a # "compatible" libstdc++ from the same toolchain that NVCC uses. # # autoPatchelfHook will search for a libstdc++ and we're giving it # one that is compatible with the rest of nixpkgs, even when # nvcc forces us to use an older gcc # NB: We don't actually know if this is the right thing to do backendStdenv.cc.cc.lib stdenv.cc.cc.lib ]; dontBuild = true; Loading
pkgs/development/compilers/cudatoolkit/stdenv.nix 0 → 100644 +17 −0 Original line number Diff line number Diff line { nixpkgsStdenv , nvccCompatibleStdenv , overrideCC , wrapCCWith }: overrideCC nixpkgsStdenv (wrapCCWith { cc = nvccCompatibleStdenv.cc.cc; # This option is for clang's libcxx, but we (ab)use it for gcc's libstdc++. # Note that libstdc++ maintains forward-compatibility: if we load a newer # libstdc++ into the process, we can still use libraries built against an # older libstdc++. This, in practice, means that we should use libstdc++ from # the same stdenv that the rest of nixpkgs uses. # We currently do not try to support anything other than gcc and linux. libcxx = nixpkgsStdenv.cc.cc.lib; })
pkgs/development/libraries/science/math/cudnn/generic.nix +5 −3 Original line number Diff line number Diff line { { stdenv, backendStdenv, lib, zlib, Loading Loading @@ -26,7 +26,6 @@ maxCudaVersion, }: assert useCudatoolkitRunfile || (libcublas != null); let inherit (backendStdenv) cc; inherit (lib) lists strings trivial versions; # majorMinorPatch :: String -> String Loading Loading @@ -63,7 +62,10 @@ in # Used by autoPatchelfHook buildInputs = [ cc.cc.lib # libstdc++ # Note this libstdc++ isn't from the (possibly older) nvcc-compatible # stdenv, but from the (newer) stdenv that the rest of nixpkgs uses stdenv.cc.cc.lib zlib cudatoolkit_root ]; Loading