Use nvperfhud to analyze 3D programs

Source: Internet
Author: User

Nvperfhud is a good 3DProgramDebugging tool, which is part of nvperfkit and developed by NVIDIA when writing d3d programs (it cannot view OpenGL programs) by adding a simple statement, you can use nvperfhud to debug the video card.

Download the Installation File (including the document) Here, which provides detailed instructions for use.

Recently, it is more and more convenient to use, so here we will talk about the two most recently used features.

 

1. Use frame debugger to view the rendering of a single frame.

 

(1) In the frame debugger, you can see the Rendering sequence of the polygon, the textures used for each rendering (such as drawindexedprimtives) command, and the rendering target (such as the cache or texture) the number of calls to rendering commands.

(2) These contents are usually what we need. For example, when we use an engine, the engine usually sorts the Rendering sequence of objects and materials, as a result, our color mixing cannot achieve the expected effect. In this case, you can use framedebugger to view the order in which the pass of the object and its material is rendered, and then you can find out the possible causes of the problem, it also helps us understand how the engine works.

(3) For texture, we can check whether it is what we expect. Place the mouse over the texture in the framedebugger window to display the texture value (such as the rgba value) of the mouse position ), this is especially useful for textures rendered in real time or textures written into data dynamically.

(4) On the Advanced page, you can also see the vertices and shard shader programs used. We can check the actual value of the parameter passed to the coloring program to determine whether it is correct.

2. determine performance bottlenecks

 


 

Optimization of the part that is not the bottleneck will not improve the performance of the program, so to optimize the program, you must first find out where the performance bottleneck is. For example, the sequence for determining the performance bottleneck is to start from the last section of the rendering pipeline. Of course, if you can probably guess where the bottleneck is, you can check it directly.

(1) change the color cache from 32-bit to 16-bit in the program, and check whether the FPS value is increased to determine whether the bottleneck is caused by the real frame cache bandwidth.

(2) press Ctrl + T in nvperfhud to forcibly set the texture to 2*2 and check whether the FPS value is increased to determine whether the bottleneck is caused by the texture bandwidth.

(3) press Ctrl + 1, CTRL + 2… In nvperfhud ...... CTRL + 9, nvperfhud will automatically force the pixel shader program of each profile to check whether the FPS value is increased to determine whether the bottleneck is caused by complicated pixel programs.

(4) press Ctrl + V in nvperfhud to remove the vertex unit and check whether the FPS value increases to determine whether the bottleneck is caused by vertex processing, including the transmission of vertex/index cache, vertex shader program, and invalid cache lock.

(5) change the size of the vertex format in the program and check whether the FPS value is increased. If so, the bottleneck is transmitted in the vertex/index cache.

(6) You can use Ctrl + n to remove the GPU operation, that is, the GPU computing speed is infinitely fast. If the FPS increases, the bottleneck is on the CPU.

 

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/huangchonghai/archive/2010/07/27/5769385.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.