Processing system with selective priority-based two-stage binning

By selecting the loading mode based on performance characteristics and workload priority in battery-powered devices, the trade-off between GPU performance, battery life, and heat dissipation is resolved, optimizing user experience and power consumption, and ensuring the timely execution of high-priority tasks.

CN116762062BActive Publication Date: 2026-11-20ADVANCED MICRO DEVICES INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202180075915.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2021-04-15
Filing Date
2021-11-12
Publication Date
2026-11-20
Estimated Expiration
2041-11-12

AI Technical Summary

Technical Problem

In battery-powered devices, there is a trade-off between GPU performance, battery life, and heat dissipation, and existing technologies struggle to effectively balance performance and power consumption to optimize the user experience.

Method used

By selectively employing a two-tier loading mode or a non-two-tier loading mode based on performance characteristics and workload priorities, the rendering process can be adjusted to reduce power consumption or temperature, ensuring the timely execution of high-priority workloads.

Benefits of technology

It improves the user experience of battery-powered devices by using a two-tier loading mode in low-priority workloads to reduce power consumption and temperature, while ensuring the timely completion of high-priority tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116762062B_ABST
    Figure CN116762062B_ABST
Patent Text Reader

Abstract

Systems and methods are provided that involve selecting a rendering mode, such as a two-level binning mode, based on priority and based on performance, where a graphics processing unit (GPU) [102] of a system [100] is utilized to perform workloads. A user mode driver (UMD) [110] or a kernel mode driver (KMD) [112] executed at a central processing unit (CPU) [104] configures low and medium priority workloads to be performed in a two-level binning mode and selects a binning mode for high priority workloads based on whether a performance heuristic indicates that one or more binning conditions or override conditions have been met. High priority workloads are maintained in a high priority queue while low and medium priority workloads are maintained in a low / medium priority queue such that execution of low and medium priority workloads at the GPU can be preempted to favor execution of high priority workloads.
Need to check novelty before this filing date? Find Prior Art

Description

Background Technology

[0001] Computer processing systems typically employ Graphics Processing Units (GPUs) to perform graphics operations such as texture mapping, rendering, and vertex translation. GPU performance requirements or specifications can vary depending on the type of electronic device. For example, GPUs used in mobile devices or other battery-powered devices have characteristics and requirements that can differ significantly from those of non-battery-powered platforms. Performance, battery life, and thermal management are typically important metrics for battery-powered device platforms, with sustained performance and low idle power consumption and temperature being desirable. However, trade-offs are often made between GPU performance and battery life / thermal management in battery-powered devices. Attached Figure Description

[0002] This disclosure can be better understood by referring to the accompanying drawings, and many of its features and advantages will be apparent to those skilled in the art. The same reference numerals are used in different drawings to denote similar or identical items.

[0003] Figure 1 This is a block diagram of an exemplary device based on some implementation schemes, which sets the loading mode for GPU workloads based on GPU performance data.

[0004] Figure 2 This is a flowchart illustrating a method according to some implementations for setting a loading pattern for GPU workloads based on performance heuristics.

[0005] Figure 3 This is a flowchart illustrating a method according to some implementations for selectively patching pending workloads based on a determined loading pattern before submitting commands to the GPU.

[0006] Figure 4 This is a flowchart illustrating a method according to some implementation schemes for selectively executing workloads in a two-level loading mode or a non-two-level loading mode.

[0007] Figure 5 It is a block diagram of high-priority and low / medium-priority queues for organizing and selecting workloads to be executed by the GPU based on priority, according to some implementation schemes.

[0008] Figure 6 This is a flowchart illustrating a method for selectively executing workloads in a two-level loading mode or a non-two-level loading mode based on performance heuristics and workload prioritization according to some implementation schemes.

[0009] Figure 7 This is a flowchart illustrating a method for executing lower-priority workloads in a two-level loading mode in order to execute higher-priority workloads, according to some implementation schemes. Detailed Implementation

[0010] Using the techniques described herein, the GPU of the processing system selects a primitive loading mode (sometimes referred to herein as a "loading mode") for executing one or more workloads based on the performance characteristics of the processing system and the corresponding priority of those workloads. When rendering an image frame, the loading mode defines a technique for dividing the image frame into regions and assigning primitives to kiosks corresponding to each region. By selecting the loading mode based on performance characteristics, the processing system adjusts the rendering process according to the system's operating conditions. According to various examples, the processing system improves the user experience by selecting a less hardware-intensive loading mode (such as a two-level loading mode) to render image frames in response to detected conditions such as low remaining battery life or high processing system temperature, thereby reducing the processing system's power consumption or temperature.

[0011] To illustrate, in order to render a frame (i.e., to prepare a frame for transmission to a display device (such as a display panel) and display at the display device), the GPU transforms information about three-dimensional (3D) objects into displayable two-dimensional (2D) image frames. This process requires considerable processing power and memory resources, at least in some cases. During the rendering process, pixels within the image frame are generated by rendering graphics objects in order to determine the color values ​​of the corresponding pixels. Exemplary graphics objects include points, lines, polygons, and three-dimensional (3D) high-order surfaces. Points, lines, and polygons represent rendering primitives, which form the basis of most 3D rendering instructions. More complex structures (such as 3D objects) are formed by combinations of such primitives or meshes. To display a specific scene using conventional rendering techniques, the GPU renders primitives individually, one primitive at a time, with potentially contributing pixels associated with the scene by identifying pixels falling within the edges of each primitive and obtaining the attributes of the primitive corresponding to each of those pixels.

[0012] In other cases, the GPU uses a binning process to render primitives. In this process, the GPU divides the image frame into regions, identifies primitives that intersect with a given region, and places the identified primitives into bins corresponding to that region. Thus, each region of a frame is associated with a corresponding bin, where a bin includes primitives or portions of primitives that intersect with the associated bin. The GPU renders frames bin-by-bin by rendering the pixels of the primitives that intersect with the regions of the frame corresponding to the bins. At least in some cases, this allows the GPU to render frames more efficiently, for example, by requiring less memory access and increasing cache usage.

[0013] An example of the loading process is Primitive Batch Loading (PBB), where the GPU receives a sequence of primitives and opportunistically segments the primitives into time-dependent primitive batches. Primitives are captured sequentially until predetermined conditions are met, such as a batch full condition, a full state storage condition, or a determination of dependency on previously rendered primitives. When performing PBB, an image frame displaying the rendered primitives is divided into blocks. Each block of the image frame is associated with a corresponding primitive. Each primitive in the received primitive sequence of a batch intersects with one or more primitives. For each received primitive in the batch, an initial primitive intercept is calculated, where the initial primitive intercept is the leftmost uppermost primitive in the image frame that intersects with the primitive. After batch processing is complete, the first primitive for processing is identified. Primitives that have been intercepted in the identified primitive are processed. For each identified primitive that has been intercepted in that primitive, the next primitive intercept is identified, and pixels within the primitive surrounded by the identified primitive are sent for detailed rasterization. The next primitive intercept is the next leftmost uppermost primitive in the rasterization order that intersects with the processed primitive.

[0014] In some implementations, the GPU implements different loading techniques (referred to herein as loading modes or primitive loading modes), where different loading modes employ different loading characteristics, such as different region sizes per region, different numbers of loading levels, or any combination thereof. For example, in some implementations, the GPU includes both single-level and two-level loading modes. In single-level loading mode (also known as primitive batch loading (PBB) mode), the GPU divides an image frame into a specified number of regions and renders each region as described above.

[0015] In a two-level loading mode, two types of loading are performed: coarse-level loading and fine-level loading. In some implementations, coarse-level loading uses large warehouses (e.g., a total of 32 warehouses covering the entire display area), which reduces loading overhead. Visibility information for each coarse warehouse is generated during the rendering of the first coarse warehouse (i.e., coarse warehouse 0) and used to render other coarse warehouses. After coarse-level loading, fine-level loading is performed sequentially for each coarse warehouse. In some implementations, fine-level loading involves performing primitive batch loading (PBB) to divide each coarse warehouse into smaller "fine" warehouses, such as by further loading each coarse warehouse into a 64×64 fine warehouse array during PBB-based fine-level loading. Each fine warehouse is then rendered using rendering information generated for the corresponding coarse warehouse (such as primitive visibility information). In some implementations, two-stage loading occurs at the top of the graphics processing pipeline (e.g., before vertex processing and rasterization), which contrasts with a single-stage PBB-only loading mode that occurs in the middle of the graphics processing pipeline (e.g., after vertex processing and before pixel shading).

[0016] In some cases, different loading modes are suitable for different equipment conditions. For example, under certain conditions, a single-stage or PBB loading mode (where only PBB is used without the combination of coarse and fine loading as described above) offers better performance than two-stage loading, but at the cost of increased power consumption and higher operating temperatures. In contrast, in some cases, two-stage loading supports reduced power consumption at the expense of some performance.

