使用 NVIDIA SDK Manager 调整硬件和软件 JSON 清单文件#

目标#

本文档描述了使用 SDK Manager 客户端创建或更改携带的数据信息的方法,以便将其用于非 NVIDIA 官方 SDK 版本提供的硬件和软件。

SDK Manager 客户端从 NVIDIA 官方仓库获取有关软件和硬件的信息;但是,可以使用您自己的设置覆盖或重新创建此信息。

以下描述将帮助您创建具有请求修改的此类仓库,并使用它们来分发软件和硬件的修改设置。

创建和使用仓库的流程#

以下部分将描述创建您自己的仓库/服务器并使用它们的每个步骤。

主要的流程步骤是

  • 获取当前硬件和软件的仓库文件。

  • 使用请求的更改修改本地副本。

  • 启动 SDK Manager 并引用新的仓库。

获取参考数据#

首先,获取硬件和软件 JSON 清单文件,其中包含您要自定义的 SDK 版本的硬件和软件信息

使用以下方法之一下载软件 JSON 清单文件

  • 使用 SDK Manager GUI: 运行 NVIDIA SDK Manager GUI,选择您要自定义的 SDK,然后转到步骤 02 以查看组件列表。完成后,退出 SDK Manager。

  • 使用 SDK Manager 命令行界面: 运行 NVIDIA SDK Manager CLI,并使用所需的特定参数。例如

    # sdkmanager --cli
    

查看相关的执行命令。完成后,退出 SDK Manager。

  • 硬件参考文件应包含在 ~/.nvsdkm/hwdata/ 目录中。

  • 软件参考文件应包含在 ~/.nvsdkm/dist/ 目录中。

创建您自己的配置#

查看硬件参考文件目录 ~/.nvsdkm/hwdata/,将相关的必要文件复制到另一个位置,并根据 仓库模式详情 中提供的模式信息对其进行修改。

查看软件参考目录 ~/.nvsdkm/dist/,将相关的必要文件复制到另一个位置,并根据 仓库模式详情 中提供的模式信息对其进行修改。

本文档末尾提供了一个示例。

使用您自己的配置启动 SDK Manager#

要使用自定义的软件 JSON 文件启动 SDK Manager,请使用以下命令

sdkmanager --hw-server [customized_l1_json_uri] --server [customized_l1_json_uri]

仓库模式详情#

文件层级结构#

硬件#

L1/L2/L3 文件之间的关系

  • L1 JSON 文件包含通用的硬件支持信息和 SDK Manager 中的系列(产品)。在 families 中,families.uri 指向 L2 系列 JSON 文件的位置。

  • L2 JSON 文件包含产品的详细系列信息。每个系列包含该产品下的硬件设备,并且在 series 中,series.uri 指向 L3 系列设备的 JSON 文件位置。这将指向系列设备 JSON 文件的位置。系列和单个设备之间的区别在下面解释。

  • L3 JSON 文件包含系列或单个设备的详细硬件信息。

系列和单个设备

  • L3 硬件模式文件可以是系列设备或单个设备。

  • 系列指的是具有相似模块的设备列表。它必须在其 JSON 文件中包含非空的 devices 字段。此外,devices.uri 指向代表性的单个设备的 L3 JSON 文件。单个设备 JSON 文件将不包含 devices 字段。

  • 单个设备必须属于一个系列。

  • 系列 JSON 文件中的信息将用于所有包含的设备,其中单个设备 JSON 文件可以覆盖系列 JSON 文件中的大多数字段。

  • NVIDIA 提供的系列设备 L3 文件以 TARGETS.jsonDEVKITS.json 结尾。

软件#

L1/L2/L3 文件之间的关系

  • L1 JSON 文件包含通用的软件支持信息和 SDK Manager 中的 productCategories(产品类别)。在 productCategories 中,productCategories.releasesIndexURL 指向 L2 产品 JSON 文件的位置。

  • L2 JSON 文件包含详细的产品发行信息。每个 productCategories 包含该产品的多个 SDK 或额外的 SDK 版本。它们具有不同的版本、修订版、支持的操作系统、设备等。对于每个发行版/版本,versions.compRepoURLreleases.compRepoURL 指向 L3 JSON 文件(SDK JSON 文件)的位置。

  • L3 JSON 文件包含详细的 SDK 信息。它包含有关部分、组、组件、安装方法等的信息。

详细模式#

您可以在此处查看详细模式。

示例:创建自定义的基于 Jetson AGX Orin 的设备#

