Replicator slow and overloads GPU

Description of problem
My 2022.1 code using SyntheticDataHelper was failing, so I updated it to use Replicator instead. I have pasted the relevant code below. Once I start recording, the PC starts taking off like an airplane with loud turbines and the code produces some warnings and errors (also below). The code is ran as an asynchronous function, I also attempted to detach the render product after use but it didn’t really help. The fan chills out when I pause the simulation and continues after, while the print output indicates the program has already left the replicator code and moved on to doing nothing (I only call that “get” function once at the very end of the code).
TLDR
The problems, it seems, are the following:

  1. One render product cannot have multiple annotators? Am I supposed to have several instances of the same render product?
  2. flatcache seems to be running out of space?
  3. Some warning related to “camera” duplicates that I can’t make sense of.
  4. The replicator output seems to be topdown rather than from the actual camera path in the render product

Relevant code

...
rp = rep.create.render_product("/World/CameraStand_Closup/CameraCloseup", 
                                                                    resolution=(120, 160))
...
        self.annotators = dict(
            rgb = rep.AnnotatorRegistry.get_annotator("rgb"),
            instanceSegmentation = rep.AnnotatorRegistry.get_annotator("instance_segmentation"),
            pointcloud = rep.AnnotatorRegistry.get_annotator("pointcloud"),
        )
...
    async def get(self, topics):
        """ Returns a dict with all requested data. """
        sdh_topics = [t for t in topics if t in self.sdh_topics]
        non_sdh_topics = [t for t in topics if t not in self.sdh_topics]

        await rep.orchestrator.step_async()
        gt = dict()
        for t in sdh_topics:
            gt[t] = self.annotators[t].get_data(device="cuda")

        for t in non_sdh_topics:
            #### Other code

        return copy(gt)
...
    async def snap_async(self, topics, rp, filename=None, timestamp=None):

        # rp = render_product
        for k in self.sdh_topics:
            self.annotators[k].attach(rp)
        
        gt = await self.get(topics)
        self.save_topics(gt, filenum=filename, topics=topics)
        
        for k in self.sdh_topics:
            rep.AnnotatorRegistry.detach(self.annotators[k], rp)
        return gt

Log

2023-01-24 09:11:57 [74,993ms] [Warning] [carb.flatcache.plugin] UsdRelationship /Render/RenderProduct_Replicator.orderedVars has multiple targets, which is not supported

2023-01-24 09:11:57 [75,001ms] [Warning] [carb.flatcache.plugin] PathToAttributesMap (0x26eb11c0) contains attributes with duplicate name "camera" with different types but same per-element size. Data may become corrupted during request to move elements between buckets!
2023-01-24 09:12:00 [77,203ms] [Warning] [carb.flatcache.plugin] getTfType called on non-existent path /World/CameraStand_Closup/CameraCloseup

2023-01-24 09:12:00 [77,203ms] [Warning] [omni.syntheticdata.plugin] Trying to access 8 bytes from /World/CameraStand_Closup/CameraCloseup.cameraProjectionType, but flatcache has only 0 bytes
2023-01-24 09:12:00 [77,203ms] [Warning] [omni.syntheticdata.plugin] Trying to access 8 bytes from /World/CameraStand_Closup/CameraCloseup.clippingRange, but flatcache has only 0 bytes
2023-01-24 09:12:00 [77,203ms] [Warning] [omni.syntheticdata.plugin] Trying to access 4 bytes from /World/CameraStand_Closup/CameraCloseup.focalLength, but flatcache has only 0 bytes
Module omni.replicator.core.ogn.python._impl.nodes.OgnSemanticSegmentation load on device 'cuda:0' took 2.43 ms
2023-01-24 09:12:00 [77,241ms] [Error] [omni.kit.app._impl] [py stderr]: /home/dennisushi/Documents/Kit/apps/Isaac-Sim/exts/franka_copycat/com/copycat/app/synthetic_data_watch.py:103: UserWarning: topic camera is not handled by SD Get Watch
  warnings.warn("topic %s is not handled by SD Get Watch"%t)

I added rep.orchestrator.stop() to the end of the get and that seems to solve most my issues for now ( But presumably if I ran it for more than one frame, it would still annoying). Now the warnings are only:

2023-01-24 09:56:34 [878,817ms] [Warning] [carb.flatcache.plugin] UsdRelationship /Render/RenderProduct_Replicator.orderedVars has multiple targets, which is not supported

2023-01-24 09:56:34 [878,826ms] [Warning] [carb.flatcache.plugin] PathToAttributesMap (0x28977e60) contains attributes with duplicate name "camera" with different types but same per-element size. Data may become corrupted during request to move elements between buckets!
Module omni.replicator.core.ogn.python._impl.nodes.OgnSemanticSegmentation load on device 'cuda:0' took 1.60 ms

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