rbonghi / jetson_stats

📊 Simple package for monitoring and control your NVIDIA Jetson [Orin, Xavier, Nano, TX] series
https://rnext.it/jetson_stats
GNU Affero General Public License v3.0
2.08k stars 250 forks source link

Crash if dpkg is missing #521

Open evildeeds opened 1 month ago

evildeeds commented 1 month ago

Describe the bug

If dpkg is missing, for example if the system is a custom built yocto with meta-tegra then the following line will cuse an exception https://github.com/rbonghi/jetson_stats/blob/e22b49f0250cd1b81aaa4a311af51d01cf219cf1/jtop/core/jetson_variables.py#L203 on line 204

To Reproduce

  1. Install jetson_stats on a system without dpkg; or forcefully unistall dpkg; or change line 203 to an invalid command
  2. Remove or rename /etc/nv_tegra_release if it exists
  3. (re-)start the jtop service
  4. See error in service log

Expected behavior

Looking at the function get_nvidia_l4t the intended behavior I would expect is to fail the version detection and return an empty string instead of crashing.

Perhaps check that dpkg exist first and if not then return false from check_dpkg_nvidia_l4t_core.

Board

evildeeds commented 1 month ago

My solution will be to populate my image with /etc/nv_tegra_release