-
Notifications
You must be signed in to change notification settings - Fork 7
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
CuGPU not defined error #244
Comments
Did you try |
Yes, this is with |
Ok may need DynamicGrids.CuGPU |
I just tried I simplified it to the simplest code that gives me the error, which is:
and results in:
The same thing happens with either |
If you are on julia-1.10.2, then I could reproduce, and it seems to require the same workaround as in #243: (@v1.10) pkg> activate --temp
Activating new project at `/tmp/jl_7aYPFi`
(jl_G6yIEw) pkg> add DynamicGrids#dev, CUDA
julia> DynamicGrids.CuGPU()
CuGPU{32}() |
But if you are trying the README, you'll then face julia> using CUDAKernels, CUDA
│ Package CUDAKernels not found, but a package named CUDAKernels is available from a registry.
│ Install package?
│ (jl_G6yIEw) pkg> add CUDAKernels
└ (y/n/o) [y]:
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package CUDAKernels [72cfdca4]:
CUDAKernels [72cfdca4] log:
├─possible versions are: 0.1.0-0.4.7 or uninstalled
├─restricted to versions * by an explicit requirement, leaving only versions: 0.1.0-0.4.7
└─restricted by compatibility requirements with KernelAbstractions [63c18a36] to versions: uninstalled — no versions left
└─KernelAbstractions [63c18a36] log:
├─possible versions are: 0.1.0-0.9.18 or uninstalled
└─restricted to versions 0.9 by DynamicGrids [a5dba43e], leaving only versions: 0.9.0-0.9.18
└─DynamicGrids [a5dba43e] log:
├─possible versions are: 0.21.4 or uninstalled
└─DynamicGrids [a5dba43e] is fixed to version 0.21.4 |
We should really release a new version. The problem is its a breaking version and I'm not sure all the breaks make sense, and there are likely a few more on the way. But I have been working on branches for over a year now, So |
Indeed, the breaking changes made me give up for now, as I just wanted to show your awesome package to a colleague.
Nice, and just to be clear, #244 (comment) was with |
Yeah... my aim is to get work back on main and registered soon. But my other more general packages have been taking most of my time, plus PhD constraints. I actually use this constantly in all of my work, but not in a stable-releases kind of way... |
Thank you! I had been using an older version of Julia (1.7.3) because it was available on the cluster I was using, but I installed 1.10.2 myself, and used |
Reopening because I thought my further errors were unrelated, but now I'm thinking they are related. If it's not related, I'm glad to separate this out. Any insight on this? Am I missing some change I need to make to use the GPU? All I have changed is the value of I'm using this code, which works with Full error:
|
Ok. So first make sure your model runs fine with e.g. Then you need to be 100% sure all of the code inside your Those errors all suggest that things like this are happening. You really dont want to allocate inside To fix this I suggest running your CPU simulations for a few seconds using ProfileView.jl Any red (instability) or yellow (allocations) patches in the inner function calls will mean that your model wont run on a GPU. Cthulhu.jl can help, you can click on the ProfileView.jl profile and call There is a method As for the cluster, get your manager to add 1.10, its much better :) (honestly here I never end up using a cluster because with no allocations my desktop is happy to run my sims a million times!) |
Oops you had linked it. This is certainly a problem, allocating an upordown=sample([1,-1]) use StaticArrays.jl, and: sample(@SVector[1, -1]) As is: collect(1:8) Just use Basically, you should never allocate or write to any array inside a rule other than writing to a grid with e.g. |
This is also bad, what is the reason to do this? The neighborhood is alread a StaticArrays nbrvalues = [neighborhood[1],neighborhood[2],neighborhood[3],neighborhood[4],neighborhood[5],neighborhood[6],neighborhood[7],neighborhood[8]] |
This nv=p*nbrvalues./(p*nbrvalues+fill(cell*(1-p),8)) nv=p.*neighborhood./(p.*neighborhood.+cell.*(1-p) Also broadcast everything else so it fuses. |
I am trying to change my simulation to use GPUs rather than just CPUs. I changed
sim!(output, spec_rule,nbr_rule; proc = ThreadedCPU(), boundary=Wrap())
to use "CuGPU" instead of "ThreadedCPU", but then I get the error:nested task error: UndefVarError: CuGPU not defined
What other changed are required for
CuGPU()
to be recognized?The text was updated successfully, but these errors were encountered: