class_docstr: Manager that fetches system related info
class_docstr_tok: ["Manager","that","fetches","system","related","info"]
docstr: Grep gpu free memory from nvidia-smi tool.
  This function can fail due to many reasons(driver, nvidia-smi tool, envs, etc) so please simply use
  it as a suggestion, stay away with any rules bound to it.
  E.g. for a 4-gpu machine, the result can be list of int
  >>> print(get_gpu_free_memory)
  >>> [13861, 13859, 13859, 13863]
docstr_tok: ["Grep","gpu","free","memory","from","nvidia-smi","tool",".","This","function","can","fail","due","to","many","reasons","(","driver",",","nvidia-smi","tool",",","envs",",","etc",")","so","please","simply","use","it","as","a","suggestion",",","stay","away","with","any","rules","bound","to","it",".","E.g",".","for","a","4-gpu","machine",",","the","result","can","be","list","of","int",">",">",">","print","(","get_gpu_free_memory",")",">",">",">","[","13861",",","13859",",","13859",",","13863","]"]
code: def get_gpu_free_memory():
      """Grep gpu free memory from nvidia-smi tool.
      This function can fail due to many reasons(driver, nvidia-smi tool, envs, etc) so please simply use
      it as a suggestion, stay away with any rules bound to it.
      E.g. for a 4-gpu machine, the result can be list of int
      >>> print(get_gpu_free_memory)
      >>> [13861, 13859, 13859, 13863]
      """
      _output_to_list = lambda x: x.decode("ascii").split("\n")[:-1]
  
      try:
          COMMAND = "nvidia-smi --query-gpu=memory.free --format=csv"
          memory_free_info = _output_to_list(
              subprocess.check_output(COMMAND.split())
          )[1:]
          memory_free_values = [
              int(x.split()[0]) for i, x in enumerate(memory_free_info)
          ]
      except:
          memory_free_values = []
      return memory_free_values
  
imports: import logging
  import multiprocessing
  import os
  import shutil
  import subprocess
  from typing import Union
  from autogluon.common.utils.try_import import try_import_ray
  from .distribute_utils import DistributedContext
  from .lite import disable_if_lite_mode
  from .utils import bytes_to_mega_bytes
label_desc: Use image node_id 5 for calling the ResourceManager obj's underlying member method code with example usage: obj.get_gpu_free_memory() and returns: memory_free_values