[0017] To adjust the loading mode based on device conditions, in some implementations, the GPU employs a selective two-level loading architecture that supports runtime selection of the rendering mode. For example, in some implementations, a device implementing a selective two-level loading architecture performs a runtime selection between a two-level loading mode and a default rendering mode (such as a PBB rendering mode in which only PBB is executed). The selection of the loading mode is based on any of several performance criteria, such as thermal characteristics, power characteristics (e.g., battery life), etc. For example, in some implementations, a driver (such as a user-mode driver (UMD) or kernel-mode driver (KMD)) receives performance data (such as sensor data and performance counter data) and selects the loading mode based on the performance data.

[0018] Additionally, in some implementations, the GPU is configured to select the loading mode for a given workload based on its priority. Therefore, the GPU can execute all applicable low- or medium-priority workloads in a two-level loading mode based on the performance characteristics of the GPU or system, while executing high-priority workloads in either a two-level or non-two-level loading mode. By executing all applicable low- and medium-priority workloads in a two-level loading mode (i.e., not based on performance heuristics), the preemption granularity of the GPU is improved. For example, application programming interfaces (APIs) typically do not provide a means to break down workloads into finer-grained content than full drawing calls. In contrast, as described herein, two-level loading divides the frame being rendered into multiple coarse-grained bins, each of which is rendered separately, thereby breaking down drawing calls across multiple coarse-grained bins across a frame into smaller chunks. Sometimes it is necessary or desirable for the GPU to preempt low- or medium-priority workloads being executed by the GPU, making it possible to alternatively execute high-priority workloads. This preemption (sometimes referred to in this article as “draw call preemption”), which favors the execution of lower-priority workloads for higher-priority workloads, helps ensure that the execution of time-critical workloads is not unnecessarily delayed due to the execution of lower-priority workloads.

[0019] The techniques described in this article involve selectively executing workloads based on one or both of performance heuristics and workload prioritization, depending on whether a two-level loading mode or a non-two-level loading mode (such as PBB rendering mode) is in use.

[0020] Figure 1 An example of device 100 is shown, which includes a parallel processor and specifically a GPU 102, and implements a two-tier loading architecture that allows runtime selection of the rendering mode used to render image data. In addition to the GPU 102, device 100 also includes a CPU 104, a memory controller 105, system memory 106, a sensor 108, and a battery 111. In some embodiments, the GPU 102, CPU 104, memory controller 105, and sensor 108 are communicatively connected together via a bus 126. The memory controller 105 manages memory access requests for accessing system memory 106 provided by the GPU 102, CPU 104, and sensor 108.

[0021] During graphics processing operations, the application generates commands at system memory 106, instructing GPU 102 to render image data at a defined location in system memory 106 for subsequent display as image frames at an electronic display (not shown) of device 100. Commands output by the application are recorded by UMD 110, executed at CPU 104, onto one or more command buffers 114. A given command buffer 114 contains commands corresponding to one or more workloads, and each workload is configured to execute in a two-level loading mode, a non-two-level loading mode, or both. After UMD 110 has completed recording commands into command buffer 114, KMD 112 submits command buffer 114 to GPU 102, where the commands in command buffer 114 are loaded onto one or more circular buffers 120 of GPU 102. Circular buffers (such as circular buffer 120) are sometimes referred to herein as queues. In one example, a first circular buffer in circular buffer 120 corresponds to a high-priority queue and receives high-priority workloads to be executed by GPU 102, while a second circular buffer in circular buffer 120 corresponds to a low / medium-priority queue and receives low-priority and medium-priority workloads to be executed by GPU 102. One or more command processors 122 of GPU 102 retrieve commands corresponding to a specific command buffer 114 from circular buffer 120 and execute those commands, for example, by retrieving image data from system memory 106 and instructing shaders, compute units, and other graphics processing circuitry (not shown) to render the retrieved image data. In this document, "workload" refers to a command or group of commands to be processed by a GPU (such as GPU 102). Depending on various embodiments, a workload typically includes a set of tasks (e.g., graphics drawing) for a given set of rendering targets, depth template targets, or buffers (e.g., unordered access views (UAVs)). Figure 1In the example, when executing the workload of command buffer 114, GPU 102 selects between a two-level loading mode and a single-level loading mode such as PBB mode (sometimes referred to herein as "single-level PBB mode" or "single-level PBB-only loading mode"). In some implementations, GPU 102 selects which loading mode to use to execute the workload of command buffer 114 based on one or more status bits stored in system memory 106 or based on one or more patch enable bits (described below) stored in GPU memory 124. In some implementations, GPU 102 selects the loading mode based on the status bits or patch enable bits when executing the corresponding logic of command buffer 114 (which causes GPU 102 to check the status bits or patch enable bits) to determine which loading mode to use to execute the corresponding workload of command buffer 114. In some implementations, CPU 104 selectively sets the values ​​of the status and patch enable bits based on identified performance characteristics (sometimes referred to herein as “performance data” or “performance heuristics”) of either or both of device 100 and GPU 102. In some implementations, each workload stored in command buffer 114 is indicated as high priority, medium priority, or low priority (e.g., by a priority indicator, such as a priority indicator included in or stored with the workload, or generated by CPU 104 based on the workload’s capabilities). In some implementations, CPU 104 selectively sets the values ​​of the status and patch enable bits for high-priority workloads to be executed in either two-level loading mode or non-two-level loading mode based on identified performance characteristics, and CPU 104 configures all applicable low-priority and medium-priority workloads to be executed in two-level loading mode (e.g., to improve the preemption granularity of low-priority and medium-priority workloads). It should be noted that some workloads are not suitable for execution in two-level loading mode, even if they are identified as low- or medium-priority workloads. For example, if a given workload uses API features incompatible with two-level loading, such as tessellation drawing calls, atoms in shaders, read-modify-write operations on shader buffers, streaming output, etc., then that workload will not be suitable for execution in two-level loading mode. In some implementations, high-priority workloads are stored in a different queue than low-priority and medium-priority workloads.

[0022] In some implementations, a given command buffer 114 is configured such that some workloads stored in command buffer 114 are executed in a first-level loading mode and other workloads in the same command buffer 114 are executed in a two-level loading mode. For example, some workloads are executable only using first-level loading and are therefore always configured to execute in first-level loading mode, even if they are low-priority or medium-priority workloads, or even if they are high-priority workloads and meet the two-level loading criteria and the two-level loading mode is enabled. In some implementations, the UMD 110 records workloads (e.g., high-priority workloads) on command buffer 114 as executable in either a first-level loading mode or a two-level loading mode, and the GPU subsequently selects the loading mode in which these workloads are executed when executing the workloads.

[0023] Generally, drivers in an operating system run in user mode, kernel mode, or both. UMDs (such as UMD 110) run in a non-privileged processor mode, executing other application code, including protected subsystem code. UMDs cannot gain access to system data or hardware except by calling APIs, which in turn invoke system services. KMDs (such as KMD 112) run as part of the operating system and support one or more protected subsystems. UMDs and KMDs have different architectures, different entry points, and different system interfaces. KMDs can perform specific protected operations and can access system structures that UMDs cannot access. In one example, drawing call commands corresponding to primitives generated by an application are recorded by UMD 110 onto one or more command buffers 114, and KMD 112 submits the drawing call commands to GPU 102 for subsequent rendering of the primitives. Command processor 122 causes image data to be rendered according to a specific rendering mode (such as a two-level loading mode or a non-two-level loading mode, such as a PBB rendering mode). In some implementations, command processor 122 executes low-priority and medium-priority workloads in a two-tier loading mode and executes high-priority workloads based on performance heuristics. In some implementations, command processor 122 selects which rendering mode to use to render image data associated with a specific high-priority workload by determining whether the two-tier loading mode is enabled or disabled. In some implementations, command processor 122 determines whether the two-tier loading mode is enabled or disabled by examining one or more status bits stored in GPU memory 124 or system memory 106.

[0024] In some implementations, CPU 104 enables or disables a two-tier loading mode (e.g., for high-priority workloads) based on performance data, including performance counter data received from performance counter 116 stored in system memory 106, sensor data 118 stored in system memory 106 by sensor 108, or both. In some implementations, CPU 104's UMD 110 or KMD 112 receives and processes the performance data to determine whether to enable or disable the two-tier loading mode (e.g., for high-priority workloads).

[0025] In some embodiments, the sensor data 118 generated by sensor 108 includes one or more temperature measurements, voltage measurements, current measurements, instantaneous power measurements, peak power measurements, or other applicable sensor data. In some embodiments, sensor 108 includes one or more temperature sensors, current sensors, voltage sensors, or power sensors.

[0026] In some implementations, performance counter 116 tracks activity at various modules of the device, such as battery 111, CPU 104, the circular buffer 120 of GPU 102, L1 cache, L2 cache, or shaders. In some implementations, performance counter data includes one or more of the following: cache access, cache hit rate, cache miss rate, memory access, GPU 102 utilization, CPU 104 utilization, current supplied to GPU 102, current supplied to CPU 104, voltage at GPU 102, voltage at CPU 104, frequency of GPU 102, and / or frequency of CPU 104.

