Hi,
I have made a minimal reproducible example on the errors reported in my previous posts.
It seems to me that the A / b
operation breaks sonething in the CuArray, which is obscure to the user.
Mysterious as it is, the code can run without errors in the “VSCode + Julia extension” mode.
(base) dabajabaza@XXXX:~$ cat jianguoyun/Nutstore/RigorousCoupledWaveAnalysis.jl-master/examples/test.ma2018.jl
using LinearAlgebra
using CUDA
b = CUDA.rand(ComplexF64,5,5)
A = CUDA.rand(ComplexF64,5,5)
w = CUDA.rand(ComplexF64,5)
#V = A \ b
V = A / b
V * w
(base) dabajabaza@XXXX:~$ julia jianguoyun/Nutstore/RigorousCoupledWaveAnalysis.jl-master/examples/test.ma2018.jl
ERROR: LoadError: CUBLASError: an invalid value was used as an argument (code 7, CUBLAS_STATUS_INVALID_VALUE)
Stacktrace:
[1] throw_api_error(res::CUDA.CUBLAS.cublasStatus_t)
@ CUDA.CUBLAS ~/.julia/packages/CUDA/DfvRa/lib/cublas/error.jl:50
[2] macro expansion
@ ~/.julia/packages/CUDA/DfvRa/lib/cublas/error.jl:63 [inlined]
[3] cublasZgemv_v2(handle::Ptr{Nothing}, trans::Char, m::Int64, n::Int64, alpha::Bool, A::CuArray{ComplexF64, 2, CUDA.Mem.DeviceBuffer}, lda::Int64, x::CuArray{ComplexF64, 1, CUDA.Mem.DeviceBuffer}, incx::Int64, beta::Bool, y::CuArray{ComplexF64, 1, CUDA.Mem.DeviceBuffer}, incy::Int64)
@ CUDA.CUBLAS ~/.julia/packages/CUDA/DfvRa/lib/utils/call.jl:26
[4] gemv!
@ ~/.julia/packages/CUDA/DfvRa/lib/cublas/wrappers.jl:331 [inlined]
[5] gemv_dispatch!(Y::CuArray{ComplexF64, 1, CUDA.Mem.DeviceBuffer}, A::CuArray{ComplexF64, 2, CUDA.Mem.DeviceBuffer}, B::CuArray{ComplexF64, 1, CUDA.Mem.DeviceBuffer}, alpha::Bool, beta::Bool)
@ CUDA.CUBLAS ~/.julia/packages/CUDA/DfvRa/lib/cublas/linalg.jl:179
[6] mul!
@ ~/.julia/packages/CUDA/DfvRa/lib/cublas/linalg.jl:188 [inlined]
[7] mul!
@ ~/julia/share/julia/stdlib/v1.7/LinearAlgebra/src/matmul.jl:275 [inlined]
[8] *(A::CuArray{ComplexF64, 2, CUDA.Mem.DeviceBuffer}, x::CuArray{ComplexF64, 1, CUDA.Mem.DeviceBuffer})
@ LinearAlgebra ~/julia/share/julia/stdlib/v1.7/LinearAlgebra/src/matmul.jl:51
[9] top-level scope
@ ~/jianguoyun/Nutstore/RigorousCoupledWaveAnalysis.jl-master/examples/test.ma2018.jl:8
in expression starting at /home/dabajabaza/jianguoyun/Nutstore/RigorousCoupledWaveAnalysis.jl-master/examples/test.ma2018.jl:8
(base) dabajabaza@XXXX:~$
(base) dabajabaza@XXXX:~$ julia --version
julia version 1.7.2
(base) dabajabaza@XXXX:~$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Thu_Nov_18_09:45:30_PST_2021
Cuda compilation tools, release 11.5, V11.5.119
Build cuda_11.5.r11.5/compiler.30672275_0
(base) dabajabaza@XXXX:~$
(base) dabajabaza@XXXX:~$ julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.7.2 (2022-02-06)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> using CUDA
julia> CUDA.version
version (generic function with 2 methods)
julia> CUDA.version()
v"11.5.0"
julia>