From cf2244f1ef89b4f967e820e1800fa2fd64479361 Mon Sep 17 00:00:00 2001 From: lizhenyu Date: Mon, 29 Mar 2021 16:42:02 +0800 Subject: [PATCH] [bugfix]Not set device id in asynchronous compile and run graph --- mindspore/ccsrc/runtime/device/gpu/gpu_kernel_runtime.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/mindspore/ccsrc/runtime/device/gpu/gpu_kernel_runtime.cc b/mindspore/ccsrc/runtime/device/gpu/gpu_kernel_runtime.cc index 7890a8f77f..504b722392 100644 --- a/mindspore/ccsrc/runtime/device/gpu/gpu_kernel_runtime.cc +++ b/mindspore/ccsrc/runtime/device/gpu/gpu_kernel_runtime.cc @@ -71,6 +71,7 @@ bool GPUKernelRuntime::Init() { enable_relation_cache_ = context::GraphKernelFlags::GetInstance().IsEnableGraphKernel(); if (device_init_ == true) { + CHECK_OP_RET_WITH_EXCEPT(CudaDriver::SetDevice(UintToInt(device_id_)), "Failed to set device id"); GPUMemoryAllocator::GetInstance().CheckMaxDeviceMemory(); return true; }