code: def test_cuda_visible_devices(ray_start_cluster, connect_to_client):
      @ray.remote(num_gpus=1)
      def f():
          return os.environ["CUDA_VISIBLE_DEVICES"]
  
      cluster = ray_start_cluster
      num_nodes = 1
      for _ in range(num_nodes):
          cluster.add_node(num_gpus=1)
      ray.init(address=cluster.address)
  
      with connect_to_client_or_not(connect_to_client):
          g1 = ray.util.placement_group([{"CPU": 1, "GPU": 1}])
          o1 = f.options(
              scheduling_strategy=PlacementGroupSchedulingStrategy(
                  placement_group=g1
              )
          ).remote()
  
          devices = ray.get(o1)
          assert devices == "0", devices
          placement_group_assert_no_leak([g1])
  
imports: import pytest
  import os
  import sys
  import ray
  import ray.cluster_utils
  from ray._private.test_utils import get_other_nodes, wait_for_condition, is_placement_group_removed, placement_group_assert_no_leak
  from ray._raylet import PlacementGroupID
  from ray.util.placement_group import PlacementGroup
  from ray.util.scheduling_strategies import PlacementGroupSchedulingStrategy
  from ray.util.client.ray_client_helpers import connect_to_client_or_not
  from ray._private.runtime_env.context import RuntimeEnvContext
  from ray._private.runtime_env.plugin import RuntimeEnvPlugin
label_desc: Use image node_id 6 for calling a global function with example usage: test_cuda_visible_devices(ray_start_cluster, connect_to_client) and returns: os