janesma / apitrace

for developing frame trace features
24 stars 16 forks source link

FrameRetrace server died #28

Open claudeha opened 5 years ago

claudeha commented 5 years ago

what I did:

$ ~/code/github.com/janesma/apitrace/build/apitrace trace ./Fragmentarium-2.5.0
$ ~/code/github.com/janesma/apitrace/build/frameretrace
load trace
set frame count to 2
host localhost
ok

what I expected:

what happened:

with frame count set to 1, it doesn't error out, but it doesn't show the information I was looking for

excerpt from glxinfo:

Extended renderer info (GLX_MESA_query_renderer):
    Vendor: X.Org (0x1002)
    Device: Radeon RX 580 Series (POLARIS10, DRM 3.27.0, 4.19.0-5-amd64, LLVM 7.0.1) (0x67df)
    Version: 18.3.6
    Accelerated: yes
    Video memory: 8192MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 4.5
    Max compat profile version: 4.5
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2

Debian Buster with apitrace fresh from git

janesma commented 5 years ago

Thanks for trying out FrameRetrace!

A couple of things can be going wrong:

claudeha commented 5 years ago
  1. I'm on the frameretrace branch (remotes/origin/HEAD -> origin/frameretrace)

  2. Good to know, I choose frame 100 out of the 163 in my trace (it told me how many when I entered 1000) and the server survived! However, I just see the API calls and Metrics, all the Shader tabs are blank despite the API calls including glUseProgram(1).

  3. https://mathr.co.uk/tmp/Fragmentarium-2.5.0.trace.7z 1.5MB (compressed from 91MB)

janesma commented 5 years ago

darn, I'm not able to retrace that file, probably because you have a radeon system:

error: failed to create OpenGL 4.1 compat context.

For radeon, the gpu metrics may not be well-supported. You have to compile a 3rd-party library that was written for windows tools. I hacked the source from that project to enable radeon, but I don't know how often that functionality has been used. See:

 apitrace/retrace/daemon/amd_gpa/fetch_gpa.sh

You need that library to see "real" hardware metrics from the GPU.

To see the shader source, you select renders by clicking on the bars in the graph. It should show the programs that were active for the selected renders. Is that not working?

claudeha commented 5 years ago

On 23/08/2019 21:01, Mark Janes wrote:

To see the shader source, you select renders by clicking on the bars in the graph. It should show the programs that were active for the selected renders. Is that not working? Ok, that is working.  But it only seems to show the shaders used by Qt to render the whole application window, and not the shaders used within a Qt widget to render a fractal image (which are the ones I was curious to inspect).  Nor does it show compiled forms, just the source - I have the source of the shaders because the main program is a shader editor.

janesma commented 5 years ago

The implementation that obtains ssa/simd assemblies is done with INTEL_DEBUG={dump_shader_stage}

I don't know if the Mesa radeon driver has a hook to dump compiled shaders, but if it's there, it would not be hard to expose in FrameRetrace. I'm currently hooking up ARB_debug to make the capture more reliable, and would prefer to have the radeon driver dump shader artifacts through that mechanism.

I'll need some help to get radeon compilation artifacts into frameretrace. I work at Intel, and can't dedicate time to that particular feature. If you have an intel gpu, you could probably use it to find performance issues that apply to both platforms.

You may not have selected the render that draws the fractal image. It should be easy to find using the render target tab. Select "highlight render", and "stop at render" and advance through the bars in the graph. I keyboard nav should work with the arrow keys. The selected render should be drawn in pink, and the render target should build up through the renders. Find the one that renders the pixels you are interested in and you should see the program.

If you have misrendering or performance issues, you can edit the shader directly in FrameRetrace and recompile to see if gpu metrics change.