mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-08-18 05:56:00 -04:00
CUDA: fix peer access logic (#3231)
This commit is contained in:
14
ggml-cuda.cu
14
ggml-cuda.cu
@@ -6286,12 +6286,14 @@ void ggml_cuda_set_peer_access(const int n_tokens) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
int canAccessPeer;
|
int can_access_peer;
|
||||||
CUDA_CHECK(cudaDeviceCanAccessPeer(&canAccessPeer, id, id_other));
|
CUDA_CHECK(cudaDeviceCanAccessPeer(&can_access_peer, id, id_other));
|
||||||
if (enable_peer_access) {
|
if (can_access_peer) {
|
||||||
CUDA_CHECK(cudaDeviceEnablePeerAccess(id_other, 0));
|
if (enable_peer_access) {
|
||||||
} else {
|
CUDA_CHECK(cudaDeviceEnablePeerAccess(id_other, 0));
|
||||||
CUDA_CHECK(cudaDeviceDisablePeerAccess(id_other));
|
} else {
|
||||||
|
CUDA_CHECK(cudaDeviceDisablePeerAccess(id_other));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user