ysndr
September 11, 2025, 5:42pm
14
To avoid the cross reference, the same instructions as for the nix-community cache apply:
To enable CUDA support in packages use the NixOS configuration:
nixpkgs.config.cudaSupport = true;
nixpkgs.config.allowUnfreePredicate =
p:
builtins.all (
license:
license.free
|| builtins.elem license.shortName [
"CUDA EULA"
"cuDNN EULA"
"cuTENSOR EULA"
"NVidia OptiX EULA"
]
) (if builtins.isList p.meta.license then p.meta.license else [ p.meta.license ]);
}
When preparing a development environment use pkgs = import <nixpkgs> { config = { cudaSupport = true; allowUnfreePredicate = /* ... */; }; }. When using the stable CLI write
$ nix-build "<nixpkgs>" \
--arg config '{ cudaSupport = true; allowUnfree = true; }' \
-A blender
or, with the experimental nix-command:
$ nix build -f "<nixpkgs>" \
--arg config '{ /* ... */ }' \
blender
# flox builds from nixpkgs' nicos-unstable channel,
# if your nixpkgs rev is too fresh, you might want to follow our "unstable" channel
$ nix build -f "<nixpkgs>" \
-I nixpkgs=flake:github:flox/nixpkgs/unstable \
--arg config '{ /* ... */ }' \
cudaPackages.saxpy
Mind that flox tracks nixpkgs’ “nixos-unstable” channel in github:flox/nixpkgs , so if evaluations of your nixpkgs reference differ (i.e. revisions that are not yet built by flox) you might need to follow github:flox/nixpkgs/unstable.
1 Like