Skip to content

Commit

Permalink
packages/nixos: place nvidia-ctk-oci-hook in image
Browse files Browse the repository at this point in the history
This places the OCI hook in the expected path in the podvm-image if GPU use is configured.
  • Loading branch information
msanft committed Oct 28, 2024
1 parent c2651cb commit 12628c4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/nixos/gpu.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# Copyright 2024 Edgeless Systems GmbH
# SPDX-License-Identifier: AGPL-3.0-only

{ config, lib, ... }:
{
config,
lib,
pkgs,
...
}:

let
cfg = config.contrast.gpu;
Expand All @@ -24,6 +29,8 @@ in
};
hardware.nvidia-container-toolkit.enable = true;

image.repart.partitions."10-root".contents."/usr/share/oci/hooks/prestart/nvidia-container-toolkit.sh".source = lib.getExe pkgs.nvidia-ctk-oci-hook;

boot.initrd.kernelModules = [
# Extra kernel modules required to talk to the GPU in CC-Mode.
"ecdsa_generic"
Expand Down

0 comments on commit 12628c4

Please sign in to comment.