-
Notifications
You must be signed in to change notification settings - Fork 188
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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 is not allowed on GPU array (KH instability) #3522
Comments
What line triggers the error? |
@sangeethasankar01 if you post the whole error message that you get with the stack trace we will understand more which line triggered this error. |
This is an error message I am getting from my code. Please share your comments on how to resolve this issue. |
thanks! ps: enclosing code/error in triple backticks
makes it much more readable. (You can edit the post and enclose the error msg in triple backticks) |
seems that the issue is coming from
I'll try to reproduce this. |
Try rescale_factor = CUDA.@allowscalar √(target_kinetic_energy / energy[1, 1, 1]) |
You might have to call using CUDA at the top of the script. |
@glwagner As you mentioned, I attempted to follow your suggestion by specifying the Code:
Error:
To solve this error, I tried to add the same comment
Thank you. I genuinely appreciate your support. Please let me know about your suggestion about the added comment line (whether it is correct or not). |
@navidcy I already called this comment at the top of the script. However, I faced the same issue that I mentioned. |
Let me try to run the script on GPU. |
Please find the details below.
|
Can you show the |
Writing Taking a look at the script: https://github.com/CliMA/Oceananigans.jl/blob/main/examples/kelvin_helmholtz_instability.jl we see that there are calls to getindex in a few places:
Wherever we write However, where we write But note that @sangeethasankar01 are you trying to get this to run on the GPU for some specific purpose? Or is this merely an educational exercise? I also think we should convert this issue to a discussion. I don't think we want to make these changes to the example in the source code. |
I am a research scholar at IIT Madras, working under the supervision of Dr. Arjun Jagannathan. Currently, I'm exploring various problems related to flow instabilities. However, my current focus on this Kelvin-Helmholtz instability problem is purely for educational practice. I aim to understand the architecture of the code and optimize it for GPU execution. |
I made the below changes only to enable this code to run on the GPU. Change:1
Change:2
Could you please review this and provide your suggestions? |
Ideally you don't want (I'll convert this Issue into a Discussion btw.) |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
@glwagner I am attempting to run the Kelvin-Helmholtz instability example on a GPU, but the model fails and throws errors. Can someone help me to sort out this error? Please find the attached error below:
The text was updated successfully, but these errors were encountered: