算法导致 thor 频现oc3报警

硬件平台:thor 官方开发套件
软件平台:jetpack 7.1
问题复现软件包:
thor_depthnet3_oc3_supplier_handoff_20260801.zip (14.3 MB)

NVIDIA Thor BEVFusion DepthNet OC3 问题复现包

1. 问题摘要

  • 平台:NVIDIA Thor,Jetson Linux R38.4,Ubuntu 24.04,CUDA 13.0,TensorRT 10.13.2.6。
  • 电源与频率:nvpmodel 为 120W / mode 1,GPU 最大频率为 1386000000 Hz,实验未降频,未关闭系统过流保护。
  • 最小复现模型:camera_fusion_pre.onnx,覆盖 camera depth transform、feature concat 和 DepthNet 前两层。
  • 问题层:ONNX 节点 /depthnet/depthnet.3/Conv,TensorRT 融合层 /depthnet/depthnet_3/Conv_myl0_6。
  • 默认 trtexec 构建选择 2SM tactic,连续满吞吐推理 60 秒时,OC3 计数稳定增长。
  • 仅将该层替换为 1SM tactic,其余 7 个 TensorRT 层、输入、环境和推理参数保持不变,OC3 增量两轮均为 0。

这组结果用于定位 TensorRT tactic 与 Thor OC3 的关联,不代表模型精度验收结果。输入是固定全零 FP16 张量,仅用于功耗和过流隔离。

2. A-B-A-B 实验结果

顺序 Engine 目标层 tactic Throughput GPU Compute Mean OC3 增量
A1 默认 2SM ...256x256..._2sm_... 482.807 qps 1.90181 ms +2388
B1 单层 1SM ...128x128..._1sm 474.468 qps 1.93829 ms 0
A2 默认 2SM ...256x256..._2sm_... 478.877 qps 1.90578 ms +2210
B2 单层 1SM ...128x128..._1sm 474.624 qps 1.93493 ms 0

完整原始证据位于 inference/evidence/。每轮均包含 command.txt、trtexec.log、trtexec_times.json、tegrastats.log、OC 前后计数、OC 时间线、运行清单和 SHA256。

3. 模型和输入契约

ONNX:model/onnx/camera_fusion_pre.onnx

名称 ONNX 类型和形状 Engine IO
depth FP32 [1, 6, 1, 448, 800] 强制 FP16 linear,输入文件 input/depth.fp16
image_neck_feature FP32 [6, 256, 56, 100] 强制 FP16 linear,输入文件 input/image_neck_feature.fp16
depthnet_hidden_feature [6, 256, 56, 100] FP16 linear 输出

两个输入文件均为确定性的全零张量。ONNX SHA256:

f649c267f7f3b8fee8649a7693b6746a1d456d5a6a0e0127210a3ce5dd0e60fa  camera_fusion_pre.onnx

4. 默认问题 Engine 的构建

问题 engine:model/engine/camera_fusion_pre.trtexec_default_2sm.70.plan

原始 trtexec 构建命令:

/usr/src/tensorrt/bin/trtexec \
  --onnx=/home/nvidia/zmf_split_engine/onnx/camera_fusion_pre.onnx \
  --fp16 \
  --inputIOFormats=fp16:chw,fp16:chw \
  --outputIOFormats=fp16:chw \
  --saveEngine=/home/nvidia/zmf_split_engine/engine/camera_fusion_pre.70.plan \
  --memPoolSize=workspace:32768 \
  --skipInference \
  --verbose \
  --dumpLayerInfo \
  --profilingVerbosity=detailed \
  --exportLayerInfo=/home/nvidia/zmf_split_engine/engine/camera_fusion_pre.70.json
  • 完整构建日志:build/problem_2sm_trtexec/trtexec_build.log
  • 原始命令:build/problem_2sm_trtexec/trtexec_build_command.txt
  • 层与 tactic:build/problem_2sm_trtexec/camera_fusion_pre.default_2sm.layers.json
  • 可移植重建脚本:build/rebuild_problem_2sm.sh

该 engine SHA256 为:

45107900340e24ef4fca4f5aabc109db53f4203c8a8969219f8b881d32fbe5b0

它与 A1/A2 证据中路径名为 camera_fusion_pre.editable_default.70.plan 的 engine 字节完全一致,SHA256 均为上述值。

5. 1SM 对照 Engine

对照 engine:model/engine/camera_fusion_pre.editable_depthnet3_1sm.70.plan

仅替换一个 Editable Timing Cache 项:

key:    0x41ac25cf4fb246d28cbb698eee6cff76
tactic: 0x5c2a7a736a61a

层级对比见 build/control_1sm_editable_cache/layer_compare.txt,结果为:

bindings_equal: true
layer_count: 8
changed_tactic_count: 1
changed_index: 6
semantic_comparison: PASS

trtexec CLI 没有按 timing-cache key 精确指定单层 tactic 的参数,所以 1SM 对照 engine 使用 TensorRT Python Editable Timing Cache API 构建。构建脚本、cache、层信息和完整日志均在 build/control_1sm_editable_cache/,可用 build/rebuild_control_1sm.sh 重建。

