GC usage with simplistic code

I know that this is a (very) old question with probably no good answer to it…but I can’t help understanding a little bit more of it (and checking if I am missing something).

Even with an ultra simplistic code like below…:

from direct.showbase.ShowBase import ShowBase

class Main(ShowBase):
    """Performance baseline"""

    def __init__(self):
        ShowBase.__init__(self)


a = Main()
a.run()

…my graphics card (3080 TI Laptop, latest drivers) is displayed between 28%-33% of usage. As I am aware that P3D does its best to use the full capacity of available resources (which is fine), I still don’t understand what causes such a GC usage with this simple code, as I would expect a much lower usage rate.

Putting sync-video #f (or even sync-flip #f) is making the graphics card usage much higher (which seems fine as well).

So am I missing something? Thanks!

The answer to this is very simple, it’s all about to frequency rendering calls. When the processor has worked out its clock cycle, it is the turn for the video card.

You can try adding this client-sleep 0.001 to Config.prc. This will work if the problem is related to frequency of calls to the graphics card.

I got quite confused by the post because I assumed “GC” meant “Garbage Collector”.

I’m not really sure that “graphics card usage” is such a well-defined measure. I’m not sure what it means in any case. Is it what percentage of the time the GPU command queue has something in it? Is it how much memory is allocated on the GPU? Is it how many of the GPU’s cores are executing something at any given time?

The job of an engine like Panda is to achieve 100% utilization, meaning it tries to make sure the GPU always has commands in the queue. Of course, that’s pretty difficult to do when you’re just showing an empty scene, but there are still a number of commands associated with doing that, like clearing the window as well as whatever the OS’ presentation engine does with the submitted frame. Panda is submitting those as quickly as possible and I’m guessing that’s what is being measured?