Error when using CuArrays in the VSCode Julia REPL

If I run

using CuArrays
cu(rand(3))

I get

3-element CuArray{Float32,1,Nothing}:
 0.59194994
 0.6101809
 0.8896474

but if I evaluate the two lines above from VSCode with the Julia extension I get the following error

10-element CuArray{Float32,1,Nothing}:
 0.79257643
 0.14198638
 0.02461351
 0.29941198
 0.3235241
 0.23571241
 0.87274057Internal Error: 
ERROR:  MethodError: no method matching size(::CuArray{Float32,1,Nothing})
The applicable method may be too new: running in world age 27151, while current world is 27168.
Closest candidates are:
  size(::CuArray) at /home/natale/.julia/packages/CuArrays/YFdj7/src/array.jl:181 (method too new to be called from this world context.)
  size(::AbstractArray{T,N}, ::Any) where {T, N} at abstractarray.jl:38
  size(::BitArray{1}) at bitarray.jl:99
  ...
Stacktrace:0.99346745
 [1] treerender
( ::CuArray0.67149717{Float32,
1 ,Nothing0.98319286}) at 
/home/natale/.vscode-server/extensions/julialang.language-julia-0.16.8/scripts/packages/VSCodeServer/src/trees.jl:125

julia> (::VSCodeServer.SubTree) at /home/natale/.vscode-server/extensions/julialang.language-julia-0.16.8/scripts/packages/VSCodeServer/src/trees.jl:54
 [3] repl_getvariables_request(::VSCodeServer.JSONRPC.JSONRPCEndpoint, ::Nothing) at /home/natale/.vscode-server/extensions/julialang.language-julia-0.16.8/scripts/packages/VSCodeServer/src/request_handlers.jl:88
 [4] dispatch_msg(::VSCodeServer.JSONRPC.JSONRPCEndpoint, ::VSCodeServer.JSONRPC.MsgDispatcher, ::Dict{String,Any}) at /home/natale/.vscode-server/extensions/julialang.language-julia-0.16.8/scripts/packages/JSONRPC/src/typed.jl:63
 [5] macro expansion at /home/natale/.vscode-server/extensions/julialang.language-julia-0.16.8/scripts/packages/VSCodeServer/src/VSCodeServer.jl:83 [inlined]
 [6] (::VSCodeServer.var"#53#55"{Bool,String})() at ./task.jl:358

Any ideas what’s going wrong?

It is known issue with the VsCode. Hopefully, it will be fixed in the next release.

I pushed a new release to everyone that hopefully fixes this.

2 Likes