6. 推理复现

先校验文件:

cd thor_depthnet3_oc3_supplier_handoff_20260801
sha256sum -c SHA256SUMS.txt

运行默认 2SM 问题组:

bash inference/run_problem_2sm.sh

运行单层 1SM 对照组:

bash inference/run_control_1sm.sh

两个脚本最终执行的核心命令分别为:

/usr/src/tensorrt/bin/trtexec \
  --loadEngine=model/engine/camera_fusion_pre.trtexec_default_2sm.70.plan \
  --loadInputs=depth:input/depth.fp16,image_neck_feature:input/image_neck_feature.fp16 \
  --warmUp=1000 --duration=60

/usr/src/tensorrt/bin/trtexec \
  --loadEngine=model/engine/camera_fusion_pre.editable_depthnet3_1sm.70.plan \
  --loadInputs=depth:input/depth.fp16,image_neck_feature:input/image_neck_feature.fp16 \
  --warmUp=1000 --duration=60

脚本会检查 GPU 最大频率、避免与其他 trtexec 或感知节点并发、冷却 30 秒,并保存 trtexec 日志、tegrastats、OC1/OC2/OC3 前后计数和文件哈希。默认结果目录为 reproduction_runs/。

7. 重点排查项

  1. 为什么 TensorRT 10.13.2.6 在 Thor 上为 /depthnet/depthnet.3/Conv 默认选择 2SM tactic,并在持续满吞吐时触发大量 OC3。
  2. 该 2SM tactic 是否存在已知的瞬时电流、调度或 Thor 平台兼容性问题。
  3. 是否可以通过 TensorRT 官方配置、tactic blacklist、algorithm selector 或 builder 参数稳定避开该 tactic,而不依赖手工编辑 timing cache。
  4. 请在相同 Thor 软件栈重建 engine。TensorRT plan 与 GPU/TensorRT 版本强绑定,跨版本或跨硬件直接加载可能失败。

8. 目录说明

