From 0a33c9701def4ca502b7884440d9022956a564ac Mon Sep 17 00:00:00 2001 From: John Rinehart Date: Wed, 6 Dec 2023 13:36:22 -0800 Subject: [PATCH] fix: use P3767-0001 nvpmodel conf for Orin NX 8GB note: nvpmodel.service is failing on 8GB variants of this board since it has 2 less cores than the 16GB variant (supported already) and since the nvpmodel configuration file was being recycled for all Orin NX variants. So, `nvpmodel.service` would try to change settings for 8 CPUs when only 6 exist. cf. https://docs.nvidia.com/jetson/archives/r35.3.1/DeveloperGuide/index.html for the mapping between Orin NX variant and Nvidia "P-number". --- modules/default.nix | 13 +++++++++++++ modules/devices.nix | 8 +++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/modules/default.nix b/modules/default.nix index 584654e..9cd89c8 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -57,6 +57,19 @@ in description = "Jetson SoM (System-on-Module) to target. Can be null to target a generic jetson device, but some things may not work."; }; + 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 { default = null; type = types.nullOr (types.enum [ "devkit" ]); diff --git a/modules/devices.nix b/modules/devices.nix index 3e7dab9..cd72d17 100644 --- a/modules/devices.nix +++ b/modules/devices.nix @@ -1,6 +1,6 @@ { pkgs, config, lib, ... }: -# Configuration specific to particular SoM or carrier boardsl +# Configuration specific to particular SoM or carrier boards let inherit (lib) mkDefault @@ -11,7 +11,9 @@ let nvpModelConf = { orin-agx = "${pkgs.nvidia-jetpack.l4t-nvpmodel}/etc/nvpmodel/nvpmodel_p3701_0000.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-nx = "${pkgs.nvidia-jetpack.l4t-nvpmodel}/etc/nvpmodel/nvpmodel_t194_p3668.conf"; @@ -65,7 +67,7 @@ in lib.mkMerge [{ partitionTemplate = mkDefault "${pkgs.nvidia-jetpack.bspSrc}/bootloader/t186ref/cfg/flash_t234_qspi.xml"; }) - (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";