[0027] In some implementations, performance data includes one or more parameters derived from sensor data 118 or performance counter data generated by performance counter 116, such as the average temperature of device 100, the rate of change (RoC) of the average temperature of device 100, the peak instantaneous power consumption of device 100 over a given time period, the average power consumption of device 100 over a given time period, the RoC of the average power consumption of device 100, or the state of charge (SoC) of battery 111 (i.e., the remaining charge of battery 111 expressed as a percentage of the charging capacity of battery 111). In this document, according to various implementations, the “average temperature” of device 100 refers to the average, median, or mode of instantaneous temperatures measured at various locations of the device (e.g., at CPU 104, at GPU 102, at battery 111, or a combination of these locations), the average, median, or mode of temperatures measured at various locations of the device over a defined time period, and the average, median, or mode of estimated temperatures of device 100 derived from estimated power consumption based on performance counter data generated by performance counter 116 over a defined time period. In this document, according to various embodiments, the “average power consumption” of device 100 refers to the average, median, or mode of instantaneous power consumption measured at battery 111 within a defined time period, or the average, median, or mode of instantaneous power consumption estimated based on performance counter data generated by performance counter 116 within a defined time period.

[0028] The UMD 110 or KMD 112 monitors performance data to determine whether one or more predefined conditions (sometimes referred to herein as "two-level loading conditions") for enabling a two-level loading mode (e.g., for high-priority workloads) have occurred. In some embodiments, enabling or disabling a two-level loading mode involves the UMD 110 or KMD 112 setting the values ​​of one or more status bits in the system memory 106 or GPU 102 that indicate whether a two-level loading mode is enabled (e.g., for high-priority workloads). In some embodiments, two-level loading conditions include one or more of the following: the average temperature of the device exceeds a predefined temperature threshold, the RoC of the average temperature of the device exceeds a predefined RoC threshold, the local temperature at a defined location of the device exceeds a predefined temperature threshold, the RoC of such local temperature exceeds a predefined RoC threshold, the peak instantaneous power consumption of the device exceeds a predefined threshold, the average power consumption of the device exceeds a predefined threshold, the RoC of the average power consumption of the device exceeds a predefined threshold, the battery SoC drops below a predefined SoC threshold, or a combination of these conditions. It should be understood that in some implementations, after a two-tier loading condition is met and the two-tier loading mode is enabled by UMD 110 or KMD 112, if it is subsequently determined based on changes in performance data that the two-tier loading condition is no longer met, the device will disable the two-tier loading mode (e.g., for high-priority workloads). However, in some implementations, other detectable conditions (sometimes referred to herein as "overlay conditions") override the detection of the two-tier loading condition. For example, if device 100 is determined by UMD 110 or KMD 112 to meet the two-tier loading condition, but the device is also determined to meet the overlay condition: plugged in (e.g., if the battery is determined to be in a "charging" state), the two-tier loading mode is disabled (e.g., for high-priority workloads). In some implementations, alternative or additional overlay conditions are set, such as determining that the average power consumption of device 100 has dropped below a threshold or determining that GPU 102 or CPU 104 is no longer thermally throttled (e.g., determined based on the clock frequency of GPU 102 or CPU 104 increasing above a threshold).

[0029] In some implementations, when recording a workload to command buffer 114, UMD 110 records a given workload (e.g., a high-priority workload) differently in command buffer 114 based on whether the two-level loading mode is enabled or disabled, according to the corresponding status bit stored in system memory 106. In some implementations, after enabling the two-level loading mode, UMD 110 records all subsequent high-priority workloads in command buffer 114 as executable according to the two-level loading mode, at least until the two-level loading mode is disabled again. In some implementations, after disabling the two-level loading mode, UMD 110 records all subsequent high-priority workloads in command buffer 114 as executable according to a non-two-level or single-level loading mode (such as a single-level PBB mode). In some implementations, UMD 110 or KMD 112 determines the loading mode for each high-priority workload stored in a given command buffer 114 individually based on whether a two-level loading mode is enabled when high-priority workloads are recorded by UMD 110, and in some cases based on whether a given high-priority workload can be executed in a two-level loading mode.

[0030] For example, in some implementations, UMD 110 is configured to log high-priority workloads into command buffer 114 by default in a level-one loading mode, and is configured to modify the execution of one or more pending high-priority workloads in command buffer 114 to a two-level loading mode before submitting them to GPU 102 when the two-level loading condition is met. In other implementations, UMD 110 is configured to log all applicable workloads into command buffer 114 by default in a two-level loading mode, and is configured to modify the execution of one or more pending high-priority workloads in command buffer 114 to a level-one loading mode before submitting them to GPU 102 when the two-level loading condition is not met.

[0031] In some cases, the state of the two-level loading mode (i.e., enabled / disabled) changes after UMD 110 has logged or started logging one or more high-priority workloads (referred to as "pending workloads" in such instances) in command buffer 114, but before the pending workloads have been executed by GPU 102. In some implementations, such pending high-priority workloads are modified via command buffer patching to execute according to either the two-level loading mode or a non-two-level loading mode, depending on whether the two-level loading mode is enabled. Herein, command buffer patching refers to modification of data (e.g., workloads, commands) within the command buffer by a driver or other module executed by CPU 104 or GPU 102, and command buffer patching is performed at CPU 104 or GPU 102.

[0032] In one example, in response to the CPU 104 or GPU 102 determining that the two-level loading mode has been disabled since the initiation of recording a high-priority workload pending review, the high-priority workload pending review recorded in command buffer 114 is modified by the CPU 104 or GPU 102 via command buffer patching to execute according to a non-two-level loading mode when the two-level loading mode is enabled. As another example, in response to the CPU 104 or GPU 102 determining that the two-level loading mode has been enabled since the initiation of recording a high-priority workload pending review, the high-priority workload pending review recorded in command buffer 114 is modified by the CPU 104 or GPU 102 via command buffer patching to execute according to a two-level loading mode when the two-level loading mode is disabled. Generally, once the GPU 102 has started executing at least a portion of a given workload, the workload cannot be patched to change its loading mode.

[0033] In some implementations where command buffer patching is performed at CPU 104, UMD 110 or KMD 112 performs command buffer patching near the end of the command buffer recording process. In some implementations, when command buffer patching is performed at CPU 104, the UMD immediately submits the patched high-priority workload from command buffer 114 to GPU 102 after the command buffer patching is performed, except where the pending high-priority workload in command buffer 114 is configured to be executed more than once simultaneously (under predefined conditions known when the workload is recorded into command buffer 114).

[0034] In some implementations involving CPU-side command buffer patching, UMD 110 stores metadata for each high-priority workload. In some implementations, the metadata stored for each high-priority workload includes one or more tokens and one or more offsets. If a two-level loading mode is enabled, each offset defines the location in command buffer 114 that will need to be modified. If a two-level loading mode is enabled, each token defines how the code stored in command buffer 114 at the location defined in the corresponding offset should be modified. In one example, the token of the metadata causes UMD 110 to modify the code in command buffer 114 that describes the visibility of primitives. In some implementations, command buffer patching is only required when a two-level loading mode is enabled, and in such implementations, UMD 110 initially (i.e., by default) records each high-priority workload on command buffer 114 as executable in a non-two-level loading mode, and then determines whether to patch command buffer 114 to be executable in a two-level loading mode at the end of the recording process or just before submitting the workload stored on command buffer 114 to GPU 102. As indicated above, in some implementations, at least for those workloads that can be executed in a two-level loading mode, the UMD 110 alternatively records each workload on the command buffer 114 as being executed in a two-level loading mode, and then determines whether to modify one or more high-priority workloads among these workloads to be executed in a non-two-level loading mode, based on whether the two-level loading mode is enabled (and in some instances, whether predefined coverage conditions are met).

[0035] In some implementations, command buffer patching is performed at GPU 102 based on values ​​or groups of values ​​(referred to herein as “patch enable values”) stored in GPU memory 124 or in a unified memory (such as system memory 106) shared between GPU 102 and CPU 104. In some implementations, each patch enable value is a single Boolean value corresponding to a specific pending high-priority workload in command buffer 114. In some implementations, KMD 112 determines whether a two-level loading mode is enabled based on a corresponding status bit stored in system memory 106 or based on analysis of performance data, and then KMD 112 causes the patch enable value to be set according to whether the two-level loading mode is enabled before command buffer 114 is executed by GPU 102. For some implementations where GPU-side patching is performed, UMD 110 must record the high-priority workload on command buffer 114 as executable in both two-level loading mode and non-two-level loading mode, and command processor 122 determines which mode to execute the high-priority workload in based on the corresponding patch enable value.

[0036] In some implementations, the patch enable value is instead a command buffer-based patch enable value stored by UMD 110 on command buffer 114 during recording. In one example, when a given high-priority workload is executed, GPU 102 checks one or more patch enable values ​​for that workload that are already stored in command buffer 114 along with the high-priority workload. In such implementations, when executed by GPU 102, GPU 102 modifies one or more high-priority workloads stored in command buffer 114 to be executable in either a two-level loading mode or a non-two-level loading mode based on the command buffer-based patch enable value. In one example, the command processor of GPU 102 or the shader core of GPU 102 modifies the high-priority workload to be executed in either a two-level loading mode or a non-two-level loading mode based on a determination of whether GPU-side patching is required. In some implementations, as previously described, the need for GPU-side patching is determined based on a patch enable bit stored at GPU memory 124 or a status bit stored at system memory 106.

