Skip to content

Commit 94252eb

Browse files
slarenggerganov
authored andcommitted
cuda : clear error after changing peer access (llama/10153)
1 parent b2620b2 commit 94252eb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/ggml-cuda.cu

Lines changed: 6 additions & 0 deletions
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)