class_docstr: AMD GPU accelerators.
class_docstr_tok: ["AMD","GPU","accelerators","."]
code: def get_current_node_num_accelerators() -> int:
      num_gpus = 0
  
      if sys.platform.startswith("linux"):
          try:
              num_gpus = (
                  len(
                      subprocess.check_output(
                          ["rocm-smi", "-i", "--csv"]
                      )
                      .decode("utf-8")
                      .strip()
                      .split("\n")
                  )
                  - 1
              )
          except Exception:
              pass
      return num_gpus
  
file_path: ray/python/ray/_private/accelerators/amd_gpu.py
imports: import os
  import sys
  import logging
  import subprocess
  from typing import Optional, List, Tuple, Dict, Any
  from ray._private.accelerators.accelerator import AcceleratorManager
label_desc: Use image node_id 4 for calling the AMDGPUAcceleratorManager obj's underlying member method code with example usage: obj.get_current_node_num_accelerators() and returns: num_gpus