diff --git a/pkgs/development/cuda-modules/packages/cuda_compat.nix b/pkgs/development/cuda-modules/packages/cuda_compat.nix index 09f04f143322..08ba2218f84a 100644 --- a/pkgs/development/cuda-modules/packages/cuda_compat.nix +++ b/pkgs/development/cuda-modules/packages/cuda_compat.nix @@ -1,4 +1,8 @@ -{ buildRedist }: +{ + buildRedist, + config, + lib, +}: buildRedist { redistName = "cuda"; pname = "cuda_compat"; @@ -16,5 +20,11 @@ buildRedist { meta = { description = "Provides minor version forward compatibility for the CUDA runtime"; homepage = "https://docs.nvidia.com/deploy/cuda-compatibility"; + problems = lib.optionalAttrs config.enableCudaDriverCompat { + cuda-compat-disabled = { + kind = "broken"; + message = "cuda_compat must be explicitly enabled using config.enableCudaDriverCompat."; + }; + }; }; } diff --git a/pkgs/top-level/config.nix b/pkgs/top-level/config.nix index 1e776f3e8774..a08f8341cc5b 100644 --- a/pkgs/top-level/config.nix +++ b/pkgs/top-level/config.nix @@ -348,6 +348,17 @@ let ''; }; + enableCudaDriverCompat = mkOption { + type = types.bool; + default = false; + description = '' + Whether to enable the cuda_compat package which provides user mode backports of newer kernel + mode driver functionality. + Ony enable this if your host driver is older than the driver provided by the default + cudaPackages package set. + ''; + }; + replaceBootstrapFiles = mkMassRebuild { type = types.functionTo (types.attrsOf types.package); default = lib.id;