Software Stack
DepthAI
  • DepthAI Components
    • AprilTags
    • Benchmark
    • Camera
    • DetectionNetwork
    • EdgeDetector
    • Events
    • FeatureTracker
    • HostNodes
    • ImageAlign
    • ImageManip
    • IMU
    • Misc
    • Modelzoo
    • NeuralNetwork
    • RecordReplay
    • RGBD
    • Script
    • SpatialDetectionNetwork
    • SpatialLocationCalculator
    • StereoDepth
    • Sync
    • SystemLogger
    • VideoEncoder
    • Visualizer
    • Warp
    • RVC2-specific
  • Advanced Tutorials
  • API Reference
  • Tools

ON THIS PAGE

  • System information
  • Demo
  • Setup
  • Source code
  • Pipeline

System information

This example shows how to get system information (memory usage, cpu usage and temperature) from the board.

Demo

Example script output
Command Line
1Ddr used / total - 0.13 / 414.80 MiB
2  Cmx used / total - 2.24 / 2.50 MiB
3  LeonCss heap used / total - 4.17 / 46.41 MiB
4  LeonMss heap used / total - 2.87 / 27.58 MiB
5  Chip temperature - average: 38.59, css: 39.81, mss: 37.71, upa: 38.65, dss: 38.18
6  Cpu usage - Leon CSS: 7.08%, Leon MSS: 1.48 %
7  ----------------------------------------
8  Ddr used / total - 0.13 / 414.80 MiB
9  Cmx used / total - 2.24 / 2.50 MiB
10  LeonCss heap used / total - 4.17 / 46.41 MiB
11  LeonMss heap used / total - 2.87 / 27.58 MiB
12  Chip temperature - average: 38.59, css: 39.58, mss: 37.94, upa: 38.18, dss: 38.65
13  Cpu usage - Leon CSS: 1.55%, Leon MSS: 0.30 %
14  ----------------------------------------
15  Ddr used / total - 0.13 / 414.80 MiB
16  Cmx used / total - 2.24 / 2.50 MiB
17  LeonCss heap used / total - 4.17 / 46.41 MiB
18  LeonMss heap used / total - 2.87 / 27.58 MiB
19  Chip temperature - average: 38.94, css: 40.04, mss: 38.18, upa: 39.35, dss: 38.18
20  Cpu usage - Leon CSS: 0.56%, Leon MSS: 0.06 %
21  ----------------------------------------
22  Ddr used / total - 0.13 / 414.80 MiB
23  Cmx used / total - 2.24 / 2.50 MiB
24  LeonCss heap used / total - 4.17 / 46.41 MiB
25  LeonMss heap used / total - 2.87 / 27.58 MiB
26  Chip temperature - average: 39.46, css: 40.28, mss: 38.88, upa: 39.81, dss: 38.88
27  Cpu usage - Leon CSS: 0.51%, Leon MSS: 0.06 %
28  ----------------------------------------
  • upa represents the temperature of the SHAVE block
  • dss represents the temperature of the DDR subsystem

Setup

This example requires the DepthAI v3 API, see installation instructions.

Source code

Python

Python

Python
1#!/usr/bin/env python3
2
3import depthai as dai
4
5def printSystemInformation(info: dai.SystemInformation):
6    m = 1024 * 1024 # MiB
7    print(f"Ddr used / total - {info.ddrMemoryUsage.used / m:.2f} / {info.ddrMemoryUsage.total / m:.2f} MiB")
8    print(f"Cmx used / total - {info.cmxMemoryUsage.used / m:.2f} / {info.cmxMemoryUsage.total / m:.2f} MiB")
9    print(f"LeonCss heap used / total - {info.leonCssMemoryUsage.used / m:.2f} / {info.leonCssMemoryUsage.total / m:.2f} MiB")
10    print(f"LeonMss heap used / total - {info.leonMssMemoryUsage.used / m:.2f} / {info.leonMssMemoryUsage.total / m:.2f} MiB")
11    t = info.chipTemperature
12    print(f"Chip temperature - average: {t.average:.2f}, css: {t.css:.2f}, mss: {t.mss:.2f}, upa: {t.upa:.2f}, dss: {t.dss:.2f}")
13    print(f"Cpu usage - Leon CSS: {info.leonCssCpuUsage.average * 100:.2f}%, Leon MSS: {info.leonMssCpuUsage.average * 100:.2f} %")
14    print("----------------------------------------")
15
16# Create pipeline
17pipeline = dai.Pipeline()
18
19# Create system logger node
20sysLog = pipeline.create(dai.node.SystemLogger)
21sysLog.setRate(1)  # 1 Hz
22
23# Create output
24sysLogQueue = sysLog.out.createOutputQueue(maxSize=4, blocking=False)
25
26# Start pipeline
27pipeline.start()
28while pipeline.isRunning():
29    sysInfo = sysLogQueue.get() # Blocking call, will wait until a new data has arrived
30    printSystemInformation(sysInfo)

Pipeline

Need assistance?

Head over to Discussion Forum for technical support or any other questions you might have.