[0037] Figure 2 An exemplary processing flow of method 200 is shown, which selectively executes workloads (e.g., high-priority workloads) in one or more command buffers in a first loading mode or a second loading mode based on performance data generated by performance counters or sensors. In some embodiments, the first loading mode is a two-level loading mode, and the second loading mode is a single-level loading mode, such as a PBB mode. Method 200 is about... Figure 1 The exemplary specific implementations of the device 100 and its constituent parts and modules are described herein.

[0038] At block 202, UMD 110 or KMD 112 (e.g., executed by CPU 104) retrieves or otherwise receives performance data. In some embodiments, the performance data includes sensor data 118 generated by sensor 108. In some embodiments, the performance data includes performance counter data generated by performance counter 116. In some embodiments, the performance data includes both performance counter data and sensor data 118. In some embodiments, the sensor data 118 generated by sensor 108 includes one or more temperature measurements, voltage measurements, current measurements, instantaneous power measurements, peak power measurements, or other applicable sensor data. In some implementations, performance data includes one or more corresponding amounts of cache accesses, cache hit rate, cache miss rate, memory accesses, GPU 102 utilization, CPU 104 utilization, current supplied to GPU 102, current supplied to CPU 104, voltage at GPU 102, voltage at CPU 104, frequency of GPU 102 and / or frequency of CPU 104, each amount corresponding to an activity occurring at one or more modules of device 100, such as battery 111, CPU 104, circular buffer 120 of GPU 102, L1 cache, L2 cache, or shader. In some implementations, performance data includes one or more parameters derived from sensor data 118 or performance counter data generated by performance counter 116, such as the device's average temperature, the device's average temperature change rate (RoC), the device's peak instantaneous power consumption over a given time period, the device's average power consumption over a given time period, the device's average power consumption RoC, or the battery's state of charge (SoC) (i.e., the battery's remaining charge, which in some implementations is expressed as a percentage of the battery's charge capacity). In some implementations, performance characteristics of a given workload include workload characteristics that indicate whether the workload is suitable for execution in a two-level loading mode. For example, such workload characteristics include tessellation drawing calls, atoms in shaders, read-modify-write operations of buffers in shaders, or the use of streaming outputs in the workload. In some implementations, the resulting parameters are calculated by UMD 110 or KMD 112.

[0039] At block 204, UMD 110 or KMD 112 determines whether loading conditions (e.g., two-level loading conditions) have been met based on performance data. For example, in some embodiments, loading conditions include one or more two-level loading conditions, which include one or more of the following: the average temperature of the device exceeds a predefined temperature threshold, the RoC of the average temperature of the device exceeds a predefined RoC threshold, the local temperature at a defined location of the device exceeds a predefined temperature threshold, the RoC of such local temperature exceeds a predefined RoC threshold, the peak instantaneous power consumption of the device exceeds a predefined threshold, the average power consumption of the device exceeds a predefined threshold, the RoC of the average power consumption of the device exceeds a predefined threshold, the battery SoC drops below a predefined SoC threshold, or a combination of these conditions. If UMD 110 or KMD 112 determines that the loading conditions have been met, method 200 proceeds to block 206. Otherwise, if UMD 110 or KMD 112 determines that the loading conditions have not been met, method 200 proceeds to block 214.

[0040] At box 206, UMD 110 or KMD 112 determines whether a coverage condition has been met based on performance data. In some embodiments, the coverage condition includes one or more of the following: device 100 enters a charging state (where battery 111 is being charged), the average temperature of device 100 drops below a predetermined threshold, the RoC of the average temperature of device 100 drops below a predetermined threshold, or a combination of these. In some embodiments, one or more coverage conditions are determined based on workload characteristics of a given workload that indicate whether the workload is suitable for execution in a two-level loading mode. In one example, a coverage condition is triggered in response to the determination based on workload characteristics that a given workload includes one or more of the following: tessellation drawing calls, atoms in a shader, read-modify-write operations on a shader buffer, or streaming output in the workload. If UMD 110 or KMD 112 determines that a coverage condition has not yet been met, method 200 proceeds to box 208. Otherwise, if UMD 110 or KMD 112 determines that the coverage condition has been met, method 200 proceeds to box 214.

[0041] At block 208, UMD 110 or KMD 112 enables a first load mode for newly created high-priority workloads stored in command buffer 114. In some embodiments, the first load mode is a two-level load mode. For example, to enable the first load mode, UMD 110 or KMD 112 sets a status bit value in system memory 106 to indicate that the first load mode is enabled for high-priority workloads. In some embodiments, when a subsequent high-priority workload is logged in command buffer 114, UMD 110 checks the status bit value and determines that the subsequent high-priority workload should be configured to execute in the first load mode. In some embodiments, the first load mode is enabled by default for low-priority or medium-priority workloads (e.g., automatically enabled, but not in response to load conditions being met and overwrite conditions not being met).

[0042] At block 210, CPU 104 or GPU 102 patches pending high-priority workloads in command buffer 114 to enable these high-priority workloads to execute in a first loading mode. In some embodiments, when such high-priority workloads are logged into command buffer 114, UMD 110 patches such high-priority workloads via CPU 104 such that the patched workloads are configured to execute in the first loading mode as soon as they are logged. In some embodiments, UMD 110 patches pending high-priority workloads for execution in the first loading mode via CPU 104 after the pending high-priority workloads have been logged into command buffer 114 and before the pending high-priority workloads are provided to GPU 102 from command buffer 114 (e.g., until just before provision). In some embodiments, before the execution of pending high-priority workloads (e.g., just before execution), GPU 102 patches pending high-priority workloads for execution in the first loading mode based on one or more patch enable values ​​stored in GPU memory 124.

[0043] At box 212, a high-priority workload (e.g., if one or more load conditions are met and no coverage condition is met) is executed in a first loading mode at GPU 102. In some implementations, the execution of such high-priority workloads precedes the execution of lower-priority workloads.

[0044] At block 214, UMD 110 or KMD 112 disables the first load mode for newly created high-priority workloads stored in command buffer 114. For example, to disable the first load mode, UMD 110 or KMD 112 sets a status bit value in system memory 106 to indicate that the first load mode is disabled for high-priority workloads. In some embodiments, in response to a detection of unmet load conditions at block 204, when a high-priority workload is logged in command buffer 114, UMD 110 checks the status bit value and determines (where applicable) that the high-priority workload should be configured to execute in a second load mode. In some embodiments, the second load mode is a single-level load mode, such as PBB mode. In some embodiments, the system keeps the first load mode enabled for low-priority and medium-priority workloads.

[0045] At box 216, UMD 110 or KMD 112 disables the first loading mode for pending high-priority workloads already stored in command buffer 114. For implementations where UMD 110 defaults to recording high-priority workloads in command buffer 114 as executed in a second loading mode, box 216 is skipped because no further action is required to disable the first loading mode for high-priority workloads other than modifying the status bit at box 214. For some implementations where GPU-side patching is performed, KMD 112 disables the first loading mode for pending high-priority workloads in command buffer 114 by setting one or more patch enable values ​​in GPU memory 124 to indicate that the first loading mode is disabled.

[0046] At box 218, a high-priority workload is executed in a second loading mode at GPU 102 (e.g., because a loading condition is not met or at least one coverage condition is met). In some implementations, the execution of such a high-priority workload precedes the execution of lower-priority workloads.

[0047] Figure 3 An exemplary processing flow of method 300 is shown, which selectively pads the command buffer at the CPU to be executable in a two-level load mode or a non-two-level load mode. Method 300 is about... Figure 1 The device 100 and its constituent parts and modules are described in the exemplary specific implementation thereof. In some implementations, in conjunction with Figure 2 Box 210 is used to execute one or more steps of method 300.

[0048] At block 302, when high-priority workloads are logged in command buffer 114, UMD 110 collects metadata (i.e., "per-workload metadata") for each high-priority workload given command buffer 114. In some implementations, the metadata stored for each high-priority workload includes one or more tokens and one or more offsets. If a two-level loading mode is enabled, each offset defines the location in command buffer 114 that will need to be modified to execute the corresponding high-priority workload of command buffer 114. If a two-level loading mode is enabled, each token defines how the code in command buffer 114 at the location defined in the corresponding offset should be modified. In one example, if a two-level loading mode is enabled, the tokens of the metadata cause UMD 110 to modify the code describing the primitive visibility of a given high-priority workload, where this code is included in or stored in command buffer 114 in association with the high-priority workload.

[0049] At block 304, at the end or near the end of the recording process where a given high-priority workload is recorded into command buffer 114, UMD 110 determines whether a two-level loading mode is enabled. In some implementations, UMD 110 checks the values ​​of one or more status bits stored in system memory 106 to determine whether a two-level loading mode is enabled. If it is determined that a two-level loading mode is enabled, the method proceeds to block 310. If it is determined that a two-level loading mode is disabled, method 300 proceeds to block 306.

