code: def test_total_mem_on_dev(backend_fw):
      with BackendHandler.update_backend(backend_fw) as ivy_backend:
          devices = _get_possible_devices()
          for device in devices:
              if "cpu" in device:
                  assert (
                      ivy_backend.total_mem_on_dev(device)
                      == psutil.virtual_memory().total / 1e9
                  )
              elif "gpu" in device:
                  handle = ivy_backend.functional.ivy.device._get_nvml_gpu_handle(
                      device
                  )
                  gpu_mem = pynvml.nvmlDeviceGetMemoryInfo(handle)
                  assert (
                      ivy_backend.total_mem_on_dev(device)
                      == gpu_mem.total / 1e9
                  )
  
imports: import io
  import multiprocessing
  import os
  import re
  import shutil
  import sys
  import warnings
  import numpy
  import psutil
  import subprocess
  from hypothesis import strategies, assume
  import ivy
  import ivy_tests.test_ivy.helpers
  import ivy_tests.test_ivy.helpers.globals
  from ivy_tests.test_ivy.helpers import handle_test, BackendHandler
label_desc: Use image node_id 28 for calling a global function with example usage: test_total_mem_on_dev(backend_fw) without return types