Graphics processing units (GPUs) are used in a wide variety of processors to facilitate the processing and rendering of objects for display. The GPU includes a plurality of processing elements, referred to as shaders, to execute instructions, thereby creating images for output to a display. Typically, an incoming instruction set, referred to as a graphics workload, will make varying demands on the shaders of the GPU, such that the one set of shaders may take a much longer time to complete their assigned tasks for a given workload than another set of shaders takes to complete their assigned tasks. Such a workload imbalance can create a processing bottleneck at the GPU and therefore have a detrimental impact on overall processing efficiency.
The present disclosure may be better understood, and its numerous features and advantages made apparent to those skilled in the art by referencing the accompanying drawings. The use of the same reference symbols in different drawings indicates similar or identical items.
To illustrate, in many graphics applications, the same or a similar graphics workload is typically received by the GPU repeatedly. By creating a resource allocation for each graphics workload that adjusts resources such as applied voltage, clock frequency, engine configuration, and memory allocations for each shader, and storing the resource allocation with a workload identifier, the resource allocation may be recalled and applied for subsequent processing of the same or a similar graphics workload. The GPU thus dynamically adapts the resource allocations among shaders and other sub-engines to more efficiently process subsequent graphics workloads.
Driver 110 is a software module that controls how the GPU 100 interacts with the rest of the computer or device in which the GPU 100 is installed. In particular, the driver 110 provides an interface between the GPU 100 and the operating system and/or hardware of the device that includes the GPU 100. In at least one embodiment, the driver 110 supplies graphics workloads, such as graphics workload 112, to the GPU 100 for processing.
The graphics workload 112 is a set of graphics instructions that, when executed, result in the GPU 100 generating one or more objects for display. For example, the graphics workload 112 may be instructions for rendering a frame or portion of a frame of video or static graphics. The GPU 100 distributes the operations required by the graphics workload among the shaders 150-156. In particular, each of the shaders 150-156 is a processing element configured to perform specialized calculations and execute certain instructions for rendering computer graphics. For example, shaders 150-156 may compute color and other attributes for each fragment, or pixel, of a screen. Thus, shaders 150-156 may be two-dimensional (2D) shaders such as pixel shaders, or three-dimensional shaders such as vertex shaders, geometry shaders, or tessellation shaders, or any combination thereof. As described further herein, the shaders work in parallel to execute the operations required by graphics workload 112.
Each graphics workload 112 may present different computational demands for each of the plurality of shaders 150-160. Thus, for example, the graphics workload 112 could require shader SH1150 to perform a large number of calculations while requiring shader SH2152 to perform relatively fewer calculations. As a result of the disparate demands placed on the shaders 150 and 152, shader SH1150 is likely to require a longer time to complete the tasks required by the graphics workload 112 than shader SH2152 may complete its tasks for processing the graphics workload 112 in a shorter time. The longer time for task completion required by the more heavily tasked shader SH1150 may create a bottleneck on the GPU 100, leading to decreased efficiency in processing the graphics workload 112. By redistributing resources such as a supplied voltage, clock frequency, and memory allocation available to each of shaders SH1150 and SH2152, such that shader SH1150 is able to complete each of its assigned calculations at a faster rate than shader SH2152, the likelihood or impact of a bottleneck is reduced.
To facilitate allocation of resources among the shaders 150-156, the GPU 100 includes a performance monitor 102, a resource allocation module 104, a control module 120, a voltage module 122, a clock module 124, and a memory allocation module 126. The performance monitor 102 is a module configured to record performance characteristics at different modules of the GPU 100, including the shaders 150-156. Thus, the performance monitor 102 records individual performance information for each of the shaders 150-156, such as cache hit rate, cache miss rate, instructions or operations per cycle executed at the shader, stalls at the shader, and the like. The performance monitor 102 thus records a performance profile across the shaders 150-156. In some embodiments, the performance monitor 102 records the performance information on a “per-workload” basis. That is, in response to the driver 110 providing a new workload to the GPU 100, the performance monitor 102 resets its stored performance information, so that at a given instance of time the performance information stored at the performance monitor 102 indicates performance characteristics for the currently executing, or most recently executed, graphics workload.
The resource allocation module 104 is generally configured to generate a resource allocation 132 for the shaders 150-156 based on performance information recorded by the performance monitor 102. In particular, the resource allocation module 104 is configured to generate the resource allocation 132 to allocate more resources to shaders having higher resource needs as indicated by the performance information recorded at the performance monitor 102. To illustrate, in some embodiments the resource allocation module 104 generates the resource allocation 132 to assign a voltage, clock frequency, and amount of memory resources to be allocated to each of the shaders 150-156. The resource allocation module 104 generates the resource allocation to assign a higher voltage, clock frequency, amount of memory resources, or a combination thereof, to shaders whose performance information indicates a higher processing demand at the shader. Thus, for example, if the performance information for a given shader indicates that the shader is generating a high number of memory access requests, the resource allocation module 104 generates the resource allocation 132 to assign a higher amount of memory resources to that shader than to shaders generating fewer memory access requests.
The control module 120, voltage module 122, clock module 124, and memory allocation module 126 are generally configured to supply resources to the shaders 150-156 based on the resource allocation 132. To illustrate, the voltage module 122 is generally configured to provide an individual reference voltage to each of the shaders 150-156, wherein each shader uses the reference voltage to set the threshold voltage for transistors and other components of the shader. The voltage module 122 sets the reference voltage for each shader individually, and may therefore set the reference voltage for one shader to a different level than the reference voltage for a different shader. The clock module 124 is configured to supply clock signals to each of the shaders 150-156, and may set the frequency of the clock signal supplied to each shader individually. Thus, the clock module 124 may supply a clock signal to one shader at a higher frequency than the clock signal supplied to a different shader. The memory allocation module 126 is configured to supply parameters to each of the shaders 150-156 indicating memory resources allocated to that shader. The parameters can include, for example, address information, pointer information, and the like indicating what memory resources have been assigned to a shader. The memory allocation module 126 may supply different parameters to different shaders, thereby assigning different memory resources to each shader.
The control module 120 is generally configured to control each of the voltage module 122, clock module 124, and memory allocation module 126, such that each module supplies resources to the shaders 150-156 according to the resource allocation 132. Thus, the control module 120 provides control signaling to the voltage module 122 so that the voltage module 122 provides reference voltages to the shaders 150-156, wherein the reference voltage provided to each shader is individually indicated by the resource allocation 132. Similarly, the control module 120 provides control signaling to the clock module 124 and the memory allocation module 126 so that the modules supply a clock signal and memory resource parameters, respectively, to the shaders 150-156 as indicated by the resource allocation 132. The control module 120 thereby allocates the resources of the GPU 100 to the shaders 150-156 individually according to the resource allocation 132. This allows the GPU 100 to individually tailor the resource allocation among the shaders 150-156 based on the graphics workload 112, reducing the likelihood that the workload will cause a bottleneck at one of the shaders 150-156, or reducing the duration of any such bottleneck.
In some embodiments, the recording of performance information by the performance monitor 102 and the generation of the resource allocation 132 by the resource allocation module 104 impacts performance at the GPU 100 by, for example, consuming power, reducing the speed with which the GPU 100 can execute operations, and the like. Accordingly, to reduce the performance impact, the GPU 100 records the resource allocation for a workload at a memory 140. In response to subsequently receiving the same or a similar workload from the driver 110, the GPU 100 applies the stored resource allocation to the shaders 150-156 to process the workload.
To illustrate, the driver 110 provides each workload to the GPU 100 with an accompanying workload identifier, such as workload identifier 130 for graphics workload 112. The control module 120 accesses the memory 140 to determine if there is a stored resource allocation corresponding to the workload identifier. If not, the control module 120 informs the resource allocation module and performance monitor 102, which together generate a resource allocation for the graphics workload as described above. Based on the resource allocation, the control module 120 controls the voltage module 122, clock module 124, and memory allocation module 126 to provide resources individually to the shaders 150-156. In addition, the control module 120 stores the resource allocation along with the corresponding workload identifier at the memory 140.
When the workload is again supplied by the driver 110 at a subsequent time, the control module 120 identifies that the workload identifier is stored at the memory 140. In response, the control module 120 retrieves the stored resource allocation from the memory 140, and controls the voltage module 122, clock module 124, and memory allocation module 126 to supply resources to the shaders 150-156 according to the stored resource allocation. By storing resource allocations at the memory 140 and applying the stored resource allocation for each instance of a given workload, the GPU 100 efficiently assigns resources for different workloads without significantly impacting processing performance.
In the example of
Returning to block 404, if the control module 120 determines that the memory 140 does not store an identifier for the received graphics workload, the method flow proceeds to block 410 and the control module 120 provides operations of the received workload to the shaders 150-156 for execution. In some embodiments, the control module 120 provides control signaling to the voltage module 122, the clock module 124, and the memory allocation module 126 to provide substantially equal resources to each of the shaders 150-156 to execute the operations, such as the same reference voltage, the same clock signal frequency, and similar memory allocation parameters. At block 412, the performance monitor 102 records performance information for the shaders 150-156 based on their execution of the operations for the received workload. Based on the performance information, the resource allocation module 104 generates a resource allocation for the shaders 150-156 to reduce potential bottlenecks for the workload. At block 411 the control module 120 receives the generated resource allocation and at block 416 the control module 120 stores the resource allocation at the memory 140 along with the identifier for the graphics workload upon which the resource allocation is based. The method flow returns to block 402 for the GPU 100 to receive another graphics workload.
In some embodiments, certain aspects of the techniques described above may implemented by one or more processors of a processing system executing software. The software comprises one or more sets of executable instructions stored or otherwise tangibly embodied on a non-transitory computer readable storage medium. The software can include the instructions and certain data that, when executed by the one or more processors, manipulate the one or more processors to perform one or more aspects of the techniques described above. The non-transitory computer readable storage medium can include, for example, a magnetic or optical disk storage device, solid state storage devices such as Flash memory, a cache, random access memory (RAM) or other non-volatile memory device or devices, and the like. The executable instructions stored on the non-transitory computer readable storage medium may be in source code, assembly language code, object code, or other instruction format that is interpreted or otherwise executable by one or more processors.
Note that not all of the activities or elements described above in the general description are required, that a portion of a specific activity or device may not be required, and that one or more further activities may be performed, or elements included, in addition to those described. Still further, the order in which activities are listed are not necessarily the order in which they are performed. Also, the concepts have been described with reference to specific embodiments. However, one of ordinary skill in the art appreciates that various modifications and changes can be made without departing from the scope of the present disclosure as set forth in the claims below. Accordingly, the specification and figures are to be regarded in an illustrative rather than a restrictive sense, and all such modifications are intended to be included within the scope of the present disclosure.
Benefits, other advantages, and solutions to problems have been described above with regard to specific embodiments. However, the benefits, advantages, solutions to problems, and any feature(s) that may cause any benefit, advantage, or solution to occur or become more pronounced are not to be construed as a critical, required, or essential feature of any or all the claims. Moreover, the particular embodiments disclosed above are illustrative only, as the disclosed subject matter may be modified and practiced in different but equivalent manners apparent to those skilled in the art having the benefit of the teachings herein. No limitations are intended to the details of construction or design herein shown, other than as described in the claims below. It is therefore evident that the particular embodiments disclosed above may be altered or modified and all such variations are considered within the scope of the disclosed subject matter. Accordingly, the protection sought herein is as set forth in the claims below.