Skip to content

Commit 49ce6f6

Browse files
authored
Merge pull request #3112 from JuliaGPU/tb/multi
Temporarily disable cross-device memory access from kernels
2 parents e0e295f + 08bb31d commit 49ce6f6

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

CUDACore/lib/cudadrv/state.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,12 @@ function Base.get!(constructor::F, x::PerDevice{T}, dev::CuDevice) where {F <: B
459459
if y[id] === nothing || (y[id]::Tuple)[1] !== ctx
460460
Base.@lock x.lock begin
461461
if y[id] === nothing || (y[id]::Tuple)[1] !== ctx
462-
y[id] = (context(), constructor())
462+
# store the device's own context (it may be created during `constructor()`),
463+
# so subsequent lookups — which compare against `device_context(id)`, not
464+
# the currently-active context — hit the cache regardless of which context
465+
# was active when the value was constructed.
466+
value = constructor()
467+
y[id] = (context(dev), value)
463468
end
464469
end
465470
end

CUDACore/src/memory.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -604,10 +604,11 @@ function Base.convert(::Type{CuPtr{T}}, managed::Managed{M}) where {T,M}
604604
end
605605

606606
# set pool visibility
607-
if stream_ordered(source_device)
608-
pool = pool_create(source_device)
609-
access!(pool, state.device, ACCESS_FLAGS_PROT_READWRITE)
610-
end
607+
# XXX: disabled because of NVIDIA bug #6098762
608+
#if stream_ordered(source_device)
609+
# pool = pool_create(source_device)
610+
# access!(pool, state.device, ACCESS_FLAGS_PROT_READWRITE)
611+
#end
611612
end
612613

613614
# accessing memory on another stream: ensure the data is ready and take ownership

0 commit comments

Comments
 (0)