File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -197,7 +197,12 @@ include("pool/binned.jl")
197197include (" pool/split.jl" )
198198
199199const pools = PerDevice {AbstractPool} (dev-> begin
200- default_pool = version () >= v " 11.2" ? " cuda" : " binned"
200+ default_pool = if version () >= v " 11.2" &&
201+ attribute (dev, CUDA. DEVICE_ATTRIBUTE_MEMORY_POOLS_SUPPORTED) == 1
202+ " cuda"
203+ else
204+ " binned"
205+ end
201206 pool_name = get (ENV , " JULIA_CUDA_MEMORY_POOL" , default_pool)
202207 pool = if pool_name == " none"
203208 NoPool (; dev, stream_ordered= false )
@@ -209,6 +214,8 @@ const pools = PerDevice{AbstractPool}(dev->begin
209214 SplitPool (; dev, stream_ordered= false )
210215 elseif pool_name == " cuda"
211216 @assert version () >= v " 11.2" " The CUDA memory pool is only supported on CUDA 11.2+"
217+ @assert (attribute (dev, CUDA. DEVICE_ATTRIBUTE_MEMORY_POOLS_SUPPORTED) == 1 ,
218+ " Your device $(name (dev)) does not support the CUDA memory pool" )
212219 NoPool (; dev, stream_ordered= true )
213220 else
214221 error (" Invalid memory pool '$pool_name '" )
You can’t perform that action at this time.
0 commit comments