Skip to content

Falcor 8.0: How to use the profiler in a Python script? #485

@tyouthfor

Description

@tyouthfor

In docs/usage/scripting.md, there is an example about how to capture profiling data over 256 frames and print the mean GPU frame render time:

m.profiler.enabled = True
m.profiler.startCapture()
for frame in range(256):
    m.renderFrame()
capture = m.profiler.endCapture()
m.profiler.enabled = False

meanFrameTime = capture["events"]["/onFrameRender/gpuTime"]["stats"]["mean"]
print(f"Mean frame time: {}", meanFrameTime)

However, when I run a similar Python script, an error is reported: AttributeError: 'falcor.falcor_ext.Profiler' object has no attribute 'startCapture'. So how to use the profiler in a Python script correctly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions