_cuda.lib.allowUnfreeCudaPredicate: derive from _cuda.lib.licenses
Signed-off-by: Connor Baker <ConnorBaker01@gmail.com>
This commit is contained in:
@@ -26,23 +26,9 @@ All CUDA package sets include common CUDA packages like `libcublas`, `cudnn`, `t
|
|||||||
CUDA support is not enabled by default in Nixpkgs. To enable CUDA support, make sure Nixpkgs is imported with a configuration similar to the following:
|
CUDA support is not enabled by default in Nixpkgs. To enable CUDA support, make sure Nixpkgs is imported with a configuration similar to the following:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
{ pkgs }:
|
||||||
{
|
{
|
||||||
allowUnfreePredicate =
|
allowUnfreePredicate = pkgs._cuda.lib.allowUnfreeCudaPredicate;
|
||||||
let
|
|
||||||
ensureList = x: if builtins.isList x then x else [ x ];
|
|
||||||
in
|
|
||||||
package:
|
|
||||||
builtins.all (
|
|
||||||
license:
|
|
||||||
license.free
|
|
||||||
|| builtins.elem license.shortName [
|
|
||||||
"CUDA EULA"
|
|
||||||
"cuDNN EULA"
|
|
||||||
"cuSPARSELt EULA"
|
|
||||||
"cuTENSOR EULA"
|
|
||||||
"NVidia OptiX EULA"
|
|
||||||
]
|
|
||||||
) (ensureList package.meta.license);
|
|
||||||
cudaCapabilities = [ <target-architectures> ];
|
cudaCapabilities = [ <target-architectures> ];
|
||||||
cudaForwardCompat = true;
|
cudaForwardCompat = true;
|
||||||
cudaSupport = true;
|
cudaSupport = true;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{ lib }:
|
{ _cuda, lib }:
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
Returns whether a capability should be built by default for a particular CUDA version.
|
Returns whether a capability should be built by default for a particular CUDA version.
|
||||||
@@ -114,16 +114,14 @@
|
|||||||
```
|
```
|
||||||
*/
|
*/
|
||||||
allowUnfreeCudaPredicate =
|
allowUnfreeCudaPredicate =
|
||||||
package:
|
let
|
||||||
lib.all (
|
cudaLicenseNames = [
|
||||||
license:
|
lib.licenses.nvidiaCuda.shortName
|
||||||
license.free
|
|
||||||
|| lib.elem license.shortName [
|
|
||||||
"CUDA EULA"
|
|
||||||
"cuDNN EULA"
|
|
||||||
"cuSPARSELt EULA"
|
|
||||||
"cuTENSOR EULA"
|
|
||||||
"NVidia OptiX EULA"
|
|
||||||
]
|
]
|
||||||
) (lib.toList package.meta.license);
|
++ lib.map (license: license.shortName) (lib.attrValues _cuda.lib.licenses);
|
||||||
|
in
|
||||||
|
package:
|
||||||
|
lib.all (license: license.free || lib.elem license.shortName cudaLicenseNames) (
|
||||||
|
lib.toList package.meta.license
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
;
|
;
|
||||||
|
|
||||||
# See ./cuda.nix for documentation.
|
# See ./cuda.nix for documentation.
|
||||||
inherit (import ./cuda.nix { inherit lib; })
|
inherit (import ./cuda.nix { inherit _cuda lib; })
|
||||||
_cudaCapabilityIsDefault
|
_cudaCapabilityIsDefault
|
||||||
_cudaCapabilityIsSupported
|
_cudaCapabilityIsSupported
|
||||||
_mkCudaVariant
|
_mkCudaVariant
|
||||||
|
|||||||
Reference in New Issue
Block a user