# CuArrays v2.0.1 results in segmentation fault for LinearAlgebra.mul!

**URL:** https://discourse.julialang.org/t/cuarrays-v2-0-1-results-in-segmentation-fault-for-linearalgebra-mul/36755
**Category:** GPU
**Tags:** cuarrays
**Created:** [March 30, 2020, 6:20pm UTC](https://discourse.julialang.org/t/cuarrays-v2-0-1-results-in-segmentation-fault-for-linearalgebra-mul/36755 "2020-03-30T18:20:15Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![fedoroff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fedoroff/32/53209_2.png) [@fedoroff](https://discourse.julialang.org/u/fedoroff)
#### Post date: [March 30, 2020, 6:20pm UTC](https://discourse.julialang.org/t/cuarrays-v2-0-1-results-in-segmentation-fault-for-linearalgebra-mul/36755/1 "2020-03-30T18:20:15Z")

</div>

The following code with CuArrays v2.0.1 results in segmentation fault on my computer:

```julia
import CuArrays
import LinearAlgebra

N = 1024

y = CuArrays.zeros(N)
x = CuArrays.zeros(N)
A = CuArrays.zeros((N, N))

LinearAlgebra.mul!(y, A, x)

```

```julia
signal (11): Segmentation fault
in expression starting at none:0
unknown function (ip: 0x7f353fd6d319)
unknown function (ip: 0x846075f)
Allocations: 25167531 (Pool: 25160529; Big: 7002); GC: 23
Segmentation fault (core dumped)

```

With previous version of CuArrays v1.7.3 everything works well.  
Additional info:

```julia
julia> versioninfo()
Julia Version 1.4.0
Commit b8e9a9ecc6 (2020-03-21 16:36 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-8.0.1 (ORCJIT, skylake)

julia> import CUDAnative
julia> CUDAnative.version()
v"10.2.89"

$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Fri_Feb__8_19:08:17_PST_2019
Cuda compilation tools, release 10.1, V10.1.105

```

Can you, please, tell me what can be the problem.

---

<div class="post-metadata">

### Author: ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)
#### Post date: [March 31, 2020, 7:10am UTC](https://discourse.julialang.org/t/cuarrays-v2-0-1-results-in-segmentation-fault-for-linearalgebra-mul/36755/2 "2020-03-31T07:10:39Z")

</div>

I can’t reproduce this. Is it always the same short backtrace? Also, for these kind of problems you can directly file an issue on CuArrays.jl.

---

<div class="post-metadata">

### Author: ![fedoroff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fedoroff/32/53209_2.png) [@fedoroff](https://discourse.julialang.org/u/fedoroff)
#### Post date: [March 31, 2020, 7:22am UTC](https://discourse.julialang.org/t/cuarrays-v2-0-1-results-in-segmentation-fault-for-linearalgebra-mul/36755/3 "2020-03-31T07:22:15Z")

</div>

Yes. Only this message every time.  
What is interesting, it seems that the segfault appears only after all the calculations are done.  
For example, I can add “@show CuArrays.collect(y)” after the multiplication and the code will show the array content, but right after it will print the segfault message.

Can it be some inconsistency between the system CUDA v10.1.105 and the one downloaded by CuArrays, v10.2.89?

Should I duplicate it in the issues on github?

---

<div class="post-metadata">

### Author: ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)
#### Post date: [March 31, 2020, 7:31am UTC](https://discourse.julialang.org/t/cuarrays-v2-0-1-results-in-segmentation-fault-for-linearalgebra-mul/36755/4 "2020-03-31T07:31:04Z")

</div>

> [@fedoroff](#):
>
> Can it be some inconsistency between the system CUDA v10.1.105 and the one downloaded by CuArrays, v10.2.89?

The system CUDA should not be used anymore.

Can you try running under gdb: `gdb --args julia`, then `run`, do your thing in the REPL, and when it crashes execute `bt` to see if that gives you a better backtrace.

You can move the conversion to the issue tracker, yes.

---

<div class="post-metadata">

### Author: ![fedoroff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fedoroff/32/53209_2.png) [@fedoroff](https://discourse.julialang.org/u/fedoroff)
#### Post date: [March 31, 2020, 7:56am UTC](https://discourse.julialang.org/t/cuarrays-v2-0-1-results-in-segmentation-fault-for-linearalgebra-mul/36755/5 "2020-03-31T07:56:51Z")

</div>

I opened the issue:  
[https://github.com/JuliaGPU/CuArrays.jl/issues/662](https://github.com/JuliaGPU/CuArrays.jl/issues/662)

And added there the backtrace from gdb.
