Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pointer to async_send directly instead of a wrapper function #1319

Merged
merged 2 commits into from
Jan 12, 2022

Conversation

vchuravy
Copy link
Member

Fixes #1314

@ericphanson can you check that this fixes your issue?

@ericphanson
Copy link

Sure, I'll give it a try

@ericphanson
Copy link

it crashes at the same place it used to segfault, saying

ERROR: LoadError: could not load symbol "async_send":
julia: undefined symbol: async_send
Stacktrace:
  [1] launch(f::CUDA.var"#13#14"{Base.Event}; stream::CuStream)
    @ CUDA ~/.julia/packages/CUDA/ZRjZ5/lib/cudadrv/execution.jl:157
  [2] nonblocking_synchronize
    @ ~/.julia/packages/CUDA/ZRjZ5/lib/cudadrv/stream.jl:157 [inlined]
  [3] macro expansion
    @ ~/.julia/packages/CUDA/ZRjZ5/src/array.jl:409 [inlined]
  [4] macro expansion
    @ ~/.julia/packages/CUDA/ZRjZ5/src/state.jl:182 [inlined]
  [5] unsafe_copyto!(dest::Matrix{Float32}, doffs::Int64, src::CuArray{Float32, 2, CUDA.Mem.DeviceBuffer}, soffs::Int64, n::Int64)
    @ CUDA ~/.julia/packages/CUDA/ZRjZ5/src/array.jl:405
  [6] copyto!
    @ ~/.julia/packages/CUDA/ZRjZ5/src/array.jl:359 [inlined]
  [7] copyto!
    @ ~/.julia/packages/CUDA/ZRjZ5/src/array.jl:363 [inlined]
  [8] copyto_axcheck!(dest::Matrix{Float32}, src::CuArray{Float32, 2, CUDA.Mem.DeviceBuffer})
    @ Base ./abstractarray.jl:1104
  [9] Array
    @ ./array.jl:563 [inlined]
 [10] Array
    @ ./boot.jl:481 [inlined]
 [11] convert
    @ ./array.jl:554 [inlined]
 [12] adapt_storage
    @ ~/.julia/packages/Adapt/wASZA/src/arrays.jl:6 [inlined]
 [13] adapt_structure
    @ ~/.julia/packages/Adapt/wASZA/src/Adapt.jl:42 [inlined]
 [14] adapt
    @ ~/.julia/packages/Adapt/wASZA/src/Adapt.jl:40 [inlined]
 [15] adapt_storage
    @ ~/.julia/packages/Flux/BPPNj/src/functor.jl:75 [inlined]
 [16] adapt_structure
    @ ~/.julia/packages/Adapt/wASZA/src/Adapt.jl:42 [inlined]
 [17] adapt
    @ ~/.julia/packages/Adapt/wASZA/src/Adapt.jl:40 [inlined]
 [18] #134
    @ ~/.julia/packages/Flux/BPPNj/src/functor.jl:115 [inlined]
 [19] fmap(f::Flux.var"#134#135", x::CuArray{Float32, 2, CUDA.Mem.DeviceBuffer}; exclude::typeof(Functors.isleaf), walk::typeof(Functors._default_walk), cache::IdDict{Any, Any})
    @ Functors ~/.julia/packages/Functors/hIysk/src/functor.jl:121
 [20] fmap
    @ ~/.julia/packages/Functors/hIysk/src/functor.jl:120 [inlined]
 [21] cpu(x::CuArray{Float32, 2, CUDA.Mem.DeviceBuffer})
    @ Flux ~/.julia/packages/Flux/BPPNj/src/functor.jl:115
[truncated where it reaches my code]

lib/cudadrv/execution.jl Outdated Show resolved Hide resolved
@vchuravy
Copy link
Member Author

it crashes at the same place it used to segfault, saying

I was a silly goose.

@ericphanson
Copy link

Success! No segfault or other issues

@codecov
Copy link

codecov bot commented Jan 12, 2022

Codecov Report

Merging #1319 (0aea816) into master (51a03ba) will decrease coverage by 0.80%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1319      +/-   ##
==========================================
- Coverage   80.48%   79.67%   -0.81%     
==========================================
  Files         119      119              
  Lines        8393     8400       +7     
==========================================
- Hits         6755     6693      -62     
- Misses       1638     1707      +69     
Impacted Files Coverage Δ
lib/cudadrv/execution.jl 89.65% <100.00%> (-6.90%) ⬇️
lib/cudadrv/occupancy.jl 75.86% <0.00%> (-15.81%) ⬇️
lib/cublas/util.jl 83.67% <0.00%> (-8.17%) ⬇️
src/compiler/exceptions.jl 88.23% <0.00%> (-5.89%) ⬇️
lib/cusolver/multigpu.jl 91.17% <0.00%> (-5.15%) ⬇️
lib/cusolver/linalg.jl 84.37% <0.00%> (-4.69%) ⬇️
lib/cudadrv/module/jit.jl 65.51% <0.00%> (-3.45%) ⬇️
src/compiler/gpucompiler.jl 80.64% <0.00%> (-3.23%) ⬇️
src/initialization.jl 43.18% <0.00%> (-3.16%) ⬇️
... and 24 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 51a03ba...0aea816. Read the comment docs.

@maleadt maleadt added the bugfix This gets something working again. label Jan 12, 2022
@maleadt
Copy link
Member

maleadt commented Jan 12, 2022

Great, thanks!

@maleadt maleadt merged commit 605c822 into master Jan 12, 2022
@maleadt maleadt deleted the vc/sysimage branch January 12, 2022 06:35
@ericphanson
Copy link

could we get a release with this fix?

@maleadt
Copy link
Member

maleadt commented Jan 21, 2022

Yes, I'll work on a release today.

@ericphanson
Copy link

thanks!

simonbyrne pushed a commit to simonbyrne/CUDA.jl that referenced this pull request Nov 13, 2023
…U#1319)

Due to a Julia bug, we can't use `@cfunction` with a custom system image.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This gets something working again.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Segfault with CUDA in a sysimage
3 participants