创建硬件配置文件#

  1. 将相关文件复制到新位置并查看文件。

    cd ~
    mkdir hwsample
    cp ./.nvsdkm/hwdata/sdkml1_repo_hw.json ./hwsample
    cp ./.nvsdkm/hwdata/sdkml2_jetson_hw.json ./hwsample
    mkdir families
    cd families
    mkdir devices
    mkdir series
    cd ~
    cp ./.nvsdkm/hwdata/families/series/jetson-agx-orin-targets.json ./hwsample/families/series
    cp ./.nvsdkm/hwdata/families/devices/jetson-agx-orin-64gb.json ./hwsample/families/devices
    
  2. 在新建的 hwsample 文件夹中更新相关文件的通用信息。

    1. 在您在上一步中复制的每个文件中,找到 information 对象。

    2. information.title 更改为您喜欢的字符串。在本例中,它被设置为 Sample Jetson HW releases

    3. information.buildNumber 更改为您选择的字符串。在本例中,它被设置为 samp100。在此字符串中添加一些非数字字符,使其不会与官方 SDK Manager 版本冲突。

    4. 保留 information.contentVersioninformation.schemaVersion 值。

  3. 在新建的 hwsample 文件夹中,将相关文件的硬件信息更改为 Sample AGX Orin 的信息。

    1. 将 L3 系列 JSON 文件从 jetson-agx-orin-targets.json 重命名为 sample-agx-orin-targets.json

    2. 将 L3 设备 JSON 文件从 jetson-agx-orin-64gb.json 重命名为 sample-agx-orin.json

    3. 转到 L1 JSON 文件 sdkml1_repo_hw.json,删除 families 数组中不相关的系列对象。编辑后,文件应如下所示

      {
          "information": {
              "title": "Sample Jetson HW releases",
              "contentVersion": "0.0.1",
              "buildNumber": "samp100",
              "schemaVersion": "1"
      },
          "families": [
              {
                  "name": "Jetson",
                  "uri": "./sdkml2_jetson_hw.json"
              }
          ]
      }
      
    4. 转到 L2 JSON 文件 sdkml2_jetson_hw.json,删除 series 数组中所有不相关的系列对象。此外,根据我们的示例设备添加新的系列对象。编辑后,文件应如下所示

      {
          "information": {
              "title": "Sample Jetson HW releases",
              "contentVersion": "0.0.1",
              "buildNumber": "samp100",
              "schemaVersion": "1"
          },
          "series": [
              {
                  "id": "SAMPLE_AGX_ORIN_TARGETS",
                  "uri": "./families/jetson/series/sample-agx-orin-targets.json"
              }
          ]
      }
      
    5. 转到 L3 系列 JSON 文件 sample-agx-orin-targets.json,替换我们示例设备系列的正确信息。在本例中,我们仅将此系列的名称替换为 Sample AGX Orin modules,并更新其相关的 ID/键。编辑后,文件应如下所示

      {
          "information": {
              "title": "Sample Jetson HW releases",
              "contentVersion": "0.0.1",
              "buildNumber": "samp100",
              "schemaVersion": "1"
           },
          "hw": {
              "SAMPLE_AGX_ORIN_TARGETS": {
                  "name": "Sample AGX Orin modules",
                  "devices": [
                      {
                          "uri": "../devices/sample-agx-orin.json",
                          "id": "SAMPLE_AGX_ORIN"
                      }
                  ],
                  "products": [
                      "Jetson"
                  ],
                  "imagePath": "https://developer.download.nvidia.com/sdkmanager/resources/hw_images/JETSON/JETSON_AGX_ORIN.png",
                  "storages": [
                      {
                          "id": "default",
                          "displayName": "EMMC (default)",
                          "flashOptions": ""
                      },
                      {
                          "id": "nvme",
                          "displayName": "NVMe",
                          "flashOptions": "--storage nvme0n1p1"
                      },
                      {
                          "id": "usb",
                          "displayName": "USB",
                          "flashOptions": "--storage sda1"
                      },
                      {
                          "id": "custom",
                          "displayName": "Custom",
                          "flashOptions": "--custom ./nvautoflash.sh"
                      }
                  ],
                  "deviceInstructions": {
                      "flash": [
                          "Choose whether to put your %{DEVICE_NAME} into Force Recovery Mode via Manual Setup or Automatic Setup. Choose Automatic Setup only if the device has already been flashed and is currently running."
                      ],
                      "recoveryAuto": [
                          "Ensure the device has already been flashed, powered and running.",
                          "Connect the host computer to the front USB Type-C connector on the device.",
                          "Enter the connection information of your %{DEVICE_NAME}."
                      ],
                      "recoveryManual": [
                          "Make sure the device is connected to the power adapter, but powered off.",
                          "Connect the host computer to the front USB Type-C connector on the device.",
                          "Press and hold the middle (Force Recovery) button.",
                          "Press and hold the left (Power) button.",
                          "Release both buttons."
                      ],
                      "targetAccess": [
                          "Complete the Ubuntu 'System configuration wizard' on your %{targetName}, if you have chosen to configure it manually before flashing.",
                          "Wait for the OS login screen.",
                          "If proxy is used on host, also configure apt proxy on your %{targetName}.",
                          "Enter the username and password of your %{targetName}."
                      ]
                  },
                  "singularName": "Jetson AGX Orin module",
                  "id": "SAMPLE_AGX_ORIN_TARGETS"
              }
          }
      }
      
    6. 转到 L3 设备 JSON 文件 sample-agx-orin.json,替换示例设备的正确信息。在本例中,我们仅将此设备的名称替换为 Sample AGX Orin,并更新其相关的 ID/键。编辑后,文件应如下所示

          {
              "information": {
                  "title": "Sample Jetson HW releases",
                  "contentVersion": "0.0.1",
                  "buildNumber": "samp100",
                  "schemaVersion": "1"
              },
              "hw": {
                  "SAMPLE_AGX_ORIN": {
                      "name": "Sample AGX Orin",
                      "products": [
                      "Jetson"
                  ],
                  "deviceIdentificationDetails": {
                      "moduleNames": [
                          "P3701-0005 [64GB]"
                      ],
                      "moduleIds": [
                          "3701-0005"
                      ],
                      "moduleDescription": "P3701-0005 module",
                      "tegraRecoveryModeCodes": [
                          "0955:703"
                      ],
                      "carrierIds": [
                          "3737-0000"
                      ],
                      "carrierDescription": "P3737-0000 carrier board"
                  },
                  "imagePath": "https://developer.download.nvidia.com/sdkmanager/resources/hw_images/JETSON/JETSON_AGX_ORIN.png",
                  "storages": [
                      {
                          "id": "default",
                          "displayName": "EMMC (default)",
                          "flashOptions": ""
                      },
                      {
                          "id": "nvme",
                          "displayName": "NVMe",
                          "flashOptions": "--storage nvme0n1p1"
                      },
                      {
                          "id": "usb",
                          "displayName": "USB",
                          "flashOptions": "--storage sda1"
                      },
                      {
                          "id": "custom",
                          "displayName": "Custom",
                          "flashOptions": "--custom ./nvautoflash.sh"
                      }
                  ],
                  "id": "SAMPLE_AGX_ORIN"
              }
          }
      }
      

