Skip to content

Commit 69043ee

Browse files
findmywaymaleadt
andauthored
Address a corner case when establishing p2p access (#2457)
Co-authored-by: Tim Besard <tim.besard@gmail.com>
1 parent 763164d commit 69043ee

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/cudadrv/context.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,13 @@ function maybe_enable_peer_access(src::CuDevice, dst::CuDevice)
402402
enable_peer_access(context(dst))
403403
peer_access[][src_idx, dst_idx] = 1
404404
catch err
405-
@warn "Enabling peer-to-peer access between $src and $dst failed; please file an issue." exception=(err,catch_backtrace())
406-
peer_access[][src_idx, dst_idx] = -1
405+
if err.code == CUDA.CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED
406+
@warn "Peer-to-peer access between $src and $dst was unexpectedly already enabled"
407+
CUDA.peer_access[][src_idx, dst_idx] = 1
408+
else
409+
@warn "Enabling peer-to-peer access between $src and $dst failed; please file an issue." exception=(err,catch_backtrace())
410+
CUDA.peer_access[][src_idx, dst_idx] = -1
411+
end
407412
end
408413
end
409414
else

0 commit comments

Comments
 (0)