mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-05 05:13:04 +00:00
tensorrt: fix false fallback to tensorRTDefaultVersion
Throw an error if the default version of tensorrt does not support the cuda version. Adding cudatoolkit 11.8 fails to evaluate tensorrt.{tensorRTDefaultVersion} as "11.8" is not listed on any supportedCudaVersions of any tensorRTVersions attributes.
This commit is contained in:
parent
8a63fb0236
commit
ad6aeedf56
@ -24,7 +24,9 @@ final: prev: let
|
||||
# Add all supported builds as attributes
|
||||
allBuilds = mapAttrs' (version: file: nameValuePair (computeName version) (buildTensorRTPackage (removeAttrs file ["fileVersionCuda"]))) supportedVersions;
|
||||
# Set the default attributes, e.g. tensorrt = tensorrt_8_4;
|
||||
defaultBuild = { "tensorrt" = allBuilds.${computeName tensorRTDefaultVersion}; };
|
||||
defaultBuild = { "tensorrt" = if allBuilds ? ${computeName tensorRTDefaultVersion}
|
||||
then allBuilds.${computeName tensorRTDefaultVersion}
|
||||
else throw "tensorrt-${tensorRTDefaultVersion} does not support your cuda version ${cudaVersion}"; };
|
||||
in allBuilds // defaultBuild;
|
||||
|
||||
tensorRTVersions = {
|
||||
|
Loading…
Reference in New Issue
Block a user