[0050] At block 306, after a high-priority workload is logged into command buffer 114 and before (e.g., just before) submitting the high-priority workload from command buffer 114 to GPU 102, UMD 110 determines whether a two-level loading mode is enabled. In some implementations, UMD 110 checks the values ​​of one or more status bits stored in system memory 106 to determine whether a two-level loading mode is enabled. If it is determined that a two-level loading mode is enabled, the method proceeds to block 312. If it is determined that a two-level loading mode is disabled, method 300 proceeds to block 308.

[0051] At box 308, the scheduler (e.g., implemented via CPU 104 via KMD 112, or via GPU 102 via firmware) submits high-priority workloads from command buffer 114 to GPU 102.

[0052] At box 310, when a high-priority workload is logged into command buffer 114 (e.g., near the end of the logging process), UMD 110 patches command buffer 114 based on per-workload metadata to configure the high-priority workload for execution in a two-level loading mode. Generally, the manner in which UMD 110 patches command buffer 114 depends on the specific hardware implementation of device 100.

[0053] In one example, two-level loading inherently uses visibility information in a buffer (i.e., a "visibility information buffer") as the basis for determining which primitives are visible in which load. In this example, UMD 110 records a high-priority workload on command buffer 114 as being executed using a single-level load. UMD does not include commands for binding such visibility information buffers to the GPU. However, if a high-priority workload is recorded by UMD 110 as being executed using a two-level load, then the high-priority workload will need to include such commands. Therefore, if the workload is executed in two-level loading mode, UMD 110 generates metadata including a token and an offset indicating the location in command buffer 114 where the commands for binding visibility information buffers, which will be needed for the high-priority workload, are included. In this way, when two-level loading mode is enabled before submitting a high-priority workload from command buffer 114 to GPU 102, UMD 110 or KMD 112 patches the high-priority workload to include the commands for binding visibility information buffers at the location indicated in the metadata.

[0054] In another example, GPU 102 typically needs to receive warehouse information indicating how many warehouses exist, their sizes, and / or the order in which warehouses should be processed when executing in a two-level warehouse loading mode. In this example, UMD 110 generates metadata for each high-priority workload recorded in command buffer 114, including warehouse loading information indicating the number of warehouses, the size of each warehouse, and the order in which warehouses should be processed, where warehouse loading information is required to execute the high-priority workload in a two-level warehouse loading mode. In this way, when two-level warehouse loading mode is enabled before submitting a high-priority workload from command buffer 114 to GPU 102, UMD 110 or KMD 112 patches the high-priority workload in command buffer 114 with the warehouse loading information indicated in the metadata.

[0055] At box 312, after high-priority workloads are logged into command buffer 114 and before they are submitted from command buffer 114 to GPU 102, UMD patches command buffer 114 based on per-workload metadata to configure high-priority workloads stored on command buffer 114 as executable in two-level loading mode.

[0056] Figure 4 An exemplary processing flow of method 400 is shown, which selectively executes the command buffer workload in either a two-level loading mode or a non-two-level loading mode on the GPU. In some implementations, the GPU performs command buffer patching of the command buffer based on corresponding metadata generated by UMD to make the workload executable in either a two-level loading mode or a non-two-level loading mode. Method 400 relates to... Figure 1 The device 100 and its constituent components and modules are described in the exemplary specific implementation thereof. In some implementations, in conjunction with Figure 2 Method 200 is used to perform one or more steps of method 400.

[0057] At box 402, UMD 110 logs the workload to command buffer 114. In some implementations, UMD 110 configures the logged workload to be executable in either two-level loading mode or non-two-level loading mode without patching. In some other implementations, UMD 110 defaults to configuring the logged high-priority workload to execute in non-two-level loading mode and generates metadata that allows GPU 102 to modify the logged workload to execute in two-level loading mode (if needed, i.e., if two-level loading mode is enabled after the high-priority workload is logged to command buffer 114 and before the high-priority workload is executed by GPU 102). In some implementations, UMD 110 defaults to configuring the logged low-priority and medium-priority workloads to execute in two-level loading mode.

[0058] In one example, UMD 110 records a conditional statement for one or more high-priority workloads in command buffer 114, wherein the conditional statement causes GPU 102 to check a patch enable value stored in a register in GPU memory 124 and execute the one or more high-priority workloads in command buffer 114 in either two-level loading mode or non-two-level loading mode based on the value of the patch enable value. In some embodiments, the patch enable value is a Boolean value in a single bit of a register stored in GPU memory 124. In some embodiments, the patch enable value is set by UMD 110 or KMD 112.

[0059] At box 404, KMD 112 submits the workload from command buffer 114 to GPU 102. In some implementations, after submission to GPU 102, the workload is added to circular buffer 120.

[0060] At block 406, GPU 102 determines whether a two-tier loading mode is enabled for the submitted workload. In some implementations, GPU 102 checks one or more patch enable values ​​stored in GPU memory 124 to determine whether a two-tier loading mode is enabled for high-priority workloads. In some implementations, KMD 112 determines whether a two-tier loading mode is enabled for the submitted high-priority workload based on corresponding performance data and sets the patch enable value in GPU memory 124 accordingly. If GPU 102 determines that a two-tier loading mode is enabled for the submitted workload, method 400 proceeds to block 408. Otherwise, if GPU 102 determines that a two-tier loading mode is not enabled for the submitted workload, method 400 proceeds to block 410. In some implementations, a two-tier loading mode is enabled by default for low-priority and medium-priority workloads, and such workloads are executed in a two-tier loading mode based on their priority (e.g., rather than based on performance heuristics).

[0061] At box 408, GPU 102 executes the submitted workload in a two-level loading mode. In some embodiments, in response to determining that a patch enable value indicates one or more high-priority workloads in command buffer 114 should be executed in a two-level loading mode, GPU 102 patches these high-priority workloads for execution in a two-level loading mode using metadata (as described above) generated by UMD 110 during the recording of workloads into command buffer 114. In some other embodiments, UMD 110 records each high-priority workload that may be executed in a two-level loading mode as executable in either a two-level loading mode or a non-two-level loading mode, and GPU 102 is configured to execute these high-priority workloads in either a two-level loading mode or a non-two-level loading mode based on the patch enable value.

[0062] At box 410, GPU 102 executes the submitted workload of command buffer 114 in a non-two-level loading mode. In some implementations, the non-two-level loading mode is a PBB rendering mode.

[0063] Figure 5 The GPU is shown. Figure 1 The implementation of GPU 102 is an example configured to preempt low-priority and medium-priority workloads in order to execute high-priority workloads. This example is about... Figure 1The exemplary specific implementations of the device 100 and its constituent parts and modules are described herein.

[0064] In this example, the command processor 122 of GPU 102 is configured to receive and execute workloads from a high-priority queue 502 (e.g., a buffer in circular buffer 120) and a low / medium-priority queue 504 (e.g., another buffer in circular buffer 120). For example, each workload stored in command buffer 114 includes a priority indicator identifier that specifies the priority level of the workload (e.g., high priority, medium priority, low priority, etc.). In some embodiments, the priority indicator identifier of a workload is determined based on the functionality of a given workload (e.g., all display composition workloads are assigned high priority). In this example, high-priority workloads submitted for execution by GPU 102 are stored in high-priority queue 502, and low-priority and medium-priority workloads submitted for execution by GPU 102 are stored in low / medium-priority queue 504.

[0065] In some implementations, GPU 102 is configured to preempt the execution of a low-priority or medium-priority workload being executed by command processor 122 upon receiving a high-priority workload at high-priority queue 502. For example, command processor preempts the execution of a workload from low / medium-priority queue 502 in response to receiving a preemption indication flag 506, which indicates that high-priority workload 502 is ready to be executed at high-priority queue 504.

[0066] Typically, because APIs do not usually provide a means to divide workloads into more granular components than a full drawing call, preemption of a given low-priority or medium-priority workload will be delayed by a certain amount of time—the amount of time it would take for the command processor 122 to complete the full drawing call to execute the preempted workload. In this document, a drawing call refers to a call to a graphics API that causes one or more objects (e.g., one or more primitives) to be drawn during rendering. For example, the primitive count for a given drawing call is typically specified as part of the drawing call command. Such delays are undesirable or unacceptable because they potentially cause the GPU 102 to fail to execute the high-priority workload that initiated the preemption of the lower-priority workload in time before the specified deadline. Therefore, it is generally desirable to reduce such delays to avoid missing the execution deadline for such high-priority workloads.

[0067] For example, in extended reality (XR) applications (such as virtual reality (VR), augmented reality (AR), or mixed reality (MR) applications), the workload for rendering virtual objects in an XR scene is typically assigned low or medium priority, while periodic reprojection workloads are assigned high priority. In XR applications, reprojection (sometimes called asynchronous reprojection) is a process by which the system running the XR application (e.g., headsets, wearable displays, etc.) ensures appropriate display responsiveness to system motion, especially when GPU bottlenecks cause reduced frame rates and thus perceived input lag or latency. For example, reprojection generates a prediction of how an image frame should look based on one or more previously rendered image frames and motion data generated by one or more motion sensors of the system, typically after the previous image frames have been rendered. Reprojection workloads are often generated in parallel with regular image rendering workloads. In a typical XR application, at least one reprojection workload needs to be performed for each vertical synchronization (Vsync) of the GPU to reduce the user's perception of input lag. To ensure that the reprojection workload is executed for each Vsync, if the system is executing a lower-priority image rendering workload when the reprojection workload is ready to be executed, the system uses drawing call preemption to preempt (e.g., temporarily stop) the execution of the lower-priority image rendering workload, and executes the reprojection workload once the lower-priority workload has been successfully stopped.

[0068] For example, in automotive applications, such as automotive systems with Human-Machine Interface (HMI) displays, navigation displays, and instrument clusters, workloads for rendering HMI and navigation images are typically assigned low or medium priority, while workloads for rendering instrument cluster images are assigned high priority. In automotive applications, it is often necessary to periodically update the vehicle's instrument cluster displays so that the vehicle operator has an accurate and up-to-date understanding of various vehicle parameters indicated via the instrument cluster (e.g., speed, temperature, mileage, RPM, fuel level, etc.). In some cases, a minimum refresh rate for the instrument cluster in an automotive system is set according to industry standards, so it is beneficial to ensure that the automotive system always meets this minimum refresh rate. In some implementations, the instrument cluster displays are configured to be updated once per Vsync (e.g., via the execution of the corresponding instrument cluster workload). To ensure that the corresponding instrument cluster workload is executed for each Vsync, if the automotive system is executing a lower-priority HMI or navigation workload when the instrument cluster workload is ready to be executed, the automotive system uses drawing call preemption to temporarily stop the execution of the lower-priority workload, and executes the instrument cluster workload once the lower-priority workload has been successfully stopped.

[0069] In both the XR and automotive examples provided above, when preemption of a drawing call occurs, a higher-priority workload cannot be executed until the initially executing lower-priority workload has been successfully stopped. As indicated above, the API typically does not provide a means to break down workloads into partitions smaller than a full drawing call, where a given full drawing call must complete execution before the corresponding workload can be successfully stopped. However, the more complex the full drawing call of a low- or medium-priority workload, the longer it takes to execute, resulting in unacceptable latency in drawing call preemption when attempting to preempt such complex full drawing calls. Such latency can cause the execution of high-priority workloads (such as reprojection workloads or instrument cluster workloads) to miss the deadline by which the high-priority workload should be executed (e.g., the next Vsync). In the XR example, this causes reprojected / predicted image frames to be rendered and displayed later than expected, potentially causing motion sickness or disorientation in the user. In the automotive example, this results in unacceptable latency in refreshing the instrument cluster display, potentially causing the automotive system to fail to meet relevant standards. Therefore, it is desirable to break down low and medium priority workloads into partitions smaller than full drawing calls, allowing for faster preemption of drawing calls. The size of each preemptible partition for a given workload is referred to herein as the "preemption granularity." Workloads configured for execution in two-level loading mode have a better preemption granularity (e.g., smaller partitions) than workloads executed in non-two-level loading modes (e.g., PBB or immediate mode rendering). Two-level loading mode workloads are divided into separate executable coarse-grained partitions, and the termination of workload execution due to drawing call preemption can occur after the execution of each coarse-grained partition. Non-two-level loading workloads (such as those configured for PBB or immediate mode rendering) cannot be divided into separate executable parts in this way because batches of PBB mode workloads are not independently executable, and immediate mode rendering workloads are not divided into batches or partitions. Therefore, in some implementations described herein, the system configures low-priority and medium-priority workloads for execution in a two-tier loading mode without considering performance heuristics to improve the preemption granularity of such workloads, while selecting the loading mode for high-priority workloads based on performance heuristics.

[0070] In this example, GPU 102 is configured to reduce preemptive latency of drawing calls by configuring all applicable low-priority and medium-priority workloads to execute in a two-level loading mode. As previously indicated, workloads suitable for execution in a two-level loading mode are workloads functionally capable of executing in a two-level loading mode. Workloads configured to execute in a two-level loading mode are divided into coarse bins, each representing a different region of an image frame to be displayed, for example, where each coarse bin can be executed independently by command processor 122. In contrast to workloads not configured to execute in a two-level loading mode (which typically involve full drawing calls that require rendering the entire image frame at execution time), drawing calls for workloads configured to execute in a two-level loading mode are broken down into smaller, independently executable coarse bins, so that the entire image frame does not have to be rendered at once when drawing calls for workloads are executed in a two-level loading mode. When the execution of a low-priority or medium-priority workload in a two-level loading mode is preempted by a higher-priority workload, the command processor 122 does not need to complete the rendering of the entire drawing call that is being executed at the time the preemption indicator 506 is received. Instead, the command processor 122 only completes the rendering of the coarse load that is being executed at the time the preemption indicator 506 is received. This advantageously improves the preemption granularity, reduces preemption latency, and increases the likelihood that the preempted high-priority workload will be successfully executed before its specified deadline.

[0071] In this example, the high-priority queue 502 includes a high-priority workload consisting of a single full drawing call command (referred to here as "DC"), which in this example is not configured to execute in a two-level loading mode. The low / medium-priority queue includes a low-priority workload consisting of a single drawing call command, which already includes multiple coarse bins CB0-CB5 for execution in a two-level loading mode. For example, if command processor 122 receives a preemption indication flag 506 while executing coarse bin CB3, command processor 122 will complete the execution of coarse bin CB3 and then begin executing the high-priority workload in the high-priority queue 502. Once the high-priority workload has been executed, the command processor will resume execution of the low-priority workload by starting to render the next coarse bin CB4. In some embodiments, the number of coarse bins into which a given drawing call is divided and the size of each coarse bin are automatically or manually adjustable, and the preemption granularity is also adjusted by adjusting the number and size of the coarse bins.

[0072] It should be understood that this example is intended to be illustrative and not restrictive. According to various implementations, each of the high-priority queue 502 and the low / medium-priority queue 504 can respectively include multiple workloads, each workload having one or more drawing calls, and in some instances, based on these performance-based heuristics (e.g., according to...). Figure 2 , Figure 3 , Figure 4 Method 200, Method 300, or Method 400 (or more) divides the drawing calls included in the high-priority queue 502 into coarse warehousing for execution according to the two-level warehousing mode.

[0073] Figure 6 An exemplary processing flow of method 600 is shown, which assigns workloads to queues based on their respective priorities, and selectively executes workloads in a two-tier loading mode or a non-two-tier loading mode based on the respective priorities of the workloads, and for high-priority workloads based on performance data generated by performance counters or sensors. Method 600 is about... Figure 1 Exemplary specific implementations of the device 100 and its constituent components and modules and regarding Figure 5 The example is used to describe this.

[0074] At box 602, UMD 110 (e.g., executed by CPU 104) identifies a new workload that is ready to be recorded in command buffer 114.

[0075] At block 604, UMD 110 determines the priority of the workload. In some embodiments, each workload includes a priority indicator identifier that specifies a priority level for that workload (e.g., high priority, medium priority, or low priority in this example). In response to determining that the workload is a high priority workload, method 600 proceeds to block 606. In response to determining that the workload is a low priority workload or a medium priority workload, method 600 proceeds to block 614.

[0076] At box 606, UMD 110 determines the loading pattern for high-priority workloads. In some implementations, UMD 110 bases this on whether one or more loading conditions (e.g., two-level loading conditions) have been met and whether coverage conditions (e.g., as combined) have been met. Figure 2 Method 200 (provided in blocks 204 and 206) determines the loading pattern for high-priority workloads. In some implementations, UMD 110 determines whether loading or coverage conditions are met based on performance data (such as sensor data 118 generated by sensor 108 or performance counter data generated by performance counter 116). In some implementations, the resulting parameters are calculated by UMD 110 or KMD 112.

[0077] For example, in response to determining that the loading conditions have been met but the coverage conditions have not been met, UMD 110 determines that high-priority workloads should be configured to be executed in a two-level loading mode, and method 600 proceeds to block 614.

[0078] For example, in response to determining that loading conditions are not met or that loading conditions are met and coverage conditions are met, UMD110 determines that high-priority workloads should be configured to be executed in a non-two-level loading mode, and method 600 proceeds to block 608.

[0079] At box 608, the UMD 110 enables a non-two-level loading mode for high-priority workloads. In some implementations, when a high-priority workload is logged into a buffer in command buffer 114, the UMD 110 configures the high-priority workload to execute in a non-two-level loading mode. In some implementations, all high-priority workloads are configured to execute in a non-two-level loading mode by default. In some implementations, the UMD 110 sets one or more patch enable values, status bits, or both to indicate that high-priority workloads (and in some cases, all high-priority workloads) should execute in a non-two-level loading mode.

[0080] At box 614, UMD 110 enables a two-level loading mode for high-priority workloads. In some implementations, when a high-priority workload is logged into a buffer in command buffer 114, UMD 110 configures the high-priority workload to execute in a two-level loading mode. In some implementations, UMD 110 sets one or more patch enable values, status bits, or both to indicate that high-priority workloads (and in some cases, all high-priority workloads) should execute in a two-level loading mode.

[0081] At box 610, after UMD 110 has enabled the determined loading mode for high-priority workloads, UMD 110 submits the high-priority workloads to GPU 102, and the high-priority workloads are added to the high-priority queue (e.g., Figure 5 (Exemplary implementation of high-priority queue 502).

[0082] At box 612, high-priority workloads are executed in a loading mode (e.g., two-level loading mode or non-two-level loading mode) defined at GPU 102 and box 606. In some implementations, the execution of high-priority workloads precedes the execution of lower-priority workloads.

[0083] At box 616, the UMD 110 enables a two-level loading mode for low-priority or medium-priority workloads. In some implementations, when a low-priority or medium-priority workload is logged into a buffer in command buffer 114, the UMD 110 configures the low-priority or medium-priority workload to execute in the two-level loading mode. In some implementations, all low-priority or medium-priority workloads are automatically configured to execute in the two-level loading mode by default, where applicable (i.e., functionally capable).

[0084] At box 618, after the UMD 110 has enabled the two-level loading mode for low-priority or medium-priority workloads, the UMD 110 submits the low-priority or medium-priority workloads to the GPU 102, and the low-priority or medium-priority workloads are added to the low / medium-priority queue (e.g., Figure 5 (Exemplary implementation of high-priority queue 502).

[0085] At box 620, low-priority or medium-priority workloads are executed at GPU 102 in a two-level loading mode. In some implementations, the execution of low-priority or medium-priority workloads is temporarily halted (e.g., via preemption of drawing calls) to allow one or more high-priority workloads to be executed at GPU 102.

[0086] Figure 7 An exemplary processing flow of method 700 is shown, which preempts the execution of lower-priority workloads (e.g., low-priority or medium-priority workloads) from low / medium-priority queues in a two-level loading mode at the GPU in order to execute higher-priority workloads from high-priority queues. Method 700 is about... Figure 1 Exemplary specific implementations of the device 100 and its constituent components and modules and regarding Figure 5 The example is used to describe this.

[0087] At box 702, the command processor 122 of GPU 102 begins executing a first workload (i.e., a low-priority or medium-priority workload) from low / medium priority queue 504 in a two-level loading mode. For example, each full drawing call of the first workload is divided into multiple coarse bins, each coarse bin representing a corresponding different region of an image frame rendered via the drawing call, and each coarse bin is individually executable.

[0088] At block 704, when executing the first workload, GPU 102 continuously or periodically determines whether it has received a preemption notification, such as preemption notification 506. In some implementations, a scheduler (e.g., via a driver such as UMD 110 or KMD 112 at CPU 104, or via a firmware implementation at GPU 102) sends a preemption notification to GPU 102 in response to determining that a high-priority workload has been submitted to the high-priority queue 502. If GPU 102 does not receive a preemption notification while continuing to execute the first workload, method 700 proceeds to block 706, where GPU 102 terminates the execution of the first workload in a two-level loading mode. If GPU 102 receives a preemption notification while executing the first workload, method 700 proceeds to block 708.

[0089] At box 708, GPU 102 determines whether it will only partially render the coarse binaries of the first workload when a preemption notification is received while executing the first workload (e.g., the preemption notification is received while GPU 102 is rendering the coarse binaries). In response to GPU 102 identifying a partially rendered coarse binary, method 700 proceeds to box 708. Otherwise, method 700 proceeds to box 712.

[0090] At box 710, GPU 102 (e.g., command processor 122 of GPU 102) completes the rendering of the rough container.

[0091] At box 712, after determining that there are no partially rendered coarse bins or that all identified partially rendered coarse bins have been rendered, GPU 102 executes (e.g., using command processor 122) a second workload (e.g., a high-priority workload) from high-priority queue 504, the second workload corresponding to the preemption notification received by GPU 102 in the most recent iteration at box 704.

[0092] At box 714, once the second workload is executed, GPU 102 resumes execution of the first workload in the two-level loading mode. Once execution of the first workload is resumed, method 700 returns to box 704 to determine whether GPU 102 has received any additional preemption notifications before completing the execution of the first workload.

[0093] As described above, in some embodiments, a method includes: executing a first workload by at least one processing unit of the system in a first loading mode; and executing a second workload by the at least one processing unit in a selected loading mode based on a performance heuristic of the system, the selected loading mode being selected from one of the first loading mode and a second loading mode. In one aspect, the method includes: determining, by the at least one processing unit, that the first workload is a low-priority workload based on a first priority indicator of the first workload; executing the first workload in the first loading mode in response to determining that the first workload is a low-priority workload; and determining, by the at least one processing unit, that the second workload is a high-priority workload based on a second priority indicator of the second workload; executing the second workload in the second loading mode in response to determining that the second workload is a high-priority workload. In one aspect, the first loading mode is a two-level loading mode, and the second loading mode is a non-two-level loading mode.

[0094] In one aspect, the first loading mode is a two-level loading mode, and the method further includes configuring a first workload to be executed in the first loading mode by: dividing an image frame associated with the first workload into a plurality of coarse bins; dividing each of the plurality of coarse bins into a plurality of fine bins; and segmenting a plurality of primitives associated with the image frame of the first workload into time-dependent primitive batches. In another aspect, the method includes: receiving a preemption notification by the at least one processing unit while executing a first coarse bin among the plurality of coarse bins of the first workload; stopping the execution of the first workload by the at least one processing unit in response to receiving the preemption notification, wherein execution of a second workload occurs when the execution of the first workload stops; and resuming the execution of the first workload by the at least one processing unit once the second workload has been executed. In yet another aspect, the method includes: completing the execution of the first coarse bin of the first workload before stopping the execution of the first workload, wherein resuming the execution of the first workload includes: initiating the execution of a second coarse bin among the plurality of coarse bins of the first workload.

[0095] In one aspect, the method includes: selecting a selected loading mode for a second workload by: determining, based on a system performance heuristic, whether two-level loading conditions corresponding to the two-level loading mode have been met; and determining, based on a system performance heuristic, whether coverage conditions have been met. In another aspect, the two-level loading conditions include at least one of the following: the average temperature of the system including the at least one processing unit exceeds a first predefined temperature threshold; a first rate of change of the system's average temperature exceeds a second predefined threshold; a local temperature at a defined location of the system exceeds a third predefined threshold; a second rate of change of the local temperature exceeds a fourth predefined threshold; the average power consumption of the system exceeds a fifth predefined threshold; the peak instantaneous power consumption of the system exceeds a sixth predefined threshold; or the state of charge of the battery is below a seventh predefined threshold. In yet another aspect, the performance heuristic includes at least one of the following: the average temperature of the system including the at least one processing unit; the first rate of change of the system's average temperature; the average power consumption of the system; the second rate of change of the average power consumption; the peak instantaneous power consumption of the system; the state of charge of the system's battery; or the suitability of the second workload for execution in the two-level loading mode.

[0096] In some embodiments, an apparatus includes: at least one processing unit configured to: execute a first workload in a first loading mode; and execute a second workload in a selected loading mode based on the apparatus's performance heuristics, the selected loading mode being chosen from one of the first loading mode and the second loading mode. In one aspect, the at least one processing unit is further configured to: determine that the first workload is a low-priority workload based on a first priority indicator of the first workload; in response to determining that the first workload is a low-priority workload, the first workload is executed in the first loading mode; and determine that the second workload is a high-priority workload based on a second priority indicator of the second workload; in response to determining that the second workload is a high-priority workload, the second workload is executed in the selected loading mode. In one aspect, the first loading mode is a two-level loading mode, and the second loading mode is a non-two-level loading mode.

[0097] In one aspect, the at least one processing unit is configured to: configure a first workload to be executed in a two-level loading mode by: dividing an image frame associated with the first workload into a plurality of coarse bins; dividing each of the plurality of coarse bins into a plurality of fine bins; and segmenting a plurality of primitives associated with the image frame of the first workload into time-dependent primitive batches. In another aspect, the at least one processing unit is further configured to: receive a preemption notification while executing a first coarse bin among the plurality of coarse bins of the first workload; stop the execution of the first workload in response to receiving the preemption notification; execute a second workload when the first workload stops; and resume the execution of the first workload once the second workload has been executed. In yet another aspect, the at least one processing unit is further configured to: complete the execution of the first coarse bin before stopping the execution of the first workload, wherein resuming the execution of the first workload includes resuming the execution of the second coarse bin among the plurality of coarse bins of the first workload.

[0098] In some embodiments, an apparatus includes: at least one processing unit configured to: receive a preemption notification while executing a first coarse bin of an image frame of a first workload in a two-level loading mode; stop execution of the first workload in response to receiving the preemption notification and after completion of execution of the first coarse bin; execute a second workload in a selected loading mode when the first workload is interrupted; and resume execution of the first workload once the second workload has been executed. In one aspect, the at least one processing unit is further configured to: select a selected loading mode based on a device performance heuristic, choosing between a two-level loading mode and a non-two-level loading mode. In another aspect, the at least one processing unit is further configured to: configure the first workload to be executed in a two-level loading mode by: dividing an image frame associated with the first workload into a plurality of coarse bins including the first coarse bin; dividing each of the plurality of coarse bins into a plurality of fine bins; and segmenting a plurality of primitives associated with the image frame of the first workload into time-dependent primitive batches.

[0099] In one aspect, the at least one processing unit is configured to execute a second coarse bin among the plurality of coarse bins of an image frame upon resumption of execution of the first workload. In another aspect, the at least one processing unit is further configured to: determine that the first workload is a low-priority workload based on a first priority indicator of the first workload; determine that the second workload is a high-priority workload based on a second priority indicator of the second workload; submit the first workload to a first queue; and submit the second workload to a second queue different from the first queue.

[0100] In some implementations, the above-described devices and techniques are implemented in systems including one or more integrated circuit (IC) devices (also known as integrated circuit packages or microchips), such as those referenced above. Figure 1 The device 100 includes a GPU 102, a CPU 104, and a system memory 106. Electronic design automation (EDA) and computer-aided design (CAD) software tools can be used in the design and manufacture of these IC devices. These design tools are typically represented as one or more software programs. One or more software programs include code executable by a computer system to manipulate the computer system to operate on code representing circuitry of one or more IC devices to perform at least a portion of a process for designing or adapting a manufacturing system to manufacture the circuitry. The code may include instructions, data, or a combination of instructions and data. Software instructions representing design or manufacturing tools are typically stored in a computer-readable storage medium accessible to the computing system. Similarly, code representing one or more stages of the design or manufacture of the IC device may be stored in or accessed from the same computer-readable storage medium or different computer-readable storage media.

[0101] Computer-readable storage media can include any non-transitory storage medium or a combination of non-transitory storage media that can be accessed by a computer system during use to provide instructions and / or data to the computer system. Such storage media can include, but are not limited to, optical media (e.g., optical discs (CDs), digital versatile optical discs (DVDs), Blu-ray discs), magnetic media (e.g., floppy disks, magnetic tapes, or magnetic hard disks), volatile memory (e.g., random access memory (RAM) or cache), non-volatile memory (e.g., read-only memory (ROM) or flash memory), or microelectromechanical systems (MEMS) based storage media. Computer-readable storage media can be embedded in a computing system (e.g., system RAM or ROM), fixedly attached to a computing system (e.g., a magnetic hard disk), removably attached to a computing system (e.g., an optical disc or a flash memory based on a universal serial bus (USB)), or coupled to a computer system via a wired or wireless network (e.g., a network accessible storage device (NAS)).

[0102] In some implementations, certain aspects of the above-described techniques may be implemented by one or more processors of a processing system executing the software. The software includes one or more sets of executable instructions stored or otherwise tangibly embodied on a non-transitory computer-readable storage medium. The software may include instructions and certain data that, when executed by one or more processors, manipulate one or more processors to perform one or more aspects of the above-described techniques. The non-transitory computer-readable storage medium may include, for example, disk or optical disk storage devices, solid-state storage devices such as flash memory, cache memory, random access memory (RAM), or one or more other non-volatile memory devices. The executable instructions stored on the non-transitory computer-readable storage medium may be source code, assembly language code, object code, or other instruction formats that are interpreted or otherwise executed by one or more processors.

[0103] It should be noted that not all activities or elements described above in the general description are essential. A particular activity or part of the apparatus may not be essential, and one or more additional activities may be performed, or elements may be included in addition to those described. Furthermore, the order in which the activities are listed is not necessarily the order in which they are performed. Additionally, these concepts have been described with reference to specific embodiments. However, those skilled in the art will understand that various modifications and changes may be made without departing from the scope of this disclosure as set forth in the following claims. Therefore, the specification and drawings are to be considered illustrative rather than restrictive, and all such modifications are intended to be included within the scope of this disclosure.

[0104] The benefits, other advantages, and solutions to problems have been described above with respect to specific embodiments. However, the benefits, advantages, solutions to problems, and any features that may lead to or make any benefit, advantage, or solution appear or become more significant should not be construed as key, essential, or fundamental features of any or all claims. Furthermore, the specific embodiments disclosed above are merely illustrative, as the disclosed subject matter can be modified and practiced in different but equivalent ways that will be apparent to those skilled in the art who benefit from the teachings herein. No limitation is intended on the details of the constructions or designs shown herein, except as described in the following claims. Therefore, it will be apparent that the specific embodiments disclosed above can be altered or modified, and all such changes are considered to be within the scope of the disclosed subject matter. Therefore, the protection sought herein is set forth in the following claims.

Claims

1. A computer processing method, comprising: The first workload is executed by at least one graphics processing unit of the system in a two-level loading mode that includes coarse-level loading and fine-level loading. as well as The at least one graphics processing unit performs a second workload in a selected loading mode based on the system's performance heuristics, the selected loading mode being chosen from either the two-level loading mode or the single-level loading mode.

2. The method according to claim 1, further comprising: The first workload is determined to be a low-priority workload by the at least one graphics processing unit based on a first priority indicator of the first workload, and in response to the determination that the first workload is a low-priority workload, the first workload is executed in the two-level loading mode; as well as The at least one graphics processing unit determines that the second workload is a high-priority workload based on a second priority indicator of the second workload, and in response to determining that the second workload is a high-priority workload, the second workload is executed in the single-level loading mode.

3. The method according to claim 1, further comprising: The first workload is configured to execute in the two-tier loading mode as follows: The image frames associated with the first workload are divided into multiple coarse bins; For each of the plurality of coarse bins, the coarse bin is divided into a plurality of fine bins; as well as The multiple primitives associated with the image frames of the first workload are segmented into time-dependent primitive batches.

4. The method according to claim 3, further comprising: The at least one graphics processing unit receives a preemption notification when executing the first coarse bin among the plurality of coarse bins of the first workload; The at least one graphics processing unit stops the execution of the first workload in response to receiving the preemption notification, wherein the execution of the second workload occurs when the execution of the first workload stops; and Once the second workload is executed, the execution of the first workload is resumed by the at least one graphics processing unit.

5. The method according to claim 4, further comprising: Before stopping the execution of the first workload, complete the execution of the first coarse warehouse of the first workload, wherein resuming the execution of the first workload includes: Initiate the execution of the second coarse warehouse among the plurality of coarse warehouses of the first workload.

6. The method according to claim 1, further comprising: The selected loading mode for the second workload is selected as follows: The system's performance heuristics are used to determine whether the two-level loading conditions corresponding to the two-level loading mode have been met. as well as The system's performance heuristics are used to determine whether the coverage condition has been met.

7. The method of claim 6, wherein the two-stage loading conditions include at least one of the following: the average temperature of the system including the at least one graphics processing unit exceeds a first predefined temperature threshold; a first rate of change of the average temperature of the system exceeds a second predefined threshold; a local temperature at a defined location of the system exceeds a third predefined threshold; a second rate of change of the local temperature exceeds a fourth predefined threshold; the average power consumption of the system exceeds a fifth predefined threshold; the peak instantaneous power consumption of the system exceeds a sixth predefined threshold; or the state of charge of the battery is below a seventh predefined threshold.

8. The method of claim 6 or claim 7, wherein the performance heuristic comprises at least one of the following: the average temperature of the system including the at least one graphics processing unit, a first rate of change of the average temperature of the system, the average power consumption of the system, a second rate of change of the average power consumption, the peak instantaneous power consumption of the system, the state of charge of the battery of the system, or the suitability of the second workload for execution in the two-stage loading mode.

9. A computer processing device, comprising: At least one graphics processing unit, the at least one graphics processing unit being configured to: Execute the first workload in a two-tier loading mode that includes coarse-level loading and fine-level loading; and A second workload is executed in a selected loading mode based on the performance heuristic of the device, the selected loading mode being chosen from either the two-level loading mode or the single-level loading mode.

10. The device of claim 9, wherein the at least one graphics processing unit is further configured to: Based on a first priority indicator of the first workload, the first workload is determined to be a low-priority workload; in response to determining that the first workload is a low-priority workload, the first workload is executed in the two-level loading mode; and The second workload is determined to be a high-priority workload based on a second priority indicator of the second workload, and in response to determining that the second workload is a high-priority workload, the second workload is executed in the selected loading mode.

11. The device of claim 9, wherein the at least one graphics processing unit is configured to: The first workload is configured to execute in the two-tier loading mode as follows: The image frames associated with the first workload are divided into multiple coarse bins; For each of the plurality of coarse bins, the coarse bin is divided into a plurality of fine bins; as well as The multiple primitives associated with the image frames of the first workload are segmented into time-dependent primitive batches.

12. The device of claim 11, wherein the at least one graphics processing unit is further configured to: Receive a preemption notification while executing the first coarse warehouse among the plurality of coarse warehouses of the first workload; In response to receiving the preemption notification, the execution of the first workload is stopped; Execute the second workload when the first workload stops; and Once the second workload is executed, the execution of the first workload is resumed.

13. The device of claim 12, wherein the at least one graphics processing unit is further configured to: The execution of the first coarse warehouse is completed before the execution of the first workload is stopped, wherein resuming the execution of the first workload includes resuming the execution of the second coarse warehouse among the plurality of coarse warehouses of the first workload.

Citation Information

Patent Citations

  • Computer system, graphics processing unit and graphics processing method thereof

    CN109242756A

  • Method for parallel fine rasterization in a raster stage of a graphics pipeline

    US20070296725A1