Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

Initialization is not thread safe #215

Closed
maleadt opened this issue Mar 7, 2020 · 1 comment
Closed

Initialization is not thread safe #215

maleadt opened this issue Mar 7, 2020 · 1 comment
Labels

Comments

@maleadt
Copy link
Member

maleadt commented Mar 7, 2020

julia> using CUDAnative, CuArrays
[ Info: Precompiling CuArrays [3a865a2d-5b23-5a0f-bc46-62713ec82fae]

julia> Threads.nthreads()
4

julia> ENV["JULIA_DEBUG"] = "CUDAnative"
"CUDAnative"

julia> kernel() = nothing
kernel (generic function with 1 method)

julia> Threads.@threads for i in 1:10
           @cuda kernel()
       end
ERROR: ┌ Debug: Initializing CUDA on thread 3
└ @ CUDAnative ~/Julia/pkg/CUDAnative/src/init.jl:35
TaskFailedException:
AssertionError: CUDAdrv.jl is not functional
Stacktrace:
 [1] libcuda at /home/tim/Julia/pkg/CUDAdrv/src/CUDAdrv.jl:79 [inlined]
 [2] (::CUDAdrv.var"#615#cache_fptr!#139")() at /home/tim/Julia/pkg/CUDAapi/src/call.jl:31
 [3] macro expansion at /home/tim/Julia/pkg/CUDAapi/src/call.jl:39 [inlined]
 [4] macro expansion at /home/tim/Julia/pkg/CUDAdrv/src/libcuda.jl:153 [inlined]
 [5] macro expansion at /home/tim/Julia/pkg/CUDAdrv/src/error.jl:115 [inlined]
 [6] cuCtxGetCurrent at /home/tim/Julia/pkg/CUDAapi/src/call.jl:93 [inlined]
 [7] CuCurrentContext() at /home/tim/Julia/pkg/CUDAdrv/src/context.jl:84
 [8] context() at /home/tim/Julia/pkg/CUDAnative/src/init.jl:75
 [9] cufunction_fast(::Function, ::Type{T} where T, ::Int64; name::Nothing, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/tim/Julia/pkg/CUDAnative/src/execution.jl:379
 [10] cufunction at /home/tim/Julia/pkg/CUDAnative/src/execution.jl:419 [inlined]
 [11] macro expansion at /home/tim/Julia/pkg/CUDAnative/src/execution.jl:157 [inlined]
 [12] macro expansion at ./REPL[5]:2 [inlined]
 [13] (::var"#2#threadsfor_fun#3"{UnitRange{Int64}})(::Bool) at ./threadingconstructs.jl:61
 [14] (::var"#2#threadsfor_fun#3"{UnitRange{Int64}})() at ./threadingconstructs.jl:28
Stacktrace:
 [1] wait(::Task) at ./task.jl:267
 [2] top-level scope at ./threadingconstructs.jl:69

julia> ┌ Debug: Trying to use artifacts...
└ @ CUDAnative ~/Julia/pkg/CUDAnative/src/bindeps.jl:37
┌ Debug: Using CUDA 10.2.89 from an artifact at /home/tim/Julia/depot/artifacts/93956fcdec9ac5ea76289d25066f02c2f4ebe56e
└ @ CUDAnative ~/Julia/pkg/CUDAnative/src/bindeps.jl:93
┌ Debug: Toolchain with LLVM 8.0.1, CUDA driver 10.2.0 and toolkit 10.2.89 supports devices 3.0, 3.2, 3.5, 3.7, 5.0, 5.2, 5.3, 6.0, 6.1, 6.2, 7.0, 7.2 and 7.5; PTX 3.2, 4.0, 4.1, 4.2, 4.3, 5.0, 6.0, 6.1 and 6.3
└ @ CUDAnative ~/Julia/pkg/CUDAnative/src/bindeps.jl:199
┌ Debug: Incompatibility detected between CUDA and LLVM 8.0+; disabling debug info emission
└ @ CUDAnative ~/Julia/pkg/CUDAnative/src/compiler/irgen.jl:145
# hangs
@maleadt maleadt added the bug label Mar 7, 2020
@maleadt
Copy link
Member Author

maleadt commented Mar 10, 2020

#218

@maleadt maleadt closed this as completed Mar 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant