def test_gpu_stats_monitor_get_gpu_ids_cuda_visible_devices_integers( device_count_mock, is_available_mock): gpu_ids = GPUStatsMonitor._get_gpu_ids([1, 2]) expected = ["2", "4"] assert gpu_ids == expected
def test_gpu_stats_monitor_get_gpu_ids_cuda_visible_devices_uuids( device_count_mock, is_available_mock): gpu_ids = GPUStatsMonitor._get_gpu_ids([1, 2]) expected = ["GPU-56d78e9f", "GPU-02a46c8e"] assert gpu_ids == expected
def test_gpu_stats_monitor_get_gpu_ids_cuda_visible_devices_unset( device_count_mock, is_available_mock): gpu_ids = GPUStatsMonitor._get_gpu_ids([1, 0]) expected = ["1", "0"] assert gpu_ids == expected