cuda : clear error after changing peer access (#10153)
This commit is contained in:
parent
05697f670b
commit
ea02c753eb
1 changed files with 6 additions and 0 deletions
|
@ -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);
|
cudaError_t err = cudaDeviceEnablePeerAccess(id_other, 0);
|
||||||
if (err != cudaErrorPeerAccessAlreadyEnabled) {
|
if (err != cudaErrorPeerAccessAlreadyEnabled) {
|
||||||
CUDA_CHECK(err);
|
CUDA_CHECK(err);
|
||||||
|
} else {
|
||||||
|
// reset the error
|
||||||
|
cudaGetLastError();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cudaError_t err = cudaDeviceDisablePeerAccess(id_other);
|
cudaError_t err = cudaDeviceDisablePeerAccess(id_other);
|
||||||
if (err != cudaErrorPeerAccessNotEnabled) {
|
if (err != cudaErrorPeerAccessNotEnabled) {
|
||||||
CUDA_CHECK(err);
|
CUDA_CHECK(err);
|
||||||
|
} else {
|
||||||
|
// reset the error
|
||||||
|
cudaGetLastError();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue