code: def get_gpu_count():
      """get avaliable gpu count
  
      Returns:
          gpu_count: int
      """
  
      gpu_count = 0
  
      env_cuda_devices = os.environ.get("CUDA_VISIBLE_DEVICES", None)
      if env_cuda_devices is not None:
          assert isinstance(env_cuda_devices, str)
          try:
              if not env_cuda_devices:
                  return 0
              gpu_count = len(
                  [
                      x
                      for x in env_cuda_devices.split(",")
                      if int(x) >= 0
                  ]
              )
              logger.info(
                  "CUDA_VISIBLE_DEVICES found gpu count: {}".format(
                      gpu_count
                  )
              )
          except:
              logger.info(
                  "Cannot find available GPU devices, using CPU or other devices now."
              )
              gpu_count = 0
      else:
          try:
              gpu_count = str(
                  subprocess.check_output(["nvidia-smi", "-L"])
              ).count("UUID")
              logger.info(
                  "nvidia-smi -L found gpu count: {}".format(gpu_count)
              )
          except:
              logger.info(
                  "Cannot find available GPU devices, using CPU or other devices now. (Please check whether you can execute `nvidia-smi` command.)"
              )
              gpu_count = 0
      return gpu_count
  
file_path: PARL/parl/utils/machine_info.py
imports: import os
  import platform
  import random
  import socket
  import subprocess
  from parl.utils import logger, _HAS_FLUID, _HAS_PADDLE, _IS_WINDOWS
label_desc: Use image node_id 2 for calling a global function with example usage: get_gpu_count() and returns: gpu_count, int