Skip to content

Commit

Permalink
fix nvpmodel for orin-nx-8gb
Browse files Browse the repository at this point in the history
source: anduril#168
  • Loading branch information
sphw committed Sep 29, 2024
1 parent 4eb932f commit daa7221
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
13 changes: 13 additions & 0 deletions modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,19 @@ in
'';
};

sku = mkOption {
default = null;
# "Extensible option types" in the NixOS manual
type = types.nullOr types.string;
example = "0001";
description = "Specific SKU of a given SOM. This can be
helpful to fine-tune configuration of a given device. For
example, Orin NX devices come in 8GB and 16GB flavors which
differ in the number of supported cores. Configuring the SKU
for this SOM would ensure things like nvpmodel work
correctly.";
};

carrierBoard = mkOption {
type = types.enum [
"generic"
Expand Down
6 changes: 4 additions & 2 deletions modules/devices.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ let
nvpModelConf = {
orin-agx = "${pkgs.nvidia-jetpack.l4t-nvpmodel}/etc/nvpmodel/nvpmodel_p3701_0000.conf";
orin-agx-industrial = "${pkgs.nvidia-jetpack.l4t-nvpmodel}/etc/nvpmodel/nvpmodel_p3701_0008.conf";
orin-nx = "${pkgs.nvidia-jetpack.l4t-nvpmodel}/etc/nvpmodel/nvpmodel_p3767_0000.conf";
orin-nx = if (cfg.sku == "0001")
then "${pkgs.nvidia-jetpack.l4t-nvpmodel}/etc/nvpmodel/nvpmodel_p3767_0001.conf"
else "${pkgs.nvidia-jetpack.l4t-nvpmodel}/etc/nvpmodel/nvpmodel_p3767_0000.conf";
orin-nano = "${pkgs.nvidia-jetpack.l4t-nvpmodel}/etc/nvpmodel/nvpmodel_p3767_0003.conf";
xavier-agx = "${pkgs.nvidia-jetpack.l4t-nvpmodel}/etc/nvpmodel/nvpmodel_t194.conf";
xavier-agx-industrial = "${pkgs.nvidia-jetpack.l4t-nvpmodel}/etc/nvpmodel/nvpmodel_t194_agxi.conf";
Expand Down Expand Up @@ -109,7 +111,7 @@ lib.mkMerge [{
'');
})

(mkIf (cfg.som == "orin-nx" || cfg.som == "orin-nano") {
(mkIf (cfg.som == "orin-nx" || cfg.som == "orin-nx-8G" || cfg.som == "orin-nano") {
targetBoard = mkDefault "jetson-orin-nano-devkit";
# Use this instead if you want to use the original Xavier NX Devkit module (p3509-a02)
#targetBoard = mkDefault "p3509-a02+p3767-0000";
Expand Down

0 comments on commit daa7221

Please sign in to comment.