class_docstr: Nvidia GPU accelerators.
class_docstr_tok: ["Nvidia","GPU","accelerators","."]
code: def get_current_node_num_accelerators() -> int:
      import ray._private.thirdparty.pynvml as pynvml
  
      try:
          pynvml.nvmlInit()
      except pynvml.NVMLError:
          return 0  # pynvml init failed
      device_count = pynvml.nvmlDeviceGetCount()
      pynvml.nvmlShutdown()
      return device_count
  
file_path: ray/python/ray/_private/accelerators/nvidia_gpu.py
imports: import re
  import os
  import logging
  from typing import Optional, List, Tuple
  from ray._private.accelerators.accelerator import AcceleratorManager
label_desc: Use image node_id 4 for calling the NvidiaGPUAcceleratorManager obj's underlying member method code with example usage: obj.get_current_node_num_accelerators() and returns: device_count, int