Python: error when loading >10,000 instances in Code

I have a python script that loads 10,384 instances of a USDA model of a heliostat. They load fine without any issues. I then try to re-orient each one using their XformOp:rotateXYZ. I tested it with just a few thousands without a problem, but when I do it on 10,384, I get this error:
“OSError: [Errno 22] Invalid argument”.
This happens approximately at around 3000-5000, and it happens even if I simply execute a prim.GetPropertyNames(). I run this remotely on a workstation with an RTX 3080. I have exactly the same issue locally, on a laptop with a RTX 2060.
Thank you.

Hi @zambetti1! Welcome to the forums! Could you provide a bit more info?

  1. Could you share the logs files from when the error occurred. More info on that here: How to Report an issue with Omniverse
  2. Are you just using omni.usd and pxr APIs? Are you using omni.client at all?
  3. Is the USD layer you’re authoring stored on local disk or a Nucleus server?
  4. How are you executing the python script? In the script editor? Some other way?
  5. Could you share a sample of the code?

Thank you!

After I sent the requested information, I found something that may be of interest. Somehow (I don’t remember how) I suspected that “print” statements may be the cause of the error. Indeed, after I commented out all “print” statement in the code, I was able to run the transformation on al >10,000 heliostats without that error showing up. My guess it’s a bug.

Hi @zambetti1. Sorry, I didn’t see your logs and information come through. Did you maybe submit them via email or the portal?

print in large loops like that should generally be avoided because it causes performance issues in Python. Can you try using carb.log_info to see if that produces similar issues?

e-mail. I’ll try carb.log_info and see if it works.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.