Skip to content

Bug in NVPModel for default power mode #672

@inadob

Description

@inadob

Issue Summary:

Running jtop fails due to the jtop.service not starting correctly. Restarting the service is suggested but it doesn't fix the issue. The service encounters an error during the initialization of the NVPModel object, which leads to a service crash and a subsequent auto-restart attempt every 10 seconds.

The jtop.service in not active. Please run:
sudo systemctl restart jtop.service.

Steps to Reproduce:

  1. Run $ jtop in terminal.
  2. Jtop doesn't start and the following is displayed:
The jtop.service in not active. Please run:
sudo systemctl restart jtop.service.
  1. Running $ sudo systemctl restart jtop.service as suggested doesn't fix the problem
  2. Use $ sudo journalctl -u jtop.service -f --no-pager to monitor service logs
Image Service starts briefly and shows active status but then it fails during NVPModel initialization. After crashing, it subsequently auto-restarts the attempts. The automatic restart needs to be explicitly stopped.

Environment:

  • Jetson AGX Orin 64GB developer kit
  • L4T R36.4.4
  • Ubuntu 22.04 Jammy Jellyfish
  • JetPack = 6.2.1
  • nvpmodel (NVIDIA Power Model Tool) = 1.1.4

Technical Details:

The bug originates from jtop/core/nvpmodel.py
The nvpmodel tool manages the power modes on NVDIA Jetson devices. In order to visualize power mode information, jtop intializes NVPModel object, when jtop.service starts. This involves querying the system for its current power mode by using $ nvpmodel -q (run by the nvpmodel_query() function) and then using regex to match the pattern "NV Power Mode: " from the output to parse a value (e.g. "NV Power Mode: MODE_30W"). However, if the default power mode is used and the user hasn't explicitly switched it, the result is:

$ nvpmodel -q 
`NVP WARN: power mode is not set !` 

so a regex match is not found and the function nvpmodel_query() returns None instead of a dictionary to _nvpmodel_now. This makes _nvpmodel_now["name"] to crash.

Image

Possible workaround:
Suppressing the visualization of the power mode information in jtop is a temporary workaround and this doesn't resolve the issue. Apply the changes here

Image

To fully fix the bug, modifications to the nvpmodel_query() function needs to be made to cover the case where the default power mode is used. It is possible that L4T R36.4.4 which isn't currently supported by jetson-stats, comes with an upgraded version of the nvpmodel tool library which introduces some differences in how it outputs the information when the default power mode is used compared to the previously supported versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions