Advanced API Performance: CPUs (original) (raw)

This post covers CPU best practices when working with NVIDIA GPUs. To get a high and consistent frame rate in your applications, see all Advanced API Performance tips.

To get the best performance from your NVIDIA GPU, pair it with efficient work delegation on the CPU. Frame-rate caps, stutter, and other subpar application performance events can often be traced back to a bottleneck on the CPU. Use the following tips to understand what you should do and what to avoid.

Multithreading and workload balancing

No amount of GPU work optimization will overcome a CPU bottleneck. Evenly balance work across all threads for best results.

ExecuteCommandLists and multiple command queues

ExecuteCommandLists submits an array of command lists (ECL) to the GPU for execution. NVIDIA hardware supports multiple command queues to parallelize graphics work, enabling graphics-compute or compute-compute work to be performed concurrently.

Resource allocation and destruction

Creating and destroying buffers, textures, and shaders is fundamental to efficient computer graphics.

BuildRaytracingAccelerationStructure

Ray tracing acceleration structures are data structures that organize the geometric information of a scene to optimize the intersection tests between rays and scene objects. BuildRaytracingAccelerationStructure performs the initial construction of the acceleration structure with the scene geometry.

For more information, see Best Practices: Using NVIDIA RTX Ray Tracing.

CreatePipelineState and CreateStateObject

CreatePipelineState is used to create a rendering pipeline state object that defines the configuration of the graphics pipeline. The pipeline state object encapsulates all of the state required to execute a graphics command, such as the input layout, shader programs, blending state, depth-stencil state, and rasterizer state.

CreateStateObject enables developers to create a state object that encapsulates the state of the graphics pipeline as a whole. The state object includes the pipeline state object created using CreatePipelineState, as well as other state information such as the viewport, scissor rectangle, and input layout.

About the Authors