-
Notifications
You must be signed in to change notification settings - Fork 201
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
Scalar indexing with CUDA 5.6.0 #4036
Comments
the issue seems to be
in particular, just maximum(model.velocities.u) works properly. However, weirdly enough, also
work properly. |
Actually this is easily explainable because Oceananigans.jl/src/Fields/field.jl Lines 611 to 616 in 19baa39
|
Seems to be connected to the fact that julia> v = model.velocities.u + 5
julia> maximum(v)
ERROR: Scalar indexing is disallowed.
Invocation of getindex resulted in scalar indexing of a GPU array.
This is typically caused by calling an iterating implementation of a method.
Such implementations *do not* execute on the GPU, but very slowly on the CPU,
and therefore should be avoided. |
See what ,ethod gets called with the previous CUDA and also with the updated one. interior(r) is SubArray of CuArray? |
For documentation purposes, with @glwagner we found out that the issue is that the new GPUArrays dispatches function map!(f::F, dest::AbstractArray, A::AbstractArray) where F
for (i,j) in zip(eachindex(dest),eachindex(A))
val = f(@inbounds A[j])
@inbounds dest[i] = val
end
return dest
end We should pin an earlier CUDA version until this issue is solved |
Seems to be connected to JuliaGPU/GPUArrays.jl#580 |
Reductions on Oceananigans seem to not work on GPUs using CUDA 5.6.0 which switched to GPUArrays 11.2.0.
It looks like scalar indexing errors are now popping up. Seems to be connected with the fact that GPUarrays switched to a KernelAbstraction backend. I ll investigate a bit.
MWE:
The text was updated successfully, but these errors were encountered: