Renderdoc is a very userful tool to profile GPU and game. Unreal can support it through renderdoc.dll and using plugins. How can I develop a plug-in to suit renderdoc?
I am not sure directly but I do believe it can support Renderdoc because Cryengine runs it, and Lumberyard is just an early version of Cry. Why not just use the profiler that is built in for Lumberyard? Depending if you want it for profiling or debugging processes.
Renderdoc functions as a standalone tool for taking GPU captures, and that functions with Lumberyard. I’m not sure what you’re looking for in terms of a plugin. Lumberyard includes GPU markers so that, for example, you can see in the tree of events in Renderdoc where the g-buffer pass is happening.
If you’re using Renderdoc or another tool to debug shaders, you’ll want to set r_ShadersDebug=3 in system_windows_pc.cfg, delete dev\Cache<project name>\pc\user\cache to delete your compiled shaders, and then re-run the editor/launcher to re-compile your shaders with debug symbols, so that you can see the actual shader code in RenderDoc. r_ShadersDebug=3 uses unoptimized shaders, which is more useful for debugging, but not for profiling. r_ShadersDebug=4 has debug information, but the shaders are optimized.
Other standalone gpu capture/profiling tools such as pix for windows, nvida nsight, and amd radeon gpu profiler should function similarly, though I have not used them all with Lumberyard, and it’s been a while since I’ve used RenderDoc, so your mileage may vary.
For profiling in-engine, there are some useful cvars you can experiment with: r_stats (see Debugging Cinematic Scenes with Console Variables - Lumberyard User Guide for the different options), r_profiler, and r_profile* (there are a few that start with r_profile)
Hope that helps!
it is important to note that if you profile using Lumberyard cvars you will not have access to GPU data, it only covers the CPU
if you want to have insight on GPU you must use RenderDoc as described above, if you develop for iOS XCode GPU captures work as well from experience!
@Adrien_Hadj-Chaib thanks for the tip about XCode GPU captures for iOS!
It is true that you cannot get fine grained details on GPU performance directly from Lumberyard the way you can from standalone gpu profiling tools. But it can be helpful to note that r_profiler=1 will give you a high level overview of gpu vs cpu timings so you can see if you are cpu bound or gpu bound, and r_profiler=2 will give you gpu timings directly in the editor, broken down by pass, which will give you a high level overview of where your frame time is being spent so that you know where to focus your attention when profiling using standalone tools or when optimizing the content of your levels.
Thank you all. I begin to reaserch some helpful cmd in cosole. Here are some cmd I note like “MemStats”, “r_profiler”, “r_profilerTargetFPS”. Can you list more cmd that about profiling about Cpu usage, Thread, Function call, or other useful cmd? (console cmd doc is so huge that I can’t find it accturally.)
And where can I find detail info about these monitor iterms?
For example, I use “r_profiler 2” cmd and I want to know the meaning about “OPAQUE_PASSES”,“TRANSPARENT_AW” and so on.
I haven’t used the cvars much for cpu usage. I typically start with RadTelemetry (which requires a license) to get a high level idea of what’s going on in a frame, followed by Visual Studio’s built-in CPU profiler Analyze CPU usage in the Performance Profiler - Visual Studio | Microsoft Docs or Very Sleepy Very Sleepy. Personally, I prefer Visual Studio, but I’ve found Very Sleepy is great for connecting to the editor if it’s already running, so I use that if I unexpectedly run into a performance issue, in case it’s something I’m not able to reproduce reliably.
For the passes, the best way is probably to use RenderDoc to debug a frame, which includes those markers, and you can see what work is being done in them. You can also search for them directly in the codebase, and you’ll see something along the lines of PROFILE_LABEL_SCOPE(“OPAQUE_PASSES”);, and you will see where the renderer is submitting that work, to get an idea of what’s included.
very useful experience, thanks a lot!
@Tommy thanks for the precision about being able to profile GPU timing in Editor using r_profile I had forgotten about that. However it will not work if you are profiling on a phone since the GPU is integrated. In that case the LY profiler tool will return all 0 for GPU timing, making XCode captures pretty useful!
I did not realize that, thanks for pointing it out! Learn something new every day