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; }