code: def get_gpu_message(
      detected_num_gpus: int, used_num_gpus: int, strategy: str
  ):
      """
      Get the GPU related info (GPU name, total memory, free memory, and CUDA version) for logging.
  
      Parameters
      ----------
      detected_num_gpus
          Number of detected GPUs.
      used_num_gpus
          Number of GPUs to be used.
  
      Returns
      -------
      A string with the GPU info.
      """
  
      def _bytes_to_gigabytes(bytes):
          return round((bytes / 1024) / 1024 / 1024, 2)
  
      gpu_message = f"GPU Count: {detected_num_gpus}\nGPU Count to be Used: {used_num_gpus}\n"
      try:
          import nvidia_smi
      except:
          return gpu_message
  
      for i in range(detected_num_gpus):
          nvidia_smi.nvmlInit()
          handle = nvidia_smi.nvmlDeviceGetHandleByIndex(i)
          info = nvidia_smi.nvmlDeviceGetMemoryInfo(handle)
  
          gpu_mem_used = _bytes_to_gigabytes(info.used)
          gpu_mem_total = _bytes_to_gigabytes(info.total)
          if torch.cuda.is_available():
              gpu_message += (
                  f"GPU {i} Name: {torch.cuda.get_device_name(i)}\n"
              )
          gpu_message += f"GPU {i} Memory: {gpu_mem_used}GB/{gpu_mem_total}GB (Used/Total)\n"
  
      return gpu_message
  
file_path: autogluon/multimodal/src/autogluon/multimodal/utils/log.py
imports: import datetime
  import logging
  import os
  from contextlib import contextmanager
  from typing import Dict, List, Optional, Tuple, Union
  import pytz
  import torch
  from autogluon.common.utils.system_info import get_ag_system_info
label_desc: Use image node_id 8 for calling a global function with example usage: get_gpu_message(detected_num_gpus, used_num_gpus, strategy) and returns: gpu_message, round, gpu_message