model/onnx/                          最小复现 ONNX
model/engine/                        默认 2SM 与单层 1SM engine
input/                               两个确定性 FP16 输入
build/problem_2sm_trtexec/           原始 trtexec 构建命令、日志、层信息
build/control_1sm_editable_cache/    1SM 对照构建脚本、日志、cache、层对比
inference/evidence/                  A-B-A-B 四轮原始实验记录
inference/*.sh                       可重复执行推理脚本
environment/thor_environment.txt     测试平台软件与功耗配置
SHA256SUMS.txt                       整包完整性校验

Hi,

Have you checked the GPU utilization with nvidia-smi?

Thanks.

$ nvidia-smi
Wed Aug 5 11:37:56 2026
±----------------------------------------------------------------------------------------+
| NVIDIA-SMI 580.00 Driver Version: 580.00 CUDA Version: 13.0 |
±----------------------------------------±-----------------------±---------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA Thor Off | 00000000:01:00.0 Off | N/A |
| N/A 108C N/A 43W / N/A | Not Supported | 86% Default |
| | | Disabled |
±----------------------------------------±-----------------------±---------------------+

±----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| 0 N/A N/A 3994 G /usr/lib/xorg/Xorg 125MiB |
| 0 N/A N/A 4189 G /usr/bin/gnome-shell 92MiB |
| 0 N/A N/A 27142 G /usr/bin/nautilus 26MiB |
| 0 N/A N/A 219021 C /usr/src/tensorrt/bin/trtexec 208MiB |
±----------------------------------------------------------------------------------------+

另有附件为执行 nvidia-smi dmon 的记录文件,请一并参考。
nvidia-smi_dmon.txt (16.7 KB)

Hi,

Thanks for sharing this information.
We need to discuss this internally and will provide more information with you later.

Thanks,

Hi,

We try to reproduce this issue on the latest software release (JetPack 7.2).
But got an error when generating the 1sm engine:

[08/06/2026-16:24:39] [TRT] [V] Marking depthnet_hidden_feature_0 as output: depthnet_hidden_feature
/home/nvidia/build_camera_editable_timing_engine.py:33: DeprecationWarning: Use Deprecated in TensorRT 10.12. Superseded by strong typing. instead.
  tensor.dtype = trt.float16
[08/06/2026-16:24:39] [TRT] [V] could not open /sys/fs/cgroup/memory/memory.limit_in_bytes or /sys/fs/cgroup/memory.max
[08/06/2026-16:24:39] [TRT] [E] ITimingCache::update: Error Code 3: API Usage Error (TimingCacheKey not found In update at /_src/optimizer/api/timingCache.cpp:1419)

Have you met this issue before? Could you also test if you can reproduce this issue on JetPack 7.2?

Thanks.

在 jetpack 7.1 中进行编译时,并未出现如上所示的报错。
客户已经基于 Jetpack 7.1 环境完成开发了,短期内不会切换到 7.2 的,请帮忙在 jetpack 7.1 环境中进行解决,多谢。

Hi,

Testing on the JetPack 7.1 but still got :

[[08/07/2026-14:26:01] [I] TensorRT version: 10.13.3
[08/07/2026-14:26:01] [I] Loading standard plugins
[08/07/2026-14:26:01] [I] [TRT] Loaded engine size: 7 MiB
[08/07/2026-14:26:01] [E] Error[6]: IRuntime::deserializeCudaEngine: Error Code 6: API Usage Error (The engine plan file is not compatible with this version of TensorRT, expecting library version 10.13.3.9 got 
.., please rebuild. In checkEngineVersionCompatible at runtime/api/engine.cpp:825)
[08/07/2026-14:26:01] [E] Engine deserialization failed
[08/07/2026-14:26:01] [E] Got invalid engine!
[08/07/2026-14:26:01] [E] Inference set up failed
&&&& FAILED TensorRT.trtexec [TensorRT v101303] [b9] # /usr/src/tensorrt/bin/trtexec --loadEngine=/home/nvidia/thor_depthnet3_oc3_supplier_handoff_20260801/model/engine/camera_fusion_pre.editable_depthnet3_1sm.70.plan --loadInputs=depth:/home/nvidia/thor_depthnet3_oc3_supplier_handoff_20260801/input/depth.fp16,image_neck_feature:/home/nvidia/thor_depthnet3_oc3_supplier_handoff_20260801/input/image_neck_feature.fp16 --warmUp=1000 --duration=60 --exportTimes=/home/nvidia/thor_depthnet3_oc3_supplier_handoff_20260801/reproduction_runs/control_1sm_20260807_141919/trtexec_times.json

Is your model converted on the JetPack 7.1?

Thanks.

附件为编译成功的工程,其中有

model/engine/camera_fusion_pre.trtexec_default_2sm.70.plan

请查收。
thor_depthnet3_oc3_supplier_handoff_20260801.zip (17.9 MB)

Hi,

[08/06/2026-16:24:39] [TRT] [E] ITimingCache::update: Error Code 3: API Usage Error (TimingCacheKey not found In update at /_src/optimizer/api/timingCache.cpp:1419)

We found that the issue reported above is related to the cache.
Once recreating the timing-cache, how can we decide the override-key and override-key?

Prefer to use the files generated locally since this helps our internal team to test this issue in the environment they need.

Thanks.

尊敬的 NVIDIA 技术支持团队:

我们在 NVIDIA Thor 平台(Jetson Linux R38.4,TensorRT 10.13.3.9)上发现了一个问题:

问题描述:

使用 trtexec 默认构建的 Engine(camera_fusion_pre.trtexec_default_2sm.70.plan),在 /depthnet/depthnet.3/Conv 层选择了 2SM tactic,持续满吞吐推理 60 秒后,OC3 计数器稳定增长(两轮测试增量分别为 +2388 和 +2210)。

作为对照,我们使用 TensorRT Python Editable Timing Cache API 构建了另一个 Engine(camera_fusion_pre.editable_depthnet3_1sm.70.plan),仅修改了第 6 层(/depthnet/depthnet.3/Conv)的一个 Timing Cache 项:

    Key: 0x41ac25cf4fb246d28cbb698eee6cff76

    Tactic: 0x5c2a7a736a61a(对应 1SM)

其余 7 个 TensorRT 层、输入数据(全零 FP16 张量)、推理参数(warmup=1000, duration=60)、电源配置(120W/mode 1)、GPU 频率(1386000000 Hz)全部保持不变。

对照 Engine 的 OC3 增量在两轮测试中均为 0,层级对比结果为:
text

bindings_equal: true
layer_count: 8
changed_tactic_count: 1
changed_index: 6
semantic_comparison: PASS

结论:

TensorRT 在 Thor 上为 /depthnet/depthnet.3/Conv 层默认选择的 2SM tactic 是触发 OC3 的直接原因。将 tactic 切换为 1SM 后,问题完全消失。

请协助排查该 2SM tactic 是否存在:

瞬时电流尖峰问题

Thor SM 调度器兼容性问题

或 TensorRT 10.13.3.9 在 Thor 上的已知问题

完整的复现包已准备就绪,如需进一步信息,请随时告知。

谢谢!

附件为可复现问题的原始工程,请查收。
thor_depthnet3_oc3_supplier_handoff_20260801.zip (14.3 MB)
本地生成plan文件以及推流
“”"
bash
1、 unzip thor_depthnet3_oc3_supplier_handoff_20260801.zip
2、 cd thor_depthnet3_oc3_supplier_handoff_20260801
3、删除旧的plan文件
cd model/engine
rm -rf *
4、生成新的plan问题文件
cd builld
sudo chmod a+x rebuild_problem_2sm.sh
sudo chmod a+x rebuild_control_1sm.sh
bash rebuild_problem_2sm.sh
bash rebuild_control_1sm.sh
5、执行推理
chmod +x inference/run_problem_2sm.sh
bash inference/run_problem_2sm.sh

sudo chmod a+x run_control_1sm.sh
bash run_control_1sm.sh

“”"

Hi,

In our test, there is no 2sm tactic selected (Test on JetPack 7.2 with TensorRT 10.16).

For the previous TensorRT version, you can modify the tactic with your build_camera_editable_timing_engine.py script directly.

cache.log (178.5 KB)

Thanks.