config: add enableCudaDriverCompat

This commit is contained in:
Gaetan Lepage
2026-09-28 08:54:35 +00:00
parent d312512e2c
commit f2b8e80ec8
2 changed files with 22 additions and 1 deletions

View File

@@ -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.";
};
};
};
}

View File

@@ -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;