class_docstr: Nvidia GPU accelerators.
class_docstr_tok: ["Nvidia","GPU","accelerators","."]
code: def get_current_node_accelerator_type() -> Optional[str]:
      import ray._private.thirdparty.pynvml as pynvml
  
      try:
          pynvml.nvmlInit()
      except pynvml.NVMLError:
          return None  # pynvml init failed
      device_count = pynvml.nvmlDeviceGetCount()
      cuda_device_type = None
      if device_count > 0:
          handle = pynvml.nvmlDeviceGetHandleByIndex(0)
          device_name = pynvml.nvmlDeviceGetName(handle)
          if isinstance(device_name, bytes):
              device_name = device_name.decode("utf-8")
          cuda_device_type = (
              NvidiaGPUAcceleratorManager._gpu_name_to_accelerator_type(
                  device_name
              )
          )
      pynvml.nvmlShutdown()
      return cuda_device_type
  
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 5 for calling the NvidiaGPUAcceleratorManager obj's underlying member method code with example usage: obj.get_current_node_accelerator_type() and returns: cuda_device_type, None