WO2020243482A1 - Graphics context bouncing - Google Patents
Graphics context bouncing Download PDFInfo
- Publication number
- WO2020243482A1 WO2020243482A1 PCT/US2020/035203 US2020035203W WO2020243482A1 WO 2020243482 A1 WO2020243482 A1 WO 2020243482A1 US 2020035203 W US2020035203 W US 2020035203W WO 2020243482 A1 WO2020243482 A1 WO 2020243482A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- state
- context
- processor
- identifier
- identifiers
- Prior art date
Links
- 238000000034 method Methods 0.000 claims abstract description 31
- 238000012545 processing Methods 0.000 claims abstract description 30
- 230000004044 response Effects 0.000 claims description 15
- 101150060512 SPATA6 gene Proteins 0.000 description 96
- 230000015654 memory Effects 0.000 description 28
- 239000000872 buffer Substances 0.000 description 19
- 230000008901 benefit Effects 0.000 description 10
- 238000010586 diagram Methods 0.000 description 8
- 230000001419 dependent effect Effects 0.000 description 7
- 230000008569 process Effects 0.000 description 7
- 238000009877 rendering Methods 0.000 description 5
- 238000005096 rolling process Methods 0.000 description 5
- 230000000694 effects Effects 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 239000003086 colorant Substances 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- SPBWHPXCWJLQRU-FITJORAGSA-N 4-amino-8-[(2r,3r,4s,5r)-3,4-dihydroxy-5-(hydroxymethyl)oxolan-2-yl]-5-oxopyrido[2,3-d]pyrimidine-6-carboxamide Chemical compound C12=NC=NC(N)=C2C(=O)C(C(=O)N)=CN1[C@@H]1O[C@H](CO)[C@@H](O)[C@H]1O SPBWHPXCWJLQRU-FITJORAGSA-N 0.000 description 1
- 102100035964 Gastrokine-2 Human genes 0.000 description 1
- 101001075215 Homo sapiens Gastrokine-2 Proteins 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 239000013256 coordination polymer Substances 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 235000003642 hunger Nutrition 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000000638 solvent extraction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/38—Concurrent instruction execution, e.g. pipeline or look ahead
- G06F9/3836—Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution
- G06F9/3838—Dependency mechanisms, e.g. register scoreboarding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/38—Concurrent instruction execution, e.g. pipeline or look ahead
- G06F9/3836—Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution
- G06F9/3851—Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution from multiple instruction streams, e.g. multistreaming
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T1/00—General purpose image data processing
- G06T1/20—Processor architectures; Processor configuration, e.g. pipelining
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/10—Address translation
- G06F12/1009—Address translation using page tables, e.g. page table structures
- G06F12/1018—Address translation using page tables, e.g. page table structures involving hashing techniques, e.g. inverted page tables
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/38—Concurrent instruction execution, e.g. pipeline or look ahead
- G06F9/3877—Concurrent instruction execution, e.g. pipeline or look ahead using a slave processor, e.g. coprocessor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T1/00—General purpose image data processing
- G06T1/60—Memory management
Definitions
- a graphics processing unit is a processing unit that is specially designed to perform graphics processing tasks.
- a GPU may, for example, execute graphics processing tasks required by an end-user application, such as a video game application.
- an end-user application such as a video game application.
- the end-user application communicates with the GPU via an application programming interface (API).
- API allows the end-user application to output graphics data and commands in a standardized format, rather than in a format that is dependent on the GPU.
- a graphics pipeline includes a plurality of processing blocks that work on different steps of an instruction at the same time. Pipelining enables a GPU to take advantage of parallelism that exists among the steps needed to execute the instruction. As a result, a GPU can execute more instructions in a shorter period of time.
- the output of the graphics pipeline is dependent on the state of the graphics pipeline.
- the state of a graphics pipeline is updated based on state packages (e.g., context-specific constants including texture handlers, shader constants, transform matrices, and the like) that are locally stored by the graphics pipeline. Because the context-specific constants are locally maintained, they can be quickly accessed by the graphics pipeline.
- FIG. 1 is a block diagram illustrating a system including a graphics processing unit configured to employ graphics context bouncing in accordance with some embodiments.
- FIG. 2 is a block diagram illustrating processing of command stream instructions at the GPU of FIG. 1 in accordance with some embodiments.
- FIG. 3 is a block diagram illustrating draining of encapsulated state at the GPU of FIG. 1 in accordance with some embodiments.
- FIG. 4 is a flow diagram illustrating a method of graphics context bouncing in accordance with some embodiments.
- a central processing unit (CPU) of a system often issues to a GPU a call, such as a draw call, which includes a series of commands instructing the GPU to draw an object according to the CPU’s instructions.
- a draw call which includes a series of commands instructing the GPU to draw an object according to the CPU’s instructions.
- the draw call uses various configurable settings to decide how meshes and textures are rendered.
- a common GPU workflow involves updating the values of constants in a memory array and then performing a draw operation using the constants as data.
- a GPU whose memory array contains a given set of constants may be considered to be in a particular state.
- context state also referred to as“rendering state”,“GPU state”, or simply“state”
- the context state provides a definition of how meshes are rendered and includes information such as the current vertex/index buffers, the current vertex/pixel shader programs, shader inputs, texture, material, lighting, transparency, and the like.
- the context state contains information unique to the draw or set of draws being rendered at the graphics pipeline. Context therefore refers to the required GPU pipeline state to correctly draw something.
- Pipelining enables a GPU to work on different steps of an instruction at the same time, thereby taking advantage of parallelism that exists among the steps needed to execute the instruction. As a result, the GPU can execute more instructions in a shorter period of time.
- the video data output by the graphics pipeline are dependent on state packages (e.g., context-specific constants) that are locally stored by the graphics pipeline.
- state packages e.g., context-specific constants
- the state settings e.g. values of constants in memory
- the context-specific constants are locally maintained for quick access by the graphics pipeline.
- GPU hardware is generally memory constrained and only locally stores (and therefore operates on) a limited number of sets of context state. Accordingly, the GPU will often change context state in order to start working on a new set of context registers because the graphics pipeline state needs to be changed to draw something else.
- the GPU performs a context roll to a newly supplied context to release the current context by copying the current registers into a newly allocated context before applying any new state updates by programming fresh register values. Due to the limited number of context state sets stored locally, the GPU sometimes runs out of context and the graphics pipeline is stalled while waiting for a context to be freed so that a new context may be allocated.
- the CPU reuses a context state that was previously active, and without context bouncing would release the current context and allocate a new one. If no context is available, the GPU would have to wait for one to be freed, thus introducing a stall.
- FIGs. 1-4 illustrate systems and methods for context state management by assigning hash-based identifiers to context states and switching to matching context (referred to as context bouncing) without allocating a new context.
- a method of context bouncing includes receiving, at a command processor of a graphics processing unit (GPU), a conditional execute packet providing a hash identifier corresponding to an encapsulated state.
- the encapsulated state includes one or more context state packets following the conditional execute packet.
- a command packet following the encapsulated state is executed based at least in part on determining whether the hash identifier of the encapsulated state matches one of a plurality of hash identifiers of active context states currently stored at the GPU.
- determining whether the hash identifier of the encapsulated state matches one of a plurality of hash identifiers includes querying a context manager to search a hash table storing the plurality of hash identifiers of active context states currently stored at the GPU.
- context bouncing also includes draining the
- encapsulated state in response to determining the hash identifier matches one of the plurality of hash identifiers of active context states.
- a new context state set is allocated in response to determining the hash identifier does not match any of the plurality of hash identifiers of active context states.
- one or more context state packets of the encapsulated state are executed prior to executing the command packet. Bouncing back to an existing context (i.e. , without allocating a new context) reduces the likelihood of running out of context and stalling the graphics pipeline.
- FIG. 1 is a block diagram illustrating a system 100 including a graphics processing unit configured to employ graphics context bouncing in accordance with some embodiments.
- the system 100 includes a central processing unit (CPU) 102, a graphics processing unit (GPU) 104, a device memory 106 utilized by the GPU 104, and a system memory 108 shared by the CPU 102 and the GPU 104.
- the GPU 104 may be a dedicated device, several devices, or integrated into a larger device (e.g., a north bridge device).
- the memories 106, 108 include any of a variety of random access memories (RAMs) or combinations thereof, such as a double-data-rate dynamic random access memory (DDR DRAM), a graphics DDR DRAM (GDDR DRAM), and the like.
- the GPU 104 communicates with the CPU 102, the device memory 106, and the system memory 108 via a bus 1 10.
- the bus 1 10 includes any type of bus used in computing systems, including, but not limited to, a peripheral component interface (PCI) bus, an accelerated graphics port (AGP) bus, a PCI Express (PCIE) bus, and the like.
- PCI peripheral component interface
- AGP accelerated graphics port
- PCIE PCI Express
- the CPU 102 sends instructions intended for processing at the GPU 104 to command buffers.
- the command buffer may be located, for example, in system memory 108 in a separate memory coupled to the bus 1 10 (e.g., device memory 106).
- the CPU 102 includes a number of processes, such as executing one or more application(s) 1 12 to generate graphic commands and a user mode driver 1 16 (or other drivers, such as a kernel mode driver).
- the one or more applications 1 12 include applications that utilizes the functionality of GPU 104.
- An application 1 12 may include one or more graphics instructions that instruct GPU 104 to render a graphical user interface (GUI) and/or a graphics scene.
- GUI graphical user interface
- the graphics instructions may include instructions that define a set of one or more graphics primitives to be rendered by GPU 104.
- the application 1 12 utilizes a graphics application programming interface (API) 1 14 to invoke a user mode driver 1 16 (or a similar GPU driver.
- User mode driver 1 16 issues one or more commands to GPU 104 for rendering one or more graphics primitives into displayable graphics images.
- the user mode driver 1 16 formulates one or more graphics commands that specify one or more operations for GPU 104 to perform for rendering graphics.
- the user mode driver 1 16 is a part of the application 1 12 running on the CPU 102.
- the user mode driver 1 16 may be part of a gaming application running on the CPU 102.
- a kernel mode driver (not shown) may be part of an operating system running on the CPU 102.
- the graphics commands generated by the user mode driver 1 16 include graphics commands intended to generate an image or a frame for display.
- the user mode driver 1 16 translates standard code received from the API 1 14 into a native format of instructions understood by the GPU 104.
- the user-mode driver 1 16 is typically written by the manufacturer of the GPU 104.
- Graphics commands generated by the user mode driver 1 16 are sent to GPU 104 for execution.
- the GPU 104 can then execute the graphics commands and use the results to control what is displayed on a display screen.
- the CPU 102 sends graphics commands intended for the GPU 104 to a command buffer 1 18.
- the command buffer 1 18 may be located, for example, in device memory 106, system memory 108, or a separate memory communicably coupled to the bus 1 10.
- the command buffer 1 18 temporarily stores a stream of graphics commands that include input to the GPU 104.
- the stream of graphics commands include, for example, one or more command packets and/or one or more state update packets.
- a command packet indudes a draw command (also interchangeably referred to as a“draw call”) instructing the GPU 104 to execute processes on image data to be output for display.
- a draw command may instruct the GPU 104 to render defined by a group of one or more vertices (e.g., defined in a vertex buffer) stored in memory.
- the geometry defined by the group of one or more vertices correspond, in some embodiments, to a plurality of primitives to be rendered.
- a state command (also interchangeably referred to as a“context state packet” or“state update packet”) instructs the GPU 104 to change one or more state variables (e.g., a draw color).
- a context state packet includes a constant or a set of constants that update the state of graphics pipeline 120 at the GPU 104.
- a state update packet may, for example, update colors that are to be drawn or blended during execution of a draw call.
- the GPU 104 includes a command processor 122 that receives commands in a command stream to be executed from the CPU 102 (e.g., via the command buffer 1 18 and bus 1 10) and coordinates execution of those commands at the graphics pipeline 120.
- the command processor 122 is implemented in hardware, firmware, software, or a combination thereof.
- the command stream includes one or more draw calls and context state packets, as described above.
- the command processor 122 also manages the context states written to registers of the graphics pipeline 120.
- the command processor in response to receiving a context state packet, sets one or more state registers in the GPU 104 to particular values based on the context state packet and/or configures one or more of fixed-function processing units based on the context state packet.
- a“packet” refers to a memory buffer encoding a single command. Different types of packets may be stored in hardware queues, memory buffers, and the like.
- the term“block” refers to a processing module included in an ASIC, an execution pipeline of a CPU, and/or a graphics pipeline of a GPU.
- Such a processing module may include, but is not limited to, an arithmetic logic unit, a multiply/divide unit, a floating point unit, a color buffer, a vertex shader, a pixel shader, a clipping unit, or some other processing module as would be apparent to a person skilled in the art.
- the graphics pipeline 120 includes a number of stages 124, including stage A 124a, stage B 124b, and through stage N 124n.
- the various stage 124 each represent a stage of the graphics pipeline 120 that execute various aspects of a draw call.
- the command processor 122 writes context state updates to local banks of context registers for storing and updating operating state. As illustrated in FIG. 1 , the command processor writes state updates to current state registers 126.
- queue buffers Conventional context management techniques dispatch information or command packets to buffers (sometimes referred to as queue buffers). Such queue buffers are created in a first-in-first-out (FIFO)-like sequence to which running programs submits commands.
- FIFO first-in-first-out
- FIFO first-in-first-out
- sequential processes may be run on one state set but if the driver changes context state after performing a draw operation, the CP must execute a sequence of register writes followed by a read to ensure completion once the GPU changes to a different state set.
- This context rolling process for a new context includes the command processor 122 sending an event down the graphics pipeline to release the current context.
- the command processor is notified and allows the context to be reused (or a new context to be allocated).
- these context rolling processes increases the likelihood of running out of contexts to use and stalling the graphics pipeline until the draw call associated with the current context completes processing through the various stages of the graphics pipeline.
- GPU operations are pipelined with various amounts of work in flight at any given moment; stalling the graphics pipeline such that in-flight tasks must retire before changing state increases likelihood of starving the GPU backend.
- the GPU 104 includes a graphics context manager 128.
- the graphics context manager 128 maintains a hash table 130 storing a set of hash-based identifiers corresponding to sets of context state currently stored at registers of the GPU 104.
- the graphics context manager 128 further includes a context allocation logic module 132 for performing the hash identifier search and context allocation operations described herein.
- the user mode driver 1 16 provides a unique hash identifier to identify a new context state that the user mode driver 1 16 programs into a graphics command.
- the user mode driver 1 16 indicates to the command processor 122, via a new state packet (or other token method), to scan for all active states at the GPU 104 and determine whether the unique hash identifier of the new context matches any one of the plurality of hash identifiers of currently active context states (i.e. , hash identifiers stored at the hash table 130).
- the command processor 122 queries the graphics context manager 128 to search the hash table 130 for determining whether the hash table 130 stores the requested unique hash identifier corresponding to the new context (i.e., indicating that the context is available for use). If the hash table 130 does not contain the requested unique hash identifier, then the graphics context manager 128 allocates a new context using the requested unique hash identifier. However, if the hash table 130 does contain the requested unique hash identifier (thereby informing that the requested unique hash identifier corresponds to a state that is already active at the GPU 104), then the graphics context manager 128 returns that context.
- the GPU 104 performs context bouncing by switching back to the existing, matching context that is already running at the GPU 104 without allocating a new context (e.g., in a manner similar to how a cache memory shares cache lines). Accordingly, the GPU 104 can run non- sequential processes on multiple state sets provided that the state sets are still available (i.e., loaded at the GPU 104).
- This approach more efficiently utilizes the onboard state of the GPU 104 and reduces a number of stalls associated with running out of contexts to use, especially when the application 1 12 is quickly toggling between a small number of states (which would involve context rolling and acquiring new states as the state changes after each draw in conventional context
- FIG. 2 is a block diagram illustrating an embodiment in which the CPU 102 sends instructions intended for the GPU 104 in accordance with some embodiments. As illustrated, the CPU 102 sends instructions to the command buffer 1 18.
- the command buffer 1 18 temporarily stores commands of the command stream from the CPU 102.
- the stream of commands includes, for example, conditional execution packets, state update packets, and draw call packets. In various embodiments, other commands may be included in the stream of commands as would be apparent to a person skilled in the art.
- a conditional execute packet is a command inserted by the user mode driver 1 16 of FIG. 1 (or other software driver) which provides the hash identifier
- the conditional execute packet also includes dword data corresponding to the size of the next group of context state packets in dwords (which is short for“double word”).
- dword data defines a number N of context state packages associated with the hash identifier of the conditional execute packet and further represents all the context register updates required to setup the context state for the next draw(s) following that hash identifier.
- the dword data also defines a number of dwords to discard if the graphics context manager 128 returns and indicates that context associated with that hash identifier is already active at the GPU 104. Based on that determination, the command processor 122 pulls from the command buffer 1 18 based on that given dword data size until all the state associated with that particular hash ID (as provided by the conditional execute packet) is discarded.
- a state update packet is a constant or a collection of constants that update the state of graphics pipeline 120.
- a state update packet may, for example, update colors that are to be blended during execution of a draw command.
- a state update packet includes a set context packet that programs multi-context registers of the GPU 104. The set context packet includes all data required to program the state in the packet.
- a state update packet also includes a load context packet which requires fetching context information from memory before the state is written to context registers of the GPU 104.
- a draw call packet is a command that causes graphics pipeline 120 to execute processes on data to be output for display.
- FIG. 2 illustrates six commands that are included in the command stream— (1 ) a conditional execute packet 202, (2) a first state update packet 204, (3) a second state update packet 206, (4) a third state update packet 208, (5) a first draw call packet 210, and (6) a second draw call packet 212.
- the draw call packet 210 is dependent on the first, second, and third state update packets 204-208 because these are the state updates that are encapsulated by the conditional execute packet 202 prior to the next draw command (i.e. , draw call packet 210).
- the term“encapsulated” refers to a number of packets used to define a given hash identifier. Accordingly, the term“encapsulated state” refers to a number of context state packets that can be conditionally executed or discarded depending on whether that given hash identifier is available (e.g., stored at registers of the GPU 104) to context bounce / switch to. In other words, an encapsulated state is a collection of context state packets used to define a given hash identifier.
- the output of operations executed by the GPU 104 is dependent on a current context state 214.
- the current context state 214 is based on the values of various context-specific constants such as texture handlers, shader constants, transform matrices, and the like which are stored in state registers.
- the current context state 214 includes registers 216A through 216N, which are representative of any number and type (e.g., general purpose register) of state registers and instruction pointer. It is noted that current context state 214 can also include other variables and other values which define the current architectural state of the GPU 104.
- a “context state” of a processing unit can also be referred to as a“context” or as a “state” of the processing unit.
- the processing unit is a GPU (e.g., GPU 104 of FIGs. 1-2). in other embodiments, the processing unit includes other types of processing units. It is noted that the terms“processing unit” and “processor” are utilized interchangeably herein.
- the command processor 122 receives the conditional execute packet 202.
- the conditional execute packet 202 informs, before the next draw command (e.g., draw call packet 210), the command processor 122 of the unique hash identifier associated with the upcoming state update packets 204-208.
- the command processor 122 queries the context manager 128 to search the hash table 130 to determine whether the unique hash identifier provided by the conditional execute packet 202 is active at the GPU 104 (and therefore stored at the hash table 130).
- the conditional execute packet 202 provides a unique hash identifier of XYZ.
- the command processor 122 queries the context manager 128 and determines that hash identifier XYZ is not present in the hash table 130. Accordingly, based on that query miss, the context manger 128 retires one of the existing hash identifiers in hardware (as tracked at the hash table 130) and allocates a new context. In various embodiments, the context manager 128 retires the least recently used (LRU) inactive hash identifier in hash table 130. The retired hash identifier is replaced with the hash identifier supplied for the query (e.g., hash identifier XYZ in this discussion) for that new context.
- LRU least recently used
- the context manager 128 indicates the query miss back to the command processor 122 and returns the new context.
- the command processor 122 then processes the encapsulated state by executing the state update packets 204-208.
- a query miss causes the GPU 104 to perform context rolling to allocate a new context, execute the upcoming state update packets 204-208, and set up the next state with the new hash identifier (i.e. , hash identifier XYZ).
- FIG. 3 is a block diagram illustrating draining of encapsulated state in
- a command stream 300 at command buffer 1 18 includes five commands— (1 ) a conditional execute packet 302, (2) a first state update packet 304, (3) a second state update packet 306, (4) a third state update packet 308, and (5) a draw call packet 310.
- the draw call packet 310 is dependent on the first, second, and third state update packets 304-308 because these are the state updates that are encapsulated by the conditional execute packet 302 prior to the next draw command (i.e. , draw call packet 310).
- the first, second, and third state update packets 304-308 are collectively referred to as the encapsulated state 312.
- the encapsulated state 312 includes three of the context state packets (i.e., as defined by conditional execute packet 302) that can be conditionally executed or discarded depending on whether that given hash identifier is available (e.g., stored at registers of the GPU 104) to context bounce / switch to.
- the conditional execute packet 302 provides a unique hash identifier of ABC.
- the command processor 122 queries the context manager 128 and determines that hash identifier ABC is present in the hash table 130. Accordingly, based on that query hit, the context manager 128 returns the context associated with the queried hash identifier (i.e., hash identifier ABC). The command processor 122 then drains the encapsulated state 312 (e.g., skipping and discarding state update packets 304-308) and assigns the context matching the query hit for execution of the draw call packet 310 using an existing context hash identifier.
- the encapsulated state 312 e.g., skipping and discarding state update packets 304-308
- the GPU 104 improves operating efficiency by realizing that the requested hash identifier is currently available at GPU hardware and switching to it rather than forcing the processor to stall from lack of available contexts.
- FIG. 4 is a flow diagram illustrating a method 400 of graphics context bouncing in accordance with some embodiments.
- a command processor of a graphics processing unit receives a conditional execute packet providing a hash identifier corresponding to an encapsulated state.
- the command processor 122 receives conditional execute packet 202 from the command buffer 1 18.
- the conditional execute packet 202 defines an
- conditional execute packet 202 defines a unique hash identifier associated with the encapsulated state (e.g., hash identifier XYZ at conditional execute packet 202 of FIG. 2 or hash identifier ABC at conditional execute packet 302 of FIG. 3). Additionally, in some embodiments, the conditional execute packet 202 also includes dword data corresponding to the size of the group of context state packets for the encapsulated state.
- the command processor determines whether the hash identifier of the encapsulated state matches one of a plurality of hash identifiers of active context states currently stored at the GPU. For example, with reference to FIG. 2, the command processor 122 queries the context manager 128 to search hash table 130 storing a plurality of hash identifiers of active context states currently stored at the GPU.
- command processor determines that the hash identifier of the
- the method 400 proceeds to block 406. However, if the command processor determines that the hash identifier of the encapsulated state matches one of the plurality of hash identifiers of active context states currently stored at the GPU, the method 400 proceeds to block 408.
- the context manger 128 retires one of the inactive existing hash identifiers in hardware (as tracked at the hash table 130) and allocates a new context based on the query miss from context manager 128 determining that hash identifier XYZ is not present in the hash table 130.
- the context manager 128 retires the least recently used (LRU) hash identifier in hash table 130.
- the context manger 128 replaces the retired hash identifier with the hash identifier supplied for the query (e.g., hash identifier XYZ in this discussion) for that new context.
- the context manager 128 indicates the query miss back to the command processor 122 and returns the new context.
- the command processor 122 processes the encapsulated state by executing the state update packets 204-208.
- a query miss causes the GPU 104 to perform context rolling to allocate a new context state set, execute the upcoming state update packets 204-208, and set up the next state with the new hash identifier (i.e. , hash identifier XYZ).
- the command processor 122 executes the command packet following the encapsulated state (e.g., state draw call packet 210 of FIG. 2).
- the context manger 128 returns the context associated with the queried hash identifier (e.g., hash identifier ABC as provided by conditional execute packet 302 of FIG. 3) to the command processor 122 based on the query hit from context manager 128 determining that hash identifier ABC is present in the hash table 130.
- the command processor 122 drains the encapsulated state 312 (e.g., skipping and discarding state update packets 304-308) and assigns the context matching the query hit for execution of the draw call packet 310 using an existing context hash identifier.
- the command processor 122 executes the command packet following the bypassed encapsulated state 312.
- the GPU 104 improves operating efficiency by realizing that the requested hash identifier is currently available at GPU hardware and switching to it rather than forcing the processor to stall from lack of available contexts.
- a context done event is sent down the graphics pipeline when a context is rolled.
- the context manager increments a counter indicating that there is a context done event outstanding.
- a context is only allowed to recycle when there are no pending context done events in the graphics pipeline.
- a graphics context bouncing system in accordance with various embodiments is described herein in terms of a GPU that executes a stream of draw commands based on context states of a graphics pipeline of the GPU. It is to be appreciated, however, that such a graphics context bouncing system is applicable to other types of ASICs or systems that execute a stream of commands based on the state of the respective systems. Based on the description contained herein, a person skilled in the relevant art(s) will understand how to implement embodiments of the present invention in such other types of systems.
- a method includes: receiving, at a command processor of a graphics processing unit (GPU), a conditional execute packet providing an identifier corresponding to an encapsulated state, wherein the encapsulated state includes one or more context state packets following the conditional execute packet; and executing, based at least in part on determining whether the identifier of the encapsulated state matches one of a plurality of identifiers of active context states currently stored at the GPU, a command packet following the encapsulated state.
- a command processor of a graphics processing unit GPU
- a conditional execute packet providing an identifier corresponding to an encapsulated state, wherein the encapsulated state includes one or more context state packets following the conditional execute packet
- executing based at least in part on determining whether the identifier of the encapsulated state matches one of a plurality of identifiers of active context states currently stored at the GPU, a command packet following the encapsulated state.
- determining whether the identifier of the encapsulated state matches one of a plurality of identifiers includes querying a context manager to search an identifier table storing the plurality of identifiers of active context states currently stored at the GPU.
- the method includes: draining, in response to determining the identifier matching one of the plurality of identifiers of active context states, the encapsulated state; and assigning the matching one of the plurality of identifiers of active context states to the command packet following the encapsulated state.
- the method includes: allocating, in response to determining the identifier does not match any of the plurality of identifiers of active context states, a new context state set; and executing the one or more context state packets of the encapsulated state prior to executing the command packet.
- the method includes: retiring, from the identifier table, one the plurality of identifiers of active context states currently stored at the GPU; and storing, at the identifier table, the identifier corresponding to the encapsulated state for the new context state set.
- the command packet includes a draw call.
- the command packet designates a size of the encapsulated state for a number of state update packets.
- a processor includes: a plurality of state registers; and a command processor, wherein the command processor is configured to: receive a conditional execute packet providing an identifier corresponding to an encapsulated state, wherein the encapsulated state includes one or more context state packets following the conditional execute packet; and execute, based at least in part on determining whether the identifier of the encapsulated state matches one of a plurality of identifiers of active context states currently stored at the processor, a command packet following the encapsulated state.
- the processor includes: a context manager including an identifier table storing the plurality of identifiers of active context states currently stored at the processor.
- the processor is configured to query the context manager to search the identifier table for the provided identifier.
- the processor is further configured to: drain, in response to determining the identifier matching one of the plurality of identifiers of active context states, the encapsulated state; and assign the matching one of the plurality of identifiers of active context states to the command packet following the encapsulated state.
- the processor is further configured to: allocate, in response to determining the identifier does not match any of the plurality of identifiers of active context states, a new context state set; and execute the one or more context state packets of the encapsulated state prior to executing the command packet.
- the processor is further configured to: retire, from the identifier table, one the plurality of identifiers of active context states currently stored at the processor; and store, at the identifier table, the identifier corresponding to the encapsulated state for the new context state set.
- the command packet designates a size of the encapsulated state for a number of state update packets.
- a non-transitory computer readable medium embodies a set of executable instructions, the set of executable instructions to manipulate at least one processor to: receive, at a command processor of the processor, a conditional execute packet providing an identifier corresponding to an encapsulated state, wherein the encapsulated state includes one or more context state packets following the conditional execute packet; and execute, based at least in part on determining whether the identifier of the encapsulated state matches one of a plurality of identifiers of active context states currently stored at the processor, a command packet following the encapsulated state.
- the set of executable instructions is to further manipulate at least one processor to query a context manager to search an identifier table storing the plurality of identifiers of active context states currently stored at the processor.
- the set of executable instructions is to further manipulate at least one processor to: drain, in response to determining the identifier matching one of the plurality of identifiers of active context states, the encapsulated state; and assign the matching one of the plurality of identifiers of active context states to the command packet following the encapsulated state.
- the set of executable instructions is to further manipulate at least one processor to: allocate, in response to determining the identifier does not match any of the plurality of identifiers of active context states, a new context state set; and execute the one or more context state packets of the encapsulated state prior to executing the command packet.
- the set of executable instructions is to further manipulate at least one processor to: retire, from the identifier table, one the plurality of identifiers of active context states currently stored at the processor; and store, at the identifier table, the identifier corresponding to the encapsulated state for the new context state set.
- the command packet designates a size of the encapsulated state for a number of state update packets.
- a computer readable storage medium may include any non-transitory storage medium, or combination of non-transitory storage media, accessible by a computer system during use to provide instructions and/or data to the computer system.
- Such storage media can include, but is not limited to, optical media (e.g., compact disc (CD), digital versatile disc (DVD), Blu-Ray disc), magnetic media (e.g., floppy disc , magnetic tape, or magnetic hard drive), 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.
- optical media e.g., compact disc (CD), digital versatile disc (DVD), Blu-Ray disc
- magnetic media e.g., floppy disc , magnetic tape, or magnetic hard drive
- volatile memory e.g., random access memory (RAM) or cache
- non-volatile memory e.g., read-only memory (ROM)
- the computer readable storage medium may be embedded in the computing system (e.g., system RAM or ROM), fixedly attached to the computing system (e.g., a magnetic hard drive), removably attached to the computing system (e.g., an optical disc or Universal Serial Bus (USB)-based Flash memory), or coupled to the computer system via a wired or wireless network (e.g., network accessible storage (NAS)).
- system RAM or ROM system RAM or ROM
- USB Universal Serial Bus
- NAS network accessible storage
- certain aspects of the techniques described above may implemented by one or more processors of a processing system executing 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 can include the instructions and certain data that, when executed by the one or more processors, manipulate the one or more processors to perform one or more aspects of the techniques described above.
- the non-transitory computer readable storage medium can include, for example, a magnetic or optical disk storage device, solid state storage devices such as Flash memory, a cache, random access memory (RAM) or other non-volatile memory device or devices, and the like.
- the executable instructions stored on the non-transitory computer readable storage medium may be in source code, assembly language code, object code, or other instruction format that is interpreted or otherwise executable by one or more processors.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Multimedia (AREA)
- Image Generation (AREA)
- Advance Control (AREA)
- Devices For Executing Special Programs (AREA)
Abstract
Description
Claims
Priority Applications (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
EP20813774.5A EP3977270A4 (en) | 2019-05-30 | 2020-05-29 | Graphics context bouncing |
CN202080043155.7A CN113939843A (en) | 2019-05-30 | 2020-05-29 | Graphic context jitter |
KR1020217042931A KR102682383B1 (en) | 2019-05-30 | 2020-05-29 | Graphics context bouncing |
JP2021571386A JP7402897B2 (en) | 2019-05-30 | 2020-05-29 | graphics context bouncing |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US16/426,613 | 2019-05-30 | ||
US16/426,613 US11169811B2 (en) | 2019-05-30 | 2019-05-30 | Graphics context bouncing |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020243482A1 true WO2020243482A1 (en) | 2020-12-03 |
Family
ID=73550703
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/US2020/035203 WO2020243482A1 (en) | 2019-05-30 | 2020-05-29 | Graphics context bouncing |
Country Status (6)
Country | Link |
---|---|
US (1) | US11169811B2 (en) |
EP (1) | EP3977270A4 (en) |
JP (1) | JP7402897B2 (en) |
KR (1) | KR102682383B1 (en) |
CN (1) | CN113939843A (en) |
WO (1) | WO2020243482A1 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11694384B2 (en) * | 2020-10-30 | 2023-07-04 | Qualcomm Incorporated | Fast incremental shared constants |
US20230076376A1 (en) * | 2021-09-09 | 2023-03-09 | Texas Instruments Incorporated | Resource access in a microcontroller |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100131549A1 (en) * | 2006-02-08 | 2010-05-27 | Oblong Industries, Inc. | Multi-process interactive systems and methods |
US7979683B1 (en) * | 2007-04-05 | 2011-07-12 | Nvidia Corporation | Multiple simultaneous context architecture |
US20150123980A1 (en) * | 2013-11-05 | 2015-05-07 | Hema Chand Nalluri | Method and apparatus for supporting programmable software context state execution during hardware context restore flow |
US20160055609A1 (en) * | 2014-08-25 | 2016-02-25 | Advanced Micro Devices, Inc. | Graphics processing method, system, and apparatus |
US20180285109A1 (en) * | 2017-04-01 | 2018-10-04 | Intel Corporation | Transitionary pre-emption for virtual reality related contexts |
Family Cites Families (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050195186A1 (en) * | 2004-03-02 | 2005-09-08 | Ati Technologies Inc. | Method and apparatus for object based visibility culling |
JP5631535B2 (en) * | 2005-02-08 | 2014-11-26 | オブロング・インダストリーズ・インコーポレーテッド | System and method for a gesture-based control system |
US7545381B2 (en) * | 2005-11-10 | 2009-06-09 | Via Technologies, Inc. | Interruptible GPU and method for context saving and restoring |
US7634637B1 (en) * | 2005-12-16 | 2009-12-15 | Nvidia Corporation | Execution of parallel groups of threads with per-instruction serialization |
US8593465B2 (en) * | 2007-06-13 | 2013-11-26 | Advanced Micro Devices, Inc. | Handling of extra contexts for shader constants |
US8736624B1 (en) * | 2007-08-15 | 2014-05-27 | Nvidia Corporation | Conditional execution flag in graphics applications |
US8139070B1 (en) * | 2007-10-03 | 2012-03-20 | Matrox Graphics, Inc. | Systems for and methods of context switching in a graphics processing system |
US9003389B2 (en) * | 2010-05-25 | 2015-04-07 | Red Hat, Inc. | Generating an encoded package profile based on executing host processes |
US9086813B2 (en) * | 2013-03-15 | 2015-07-21 | Qualcomm Incorporated | Method and apparatus to save and restore system memory management unit (MMU) contexts |
US10437637B1 (en) * | 2015-05-26 | 2019-10-08 | Thin CI, Inc. | Configurable scheduler for graph processing on multi-processor computing systems |
US11416282B2 (en) * | 2015-05-26 | 2022-08-16 | Blaize, Inc. | Configurable scheduler in a graph streaming processing system |
US10397362B1 (en) * | 2015-06-24 | 2019-08-27 | Amazon Technologies, Inc. | Combined cache-overflow memory structure |
GB2543866B (en) * | 2016-03-07 | 2017-11-01 | Imagination Tech Ltd | Task assembly for SIMD processing |
US20180191632A1 (en) * | 2016-12-30 | 2018-07-05 | Intel Corporation | Flexible packet scheduling |
US20190207868A1 (en) * | 2019-02-15 | 2019-07-04 | Intel Corporation | Processor related communications |
US10841225B2 (en) * | 2019-03-06 | 2020-11-17 | Arista Networks, Inc. | Load balancing using dynamically resizable consistent hashing |
-
2019
- 2019-05-30 US US16/426,613 patent/US11169811B2/en active Active
-
2020
- 2020-05-29 JP JP2021571386A patent/JP7402897B2/en active Active
- 2020-05-29 CN CN202080043155.7A patent/CN113939843A/en active Pending
- 2020-05-29 KR KR1020217042931A patent/KR102682383B1/en active IP Right Grant
- 2020-05-29 EP EP20813774.5A patent/EP3977270A4/en active Pending
- 2020-05-29 WO PCT/US2020/035203 patent/WO2020243482A1/en unknown
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100131549A1 (en) * | 2006-02-08 | 2010-05-27 | Oblong Industries, Inc. | Multi-process interactive systems and methods |
US7979683B1 (en) * | 2007-04-05 | 2011-07-12 | Nvidia Corporation | Multiple simultaneous context architecture |
US20150123980A1 (en) * | 2013-11-05 | 2015-05-07 | Hema Chand Nalluri | Method and apparatus for supporting programmable software context state execution during hardware context restore flow |
US20160055609A1 (en) * | 2014-08-25 | 2016-02-25 | Advanced Micro Devices, Inc. | Graphics processing method, system, and apparatus |
US20180285109A1 (en) * | 2017-04-01 | 2018-10-04 | Intel Corporation | Transitionary pre-emption for virtual reality related contexts |
Non-Patent Citations (1)
Title |
---|
See also references of EP3977270A4 * |
Also Published As
Publication number | Publication date |
---|---|
JP2022534438A (en) | 2022-07-29 |
EP3977270A1 (en) | 2022-04-06 |
US20200379767A1 (en) | 2020-12-03 |
EP3977270A4 (en) | 2023-06-28 |
JP7402897B2 (en) | 2023-12-21 |
CN113939843A (en) | 2022-01-14 |
KR20220003141A (en) | 2022-01-07 |
US11169811B2 (en) | 2021-11-09 |
KR102682383B1 (en) | 2024-07-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10026145B2 (en) | Resource sharing on shader processor of GPU | |
US8350864B2 (en) | Serializing command streams for graphics processors | |
US7634637B1 (en) | Execution of parallel groups of threads with per-instruction serialization | |
US8525841B2 (en) | Batching graphics operations with time stamp tracking | |
US20190026157A1 (en) | Accelerator control apparatus, accelerator control method, and program | |
US7366842B1 (en) | Creating permanent storage on the fly within existing buffers | |
US8085280B2 (en) | Asymmetric two-pass graphics scaling | |
JP7253507B2 (en) | Early virtualization context switch for virtualization-accelerated processing devices | |
CN110322390B (en) | Method and system for controlling a process | |
US8531470B2 (en) | Deferred deletion and cleanup for graphics resources | |
KR102682383B1 (en) | Graphics context bouncing | |
CN113870408A (en) | Method for rendering one or more fragments and graphics processing system | |
JP7245179B2 (en) | Firmware changes for virtualized devices | |
KR101574275B1 (en) | Efficient state management for a graphics pipeline | |
US8593465B2 (en) | Handling of extra contexts for shader constants | |
KR20200074707A (en) | System and method for processing task in graphics processor unit | |
CN108536644B (en) | Device for pushing core into queue from device end | |
US20240169639A1 (en) | Graphics processors | |
US20240169663A1 (en) | Graphics Processors | |
US20240169619A1 (en) | Graphics processors | |
US20240169647A1 (en) | Graphics processors | |
US20240169618A1 (en) | Graphics processors | |
US20240169645A1 (en) | Graphics processors | |
US20240169649A1 (en) | Graphics processors | |
US20240169648A1 (en) | Graphics processors |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20813774 Country of ref document: EP Kind code of ref document: A1 |
|
ENP | Entry into the national phase |
Ref document number: 2021571386 Country of ref document: JP Kind code of ref document: A |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
ENP | Entry into the national phase |
Ref document number: 20217042931 Country of ref document: KR Kind code of ref document: A |
|
ENP | Entry into the national phase |
Ref document number: 2020813774 Country of ref document: EP Effective date: 20220103 |