Skip to content

Commit

Permalink
cuda : clear error after changing peer access (ggerganov#10153)
Browse files Browse the repository at this point in the history
  • Loading branch information
slaren authored Nov 4, 2024
1 parent 05697f6 commit ea02c75
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ggml/src/ggml-cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1297,11 +1297,17 @@ static void ggml_cuda_set_peer_access(const int n_tokens, int main_device) {
cudaError_t err = cudaDeviceEnablePeerAccess(id_other, 0);
if (err != cudaErrorPeerAccessAlreadyEnabled) {
CUDA_CHECK(err);
} else {
// reset the error
cudaGetLastError();
}
} else {
cudaError_t err = cudaDeviceDisablePeerAccess(id_other);
if (err != cudaErrorPeerAccessNotEnabled) {
CUDA_CHECK(err);
} else {
// reset the error
cudaGetLastError();
}
}
}
Expand Down

0 comments on commit ea02c75

Please sign in to comment.