Skip to content

Commit

Permalink
Update memory.py
Browse files Browse the repository at this point in the history
  • Loading branch information
qqice committed Dec 6, 2023
1 parent c83c45d commit 58cf21d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions jtop/core/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import subprocess as sp
from .processes import read_process_table
from .engine import read_engine
from .common import cat, GenericInterface
from .common import cat, check_file, GenericInterface
from .command import Command
# Create logger
logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -425,7 +425,10 @@ def get_status(self, mem_total):
memory['EMC']['online'] = True
# Percentage utilization
# https://forums.developer.nvidia.com/t/real-time-emc-bandwidth-with-sysfs/107479/3
utilization = int(cat(self._root_path + "/debug/cactmon/mc_all"))
if check_file(self._root_path + "/debug/cactmon/mc_all"):
utilization = int(cat(self._root_path + "/debug/cactmon/mc_all"))
else:
utilization = int(cat(self._root_path + "/actmon_avg_activity/mc_all"))
memory['EMC']['val'] = utilization // memory['EMC']['cur']
# Read IRAM if available
if os.path.isdir(self._root_path + "/debug/nvmap/iram"):
Expand Down

0 comments on commit 58cf21d

Please sign in to comment.