code: def get_current_gpu_usage():
      """
      Get the current GPU memory usage.
      """
      if (
          cfg.gpu_mem
          and cfg.device != "cpu"
          and torch.cuda.is_available()
      ):
          result = subprocess.check_output(
              [
                  "nvidia-smi",
                  "--query-compute-apps=pid,used_memory",
                  "--format=csv,nounits,noheader",
              ],
              encoding="utf-8",
          )
          current_pid = os.getpid()
          used_memory = 0
          for line in result.strip().split("\n"):
              line = line.split(", ")
              if current_pid == int(line[0]):
                  used_memory += int(line[1])
          return used_memory
      else:
          return -1
  
file_path: GraphGym/graphgym/utils/device.py
imports: import logging
  import os
  import subprocess
  import numpy
  import torch
  from graphgym.config import cfg
label_desc: Use image node_id 2 for calling a global function with example usage: get_current_gpu_usage() and returns: used_memory, unknown