code: def test_specific_gpus(save_gpu_ids_shutdown_only):
      allowed_gpu_ids = [4, 5, 6]
      os.environ["CUDA_VISIBLE_DEVICES"] = ",".join(
          [str(i) for i in allowed_gpu_ids]
      )
      ray.init(num_gpus=3)
  
      @ray.remote(num_gpus=1)
      def f():
          gpu_ids = ray.get_gpu_ids()
          assert len(gpu_ids) == 1
          assert int(gpu_ids[0]) in allowed_gpu_ids
  
      @ray.remote(num_gpus=2)
      def g():
          gpu_ids = ray.get_gpu_ids()
          assert len(gpu_ids) == 2
          assert int(gpu_ids[0]) in allowed_gpu_ids
          assert int(gpu_ids[1]) in allowed_gpu_ids
  
      ray.get([f.remote() for _ in range(100)])
      ray.get([g.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 2 for calling a global function with example usage: test_specific_gpus(save_gpu_ids_shutdown_only) without return types