Skip to content

Commit

Permalink
Merge pull request NixOS#272084 from ConnorBaker/fix/ctranslate2-opti…
Browse files Browse the repository at this point in the history
…onal-cudnn-dep

ctranslate2: enable cuDNN only if it is available
  • Loading branch information
Connor Baker authored Dec 4, 2023
2 parents 5f5e76c + d23df73 commit 2c7f3c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion pkgs/development/libraries/ctranslate2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ stdenv.mkDerivation rec {
cudaPackages.cuda_cudart
cudaPackages.libcublas
cudaPackages.libcurand
] ++ lib.optionals withCuDNN [
] ++ lib.optionals (withCUDA && withCuDNN) [
cudaPackages.cudnn
] ++ lib.optionals withOneDNN [
oneDNN
Expand All @@ -87,5 +87,8 @@ stdenv.mkDerivation rec {
changelog = "https://github.com/OpenNMT/CTranslate2/blob/${src.rev}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ hexa misuzu ];
broken =
(lib.versionOlder cudaPackages.cudaVersion "11.4")
|| !(withCuDNN -> withCUDA);
};
}
3 changes: 2 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20935,7 +20935,8 @@ with pkgs;
ctranslate2 = callPackage ../development/libraries/ctranslate2 rec {
stdenv = if withCUDA then gcc11Stdenv else pkgs.stdenv;
withCUDA = pkgs.config.cudaSupport;
withCuDNN = pkgs.config.cudaSupport;
withCuDNN = withCUDA && (cudaPackages ? cudnn);
cudaPackages = pkgs.cudaPackages;
};

ubus = callPackage ../development/libraries/ubus { };
Expand Down

0 comments on commit 2c7f3c0

Please sign in to comment.