code: def test_local_mode_gpus(save_gpu_ids_shutdown_only):
      allowed_gpu_ids = [4, 5, 6, 7, 8]
      os.environ["CUDA_VISIBLE_DEVICES"] = ",".join(
          [str(i) for i in allowed_gpu_ids]
      )
  
      from importlib import reload
  
      reload(ray._private.worker)
  
      ray.init(num_gpus=3, local_mode=True)
  
      @ray.remote
      def f():
          gpu_ids = ray.get_gpu_ids()
          assert len(gpu_ids) == 3
          for gpu in gpu_ids:
              assert int(gpu) in allowed_gpu_ids
  
      ray.get([f.remote() for _ in range(100)])
  
file_path: ray/python/ray/tests/test_advanced_6.py
imports: import logging
  import os
  import platform
  import signal
  import sys
  import time
  import psutil
  import pytest
  import ray
  import ray.cluster_utils
  from ray._private.test_utils import run_string_as_driver_nonblocking, wait_for_condition, wait_for_pid_to_exit
label_desc: Use image node_id 3 for calling a global function with example usage: test_local_mode_gpus(save_gpu_ids_shutdown_only) without return types