CUDA error:an illegal memory access was encountered

my GPU:GTX 3060 laptop (6GB)
I created my own little four-legged robot,and I can train it normally with maximum of 512 robots.
BUT when I use the gymapi create_box to add a box to environment,I can only run 1 environment,if run 2 env,It comes this error:an illegal memory access was encountered.
I can’t believe it,because I can run original env franka_cabinet with hundreds of envs in parallel.So how can my 3060 GPU can’t even deal with this little box plus robot?

Hi,

Perhaps double check the indexing in your code to make sure you are not trying to access any invalid locations of the buffers. It may help to debug on CPU first.

I had the same problem. It would run fine on CPU, but only break on GPU. The issue seemed to be when invoking “set_dof_state_tensor_indexed” using all of the actor indices. Changing the call to only use actor indices of the robot fixed it for me.

I am not sure if this is a bug, it seems like it, as the api documentation for the function suggests all indices should be able to passed, especially given the fact that it worked for CPU.

Hi, How did you fix the issue? Let say I have 10 environments and 5 actors in each, If I want to reset only the first actor in each environment, how do I modify the call so that I don’t get the error?

hello,I also encountered the same problem .Whenever I call ‘gym.set_dof_state_tensor_indexed’,I will report this error.The strange thing is that I changed the number of environments to 1 and it can run,and it also run on the cpu