Skip to content

Commit ea02c75

Browse files
authored
cuda : clear error after changing peer access (#10153)
1 parent 05697f6 commit ea02c75

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ggml/src/ggml-cuda.cu

+6
Original file line numberDiff line numberDiff line change
@@ -1297,11 +1297,17 @@ static void ggml_cuda_set_peer_access(const int n_tokens, int main_device) {
12971297
cudaError_t err = cudaDeviceEnablePeerAccess(id_other, 0);
12981298
if (err != cudaErrorPeerAccessAlreadyEnabled) {
12991299
CUDA_CHECK(err);
1300+
} else {
1301+
// reset the error
1302+
cudaGetLastError();
13001303
}
13011304
} else {
13021305
cudaError_t err = cudaDeviceDisablePeerAccess(id_other);
13031306
if (err != cudaErrorPeerAccessNotEnabled) {
13041307
CUDA_CHECK(err);
1308+
} else {
1309+
// reset the error
1310+
cudaGetLastError();
13051311
}
13061312
}
13071313
}

0 commit comments

Comments
 (0)