**ERROR**: invalid argument before /hoomd/GPUArray.h:997

224 views
Skip to first unread message

jude vishnu

unread,
Jul 22, 2022, 5:46:01 AM7/22/22
to hoomd-users
Dear all,
I am trying to add new bonds to my system, each having a different type so that I can set different parameters to each of them. I was doing this in hoomd 2.9.7 without any issue. But I get the error as attached in the text file in hoomd 3.3.
I tried to debug this and I could see that if I set the types of the new bonds to be of same, the simulation runs without problems.But when there are multiple types this error arises.  Will some one be able to point me in the right direction on what I could be doing wrong here.
minimal.py
initial_FeringGel_nbeads_19_kT_1.0.gsd
errorbonds.txt

Joshua Anderson

unread,
Jul 22, 2022, 8:32:35 AM7/22/22
to hoomd...@googlegroups.com
Jude,

Thanks for the clear report. Running your script in compute-sanitizer shows that there is an invalid argument to the bond force compute kernel.

```
compute-sanitizer python minimal.py                                                                                                            
========= COMPUTE-SANITIZER                                                                                                                                                                    
61126                                                                                                                                                                                          
========= Program hit cudaErrorInvalidValue (error 1) due to "invalid argument" on CUDA API call to cudaLaunchKernel.                                                                          
=========     Saved host backtrace up to driver entry point at error                                                                                                                           
=========     Host Frame: [0x34fb13]                                                                                                                                                           
=========                in /lib/x86_64-linux-gnu/libcuda.so.1                                                                                                                                 
=========     Host Frame:cudaLaunchKernel [0x69c78]                                                                                                                                            
=========                in /usr/local/cuda/lib64/libcudart.so.11.0                                                                                                                            
=========     Host Frame:hipError_t hoomd::md::kernel::gpu_compute_bond_forces<hoomd::md::EvaluatorBondFENE, 2>(hoomd::md::kernel::bond_args_t<2> const&, hoomd::md::EvaluatorBondFENE::param_ty
pe const*, unsigned int*) [0x70a69d]
```

I am not available to further troubleshoot this until August 4. Perhaps someone else can look into this while I am out. 

Your minimal script is rather complicated, so I can't tell whether this invalid argument is caused by your input or a bug in HOOMD. It would be easier to understand if you provided a gsd file with the actual configuration you run. That way, I could inspect the configuration for errors.
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan

--
You received this message because you are subscribed to the Google Groups "hoomd-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hoomd-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hoomd-users/3fb6e9d5-4a97-45b5-8b76-13b055cc8a5an%40googlegroups.com.
<minimal.py><initial_FeringGel_nbeads_19_kT_1.0.gsd><errorbonds.txt>

jude vishnu

unread,
Jul 22, 2022, 9:47:09 AM7/22/22
to hoomd-users
Dear Joshua,
Is there a limit to number of fene bond types, one can set in hoomd 3.3. I am asking this because when I decrease the number of bond types, it started working.

I did one more test where I replaced fenebonds by harmonic spring bonds. The simulation ran without any issues. I do not know whether this can help some one with debugging the issue, but I just wanted to let you know.
I am also attaching the gsd file build after making these bonds and minimal script for running the files.

Hope this would help in finding the issue.

Regards,
Jude

config.gsd
mini2.py

Joshua Anderson

unread,
Jul 22, 2022, 12:16:25 PM7/22/22
to hoomd...@googlegroups.com
Jude,

Yes, there is a limit on the number of bond types. The bond interaction parameters for all types are stored in shared memory on the GPU, which is a limited resource. The limit should be in the thousands and will be different for FENE and Harmonic. This limit has not changed since HOOMD v2.

Are you making the same mistake Jasper made in his recent message? The bond.types field should only contain unique types, not one type per bond. See: https://groups.google.com/g/hoomd-users/c/Mw2jVtsEatw

------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan

jude vishnu

unread,
Jul 22, 2022, 1:35:48 PM7/22/22
to hoomd...@googlegroups.com
Dear Joshua,
I think I have unique bonds. I have in a total of 2049 bond types in my system.
There are a total of 20888 bonds of which 18840 are of type 'R-X' *typeid=0  and the remaining bonds(2048) should have unique types because I want them to have different interactions. I checked this by running  a numpy script and comparing to the results from ovito. 
I also ran the same script on a cpu instead of using a gpu and it runs. May be I am using up the shared memory, but if that is the case I do not know how this code previously worked in 2.9.7 version of hoomd. If there is anymore tests you have in mind, please let me know.

Regards,
Jude





--
Yours truly,
Jude Ann Vishnu

Joshua Anderson

unread,
Aug 1, 2022, 10:24:35 AM8/1/22
to hoomd...@googlegroups.com
Jude,

Yes, HOOMD uses shared memory to store the bond parameters on the GPU for efficient random access. This optimizes for the most common case where there are at most tens of bond parameters in any given force field.

Compared to v2.9.7, we added an additional parameter, delta, to the FENE bond. This additional parameter requires additional space in shared memory.

To allow your simulations to run on the GPU, you could submit a pull request that modifies PotentialBondGPU.cuh with an additional code path activated when the requested shared memory exceeds the available. This code path, activated by a boolean template parameter, would not preload `s_params` and use `d_params` directly. It will run at reduced performance compared to the shared memory cache code path, but it will run.
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan

jude vishnu

unread,
Aug 3, 2022, 11:46:02 AM8/3/22
to hoomd-users
Thanks Joshua
Reply all
Reply to author
Forward
0 new messages