以上是创建自定义的基于 Jetson AGX Orin 的设备 Sample AGX Orin 以及硬件配置文件所采取的所有步骤。您还可以将所有文件及其布局托管在服务器上,以便最终用户可以使用单个链接轻松加载它们(例如:sdkmanager --hw-server [link_to_your_customized_file])。

创建软件配置文件#

  1. 将相关文件复制到新位置并查看它们。

    cd ~
    mkdir swsample
    cp -r ./.nvsdkm/dist/main ./swsample
    cp -r ./.nvsdkm/dist/Jetson ./swsample
    cp ./.nvsdkm/dist/sdkml3_jetpack_512.json ./swsample
    
  2. 在新建的 swsample 文件夹中更新相关文件的通用信息。

    1. 在您在上一步中复制的 L1 和 L2 文件中,找到 information 对象。

    2. information.title 更改为您喜欢的字符串。在本例中,它被设置为 Sample Jetson SW releases

    3. information.serverConfigurationBuild 更改为您喜欢的字符串。在本例中,它被设置为 samp100,在此字符串中添加一些非数字字符,使其不会与官方 SDK Manager 版本冲突。

    4. 在您在上一步中复制的 L3 文件中,找到 information 对象。将 information.release.releaseBuild 更改为 sampb100,然后在此字符串中添加一些非数字字符,使其不会与官方 SDK Manager 版本冲突。

  3. 在新建的 swsample 文件夹中,将相关文件的软件信息更改为 Sample AGX Orin 的信息。

    1. 转到 L1 JSON 文件 ./main/sdkml1_repo.json,删除 productCategories 数组中不相关的 productCategories 对象。编辑后,文件末尾应如下所示

      {
        "information": {
             "title": "Sample Jetson SW releases",
             "version": "9",
             "revision": 0,
             "serverConfigurationBuild": "samp100"
         },
         "productCategories": [
             {
                 "categoryName": "Jetson",
                 "productLines": [
                     {
                         "targetOS": "Linux",
                         "targetType": "",
                         "serverType": [
                             "PID",
                             "DEVZONE"
                         ],
                         "releasesIndexURL": "../Jetson/Linux/sdkml2_jetson_linux.json"
                     }
                 ]
             }
         ]
      }
      
    2. 转到 L2 JSON 文件 ./Jetson/Linux/sdkml2_jetson_linux.json

      1. 删除 releases 数组中所有不相关的 release 对象。

      2. 删除 additionalSDKs 对象,因为它用于向后兼容的旧模式,并且在当前的 SDK 中不再使用。

      3. 在此版本中替换正确的信息。在本例中,您将仅更改此版本以支持新的系列 Sample AGX Orin modules,该系列是在上面的硬件文件中创建的。

      • 将此版本下的 releaseBuild 更改为您在上面更改的 sampb100

      • targetHW 列表中的硬件更改为仅包含 SAMPLE_AGX_ORIN_TARGETS

      • 将此版本下的 compRepoURL 更改为 L3 JSON 文件所在的 uri。在本例中,我们将其更改为本地相对 uri: ./../../sdkml3_jetpack_512.json

      1. 编辑后,文件末尾应如下所示

      {
          "information": {
              "title": "Sample Jetson SW releases",
              "fileVersion": "1",
              "fileRevision": 0,
              "serverConfigurationBuild": "samp100"
          },
          "releases": [
              {
                  "productDisplayName": "Jetson",
                  "serverType": [
                      "DEVZONE"
                  ],
                  "title": "JetPack 5.1.2",
                  "releaseRevision": 0,
                  "minSDKMVer": "1.9.3",
                  "releaseMessage": "",
                  "pidGroupId": "",
                  "targetHW": [
                      "SAMPLE_AGX_ORIN_TARGETS",
                  ],
                  "hostOperatingSystemsSupportFor": {
                      "hostGroups": [
                          "ubuntu18.04",
                          "ubuntu20.04"
                      ],
                      "targetGroups": [
                          "ubuntu18.04",
                          "ubuntu20.04"
                      ]
                  },
                  "IntHWSupport": false,
                  "releaseNotes": {
                      "releaseNotesTooltip": "<div><span class=\"tooltip-title\">What's new in JetPack 5.1.2:</span><ul><li>Support for Jetson AGX Orin Industrial Module</li><li>Enhanced Argus error resiliency</li><li>Support for multiple camera synchronization </li><li>Software based deterministic fixed alternating exposure support in Argus</li><li>Deskew Calibration supported for high data rate sensors</li></ul><a href=\"https://docs.nvda.net.cn/jetson/archives/jetpack-archived/jetpack-512/release-notes/index.html\" target=\"_blank\" class=\"tooltip-link\">Open Release Notes</a></div>",
                      "releaseNotesURL": "https://docs.nvda.net.cn/jetson/archives/jetpack-archived/jetpack-512/release-notes/index.html",
                      "releaseNotesDownload": false
                  },
                  "showInMainList": true,
                  "setupDeviceRecoveryModeOptions": [
                      "manual",
                      "automatic"
                  ],
                  "supportsOEMPreConfiguration": true,
                  "architectures": [
                      "x86_64"
                  ],
                  "productCategory": "Jetson",
                  "targetOS": "Linux",
                  "releaseVersion": "5.1.2",
                  "releaseEdition": "",
                  "id": "",
                  "hasTargetComponents": true,
                  "hardwareConfiguration": [
                      "host",
                      "target"
                  ],
                  "releaseBuild": "sampb100",
                  "schemaVersion": "19.0",
                  "compRepoURL": "../../sdkml3_jetpack_512.json"
              }
          ]
      }
      
    3. 转到 L3 JSON 文件 sdkml3_jetpack_512.json,在此版本中替换正确的信息。在本例中,我们将仅更改此版本以支持新的系列 Sample AGX Orin modules

      1. release.targetHW 列表中的硬件更改为仅包含 SAMPLE_AGX_ORIN_TARGETS,以匹配上述步骤。

      2. component 对象下,对于每个组件:如果 platforms.targetIds 包括 JETSON_AGX_ORIN_TARGETS,则将其更改为仅包含 SAMPLE_AGX_ORIN_TARGETS;如果 platforms.targetIds 不包括 JETSON_AGX_ORIN_TARGETS,则删除此平台,并且如果此组件中没有更多平台,则删除此组件。

以上是创建自定义的基于 Jetson AGX Orin 的设备 Sample AGX Orin 以及软件配置所需的所有步骤。您还可以将所有文件及其布局托管在服务器上,以便最终用户可以使用单个链接轻松加载它们(例如:sdkmanager --server [link_to_your_customized_file])。