运行如下命令:
using CUDAdrv, CUDAnative
using CuArrays: CuArray
println(CUDAdrv.name(CuDevice(0)))
for Typ in (CuArray, Array)
x = Typ(ones(Float32, 5000000))
y = Typ(zeros(Float32, 5000000))
t = @elapsed begin
for i in 0:100
for j in 0:100
y .= x .* 3.2
GPUArrays.synchronize(y)
end
end
end
if y isa CuArray
println("GPU time: ", t)
else
println("CPU time: ", t)
end
end
警告:CUDAnative.jl failed to initialized, GPU functionality unavailable (set JULIA_CUDA_SILENT or JULIA_CUDA_VERBOSE to silence or expand
this message)
错误:ERROR: LoadError: CUDA error: invalid device context (code 201, ERROR_INVALID_CONTEXT)
请问该如何解决?非常感谢!困扰很久了!