Add CUDA support
I bothered with that only to realize that I'm not using proprietary drivers 🙃
This commit is contained in:
parent
84268f3c47
commit
b16db77f04
3 changed files with 33 additions and 0 deletions
|
@ -12,6 +12,7 @@ in
|
||||||
description = "top-level flake";
|
description = "top-level flake";
|
||||||
type = lib.types.attrs;
|
type = lib.types.attrs;
|
||||||
};
|
};
|
||||||
|
cuda = lib.mkEnableOption "Use CUDA for some libraries";
|
||||||
extra = lib.mkEnableOption "Big software";
|
extra = lib.mkEnableOption "Big software";
|
||||||
gaming = lib.mkEnableOption "Games";
|
gaming = lib.mkEnableOption "Games";
|
||||||
polarity = lib.mkOption {
|
polarity = lib.mkOption {
|
||||||
|
|
31
os/cuda/default.nix
Normal file
31
os/cuda/default.nix
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
# Need nvidia proprietary drivers to work
|
||||||
|
{ pkgs, nixpkgs, config, lib, ... }:
|
||||||
|
{
|
||||||
|
config = lib.mkIf config.frogeye.cuda {
|
||||||
|
nix.settings = {
|
||||||
|
substituters = [
|
||||||
|
"https://cuda-maintainers.cachix.org"
|
||||||
|
];
|
||||||
|
trusted-public-keys = [
|
||||||
|
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
|
||||||
|
];
|
||||||
|
};
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(self: super:
|
||||||
|
let
|
||||||
|
pkgs_uf = import nixpkgs {
|
||||||
|
inherit (super) system;
|
||||||
|
config.allowUnfree = true;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
ctranslate2 = (pkgs_uf.ctranslate2.override {
|
||||||
|
withCUDA = true;
|
||||||
|
withCuDNN = true;
|
||||||
|
stdenv = pkgs.gcc12Stdenv; # 24.11 Remove, as nvcc and gcc versions align again
|
||||||
|
# Takes more than 16 GiB RAM to compile with the above, but fine if not
|
||||||
|
});
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
|
@ -6,6 +6,7 @@
|
||||||
./battery.nix
|
./battery.nix
|
||||||
./boot
|
./boot
|
||||||
./ccc
|
./ccc
|
||||||
|
./cuda
|
||||||
./common.nix
|
./common.nix
|
||||||
./desktop
|
./desktop
|
||||||
./dev
|
./dev
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue