Device and method for efficient graphics virtualization
Through the intermediary delivery architecture and virtualization stub module, the virtualization mediator realizes direct access of virtual machines to full-featured GPUs, solves the problem of GPU sharing performance and isolation between multiple virtual machines, and improves virtualization efficiency.
Patent Information
- Application Number
- CN201810310226.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2017-04-07
- Filing Date
- 2018-04-09
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2038-04-09
AI Technical Summary
When existing GPU virtualization technology shares physical GPUs between multiple virtual machines, it is difficult to achieve high performance and complete security isolation, and virtualization complexity and performance bottlenecks exist.
Adopting an intermediary delivery architecture, through virtualization stub modules and virtualization mediators, each virtual machine has direct access to the full-featured GPU, and manages resource partitions through the GPU scheduler and IOMMU to avoid hypervisor intervention and achieve safe isolation and high performance. performance.
It achieves good performance sharing and security isolation between multiple virtual machines, reduces hypervisor intervention, and improves the efficiency and scalability of GPU virtualization.
Smart Images

Figure CN108694072B_ABST
Abstract
Description
Technical Field
[0001] The present invention generally relates to the field of computer processors. More specifically, the present invention relates to an apparatus and method for efficient graphics virtualization.
[0002] Description of related technologies
[0003] Recently, rapid progress has been made in the virtualization of graphics processor units (GPUs). Virtualized graphics processing environments are used, for example, in media clouds, remote workstations / desktops, interchangeable virtual instruments (IVI), rich client virtualization, and more. Some architectures perform full GPU virtualization through capture and emulation to emulate a full-featured virtual GPU (vGPU) while providing near-native performance by passing performance-critical graphics memory resources.
[0004] As GPUs become increasingly important in servers to support 3D, media, and GPGPU workloads, GPU virtualization is becoming more common. How to virtualize GPU memory access from a virtual machine (VM) is one of the key design factors. The GPU has its own graphics memory: dedicated video memory or shared system memory. When system memory is used for graphics, the guest physical address (GPA) needs to be translated to the host physical address (HPA) before being accessed by the hardware.
[0005] There are many ways to perform conversion for the GPU. Some implementations perform conversion through hardware support, but the GPU can only be delivered to one VM. Another solution is a software method to build a shadow structure for the conversion. For example, the shadow page table is implemented using certain architectures, such as in the complete GPU virtualization solution mentioned above, which can support multiple VMs sharing a physical GPU.
[0006] In some embodiments, the guest / VM memory pages are backed by host memory pages. A virtual machine monitor (VMM) (sometimes referred to as a "hypervisor") maps from guest physical addresses (PA) to host PAs using, for example, an extended page table (EPT). A variety of memory sharing techniques may be used, such as kernel same-page merging (KSM) techniques.
[0007] KSM merges pages from multiple VMs with the same content into a single page with write protection. That is, if a memory page in VM1 (mapped from client PA1 to host PA1) has the same content as another memory page in VM2 (mapped from client PA2 to host PA2), only one host page (such as HPA_SH) can be used to support the client memory. That is, VM1's client PA1 and VM2's PA2 are both mapped to HPA_SH with write protection. This saves memory for the system and is particularly useful for read-only memory pages of the client (such as code pages and zero pages). With KSM, once the VM modifies the page content, the copy-on-write (COW) technique can be used to remove the sharing.
[0008] Brokered delivery is used for device performance and sharing in virtualized systems, where a single physical GPU is presented as multiple virtual GPUs to multiple clients with direct DMA, while privileged resource access from the clients is still trapped and emulated. In some embodiments, each client can run a native GPU driver and device DMA directly into memory without hypervisor intervention. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] A better understanding of the present invention may be obtained from the following detailed description in conjunction with the following drawings, in which:
[0010] Figure 1 is a block diagram of an embodiment of a computer system having a processor with one or more processor cores and a graphics processor;
[0011] Figure 2 is a block diagram of one embodiment of a processor having one or more processor cores, an integrated memory controller, and an integrated graphics processor;
[0012] Figure 3 is a block diagram of one embodiment of a graphics processor, which may be a discrete graphics processing unit, or may be a graphics processor integrated with multiple processing cores;
[0013] Figure 4 is a block diagram of an embodiment of a graphics processing engine for a graphics processor;
[0014] Figure 5 is a block diagram of another embodiment of a graphics processor;
[0015] Figure 6 is a block diagram of thread execution logic including an array of process elements;
[0016] Figure 7illustrates a graphics processor execution unit instruction format according to an embodiment;
[0017] Figure 8 is a block diagram of another embodiment of a graphics processor including a graphics pipeline, a media pipeline, a display engine, thread execution logic, and a rendering output pipeline.
[0018] Fig. 9A is a block diagram illustrating a graphics processor command format according to an embodiment;
[0019] Fig. 9B is a block diagram illustrating a graphics processor command sequence according to an embodiment;
[0020] Fig.10 illustrates an exemplary graphics software architecture for a data processing system according to an embodiment;
[0021] Fig.11 An exemplary IP core development system that may be used to manufacture an integrated circuit to perform operations according to an embodiment is illustrated;
[0022] Fig.12 illustrates an exemplary system-on-chip integrated circuit that may be manufactured using one or more IP cores in accordance with an embodiment;
[0023] Fig.13 An exemplary graphics processor of a system-on-chip integrated circuit that may be manufactured using one or more IP cores is illustrated;
[0024] Fig.14 Additional exemplary graphics processors of system-on-chip integrated circuits that may be fabricated using one or more IP cores are illustrated;
[0025] Fig.15 An exemplary graphics processing system is illustrated;
[0026] Fig.16 An exemplary architecture for full graphics virtualization is illustrated;
[0027] Fig.17 An exemplary virtualized graphics processing architecture including a virtual graphics processing unit (vGPU) is illustrated;
[0028] Fig.18 One embodiment of a virtualization architecture with an IOMMU is illustrated;
[0029] Fig.19 An embodiment is illustrated in which graphics processing is performed on a server;
[0030] Fig. 20 One embodiment for intelligently allocating tile cache between virtual machines or applications is illustrated;
[0031] Fig.21 A method according to an embodiment of the present invention is illustrated;
[0032] Fig. 22 illustrates an embodiment in which buffering and arbitration are utilized to reduce the blocking of one VM by another VM;
[0033] Fig.23 illustrates a series of upstream and downstream queues utilized in one embodiment;
[0034] Fig.24 illustrates an embodiment in which shared local memory is allocated between VMs using overflow into system memory;
[0035] Fig.25 A method according to an embodiment of the present invention is illustrated;
[0036] Fig.26 One embodiment of an architecture for provisioning a memory structure is illustrated;
[0037] Fig. 27 A method according to an embodiment of the present invention is illustrated;
[0038] Fig.28 is a block diagram illustrating a computer system configured to implement one or more aspects of the embodiments described herein.
[0039] FIG. 29A to FIG. 29D illustrates a parallel processor component according to an embodiment;
[0040] FIG. 30A to FIG. 30B is a block diagram of a graphics multiprocessor according to an embodiment;
[0041] FIG. 31A to FIG. 31F illustrates an exemplary architecture in which multiple GPUs are communicatively coupled to multiple multi-core processors; and
[0042] Fig.32 A graphics processing pipeline according to an embodiment is illustrated. DETAILED DESCRIPTION
[0043] In the following description, for the purpose of explanation, many specific details are set forth in order to provide a thorough understanding of the embodiments of the invention described below. However, it will be apparent to those skilled in the art that embodiments of the invention may be practiced without some of these specific details. In other examples, well-known structures and devices are shown in the form of block diagrams to avoid obscuring the basic principles of embodiments of the invention.
[0044] Exemplary Graphics Processor Architectures and Data Types
[0045] System Overview
[0046] Figure 1 1 is a block diagram of a processing system 100 according to an embodiment. In various embodiments, the system 100 includes one or more processors 102 and one or more graphics processors 108, and may be a single-processor desktop system, a multi-processor workstation system, or a server system having a large number of processors 102 or processor cores 107. In one embodiment, the system 100 is a processing platform incorporated within a system-on-chip (SoC) integrated circuit for a mobile, handheld, or embedded device.
[0047] Embodiments of the system 100 may include or incorporate a server-based gaming platform, a gaming console, including a gaming and media console, a mobile gaming console, a handheld gaming console, or an online gaming console. In some embodiments, the system 100 is a mobile phone, a smart phone, a tablet computing device, or a mobile Internet device. The data processing system 100 may also include a wearable device (such as a smart watch wearable device, a smart glasses device, an augmented reality device, or a virtual reality device), coupled to the wearable device, or integrated into the wearable device. In some embodiments, the data processing system 100 is a television or set-top box device having one or more processors 102 and a graphical interface generated by one or more graphics processors 108.
[0048] In some embodiments, the one or more processors 102 each include one or more processor cores 107 for processing instructions, which when executed perform operations for system and user software. In some embodiments, each of the one or more processor cores 107 is configured to process a specific instruction set 109. In some embodiments, the instruction set 109 can facilitate complex instruction set computing (CISC), reduced instruction set computing (RISC), or computing via very long instruction words (VLIW). Multiple processor cores 107 can each process different instruction sets 109, which may include instructions for facilitating emulation of other instruction sets. The processor core 107 may also include other processing devices, such as a digital signal processor (DSP).
[0049] In some embodiments, the processor 102 includes a cache memory 104. Depending on the architecture, the processor 102 may have a single internal cache or multiple levels of internal cache. In some embodiments, the cache memory is shared among the components of the processor 102. In some embodiments, the processor 102 also uses an external cache (e.g., a level 3 (L3) cache or a last level cache (LLC)) (not shown), which may be shared among the processor cores 107 using known cache coherence techniques. Additionally, a register file 106 is included in the processor 102, which may include different types of registers (e.g., integer registers, floating point registers, status registers, and instruction pointer registers) for storing different types of data. Some registers may be general purpose registers, while other registers may be specific to the design of the processor 102.
[0050] In some embodiments, the processor 102 is coupled to a processor bus 110, which is used to transmit communication signals, such as address, data, or control signals, between the processor 102 and other components within the system 100. In one embodiment, the system 100 uses an exemplary 'hub' system architecture, including a memory controller hub 116 and an input-output (I / O) controller hub 130. The memory controller hub 116 facilitates communication between memory devices and other components of the system 100, while the I / O controller hub (ICH) 130 provides connections to I / O devices via a local I / O bus. In one embodiment, the logic of the memory controller hub 116 is integrated within the processor.
[0051] The memory device 120 may be a dynamic random access memory (DRAM) device, a static random access memory (SRAM) device, a flash memory device, a phase change memory device, or some other memory device having suitable properties for use as processing memory. In one embodiment, the memory device 120 may operate as system memory for the system 100 to store data 122 and instructions 121 for use when one or more processors 102 execute applications or processes. The memory controller hub 116 is also coupled to an optional external graphics processor 112, which may communicate with one or more graphics processors 108 in the processors 102 to perform graphics and media operations.
[0052] In some embodiments, the ICH 130 enables peripheral components to be connected to the memory device 120 and the processor 102 via a high-speed I / O bus. The I / O peripheral components include, but are not limited to, an audio controller 146, a firmware interface 128, a wireless transceiver 126 (e.g., Wi-Fi, Bluetooth), a data storage device 124 (e.g., a hard drive, flash memory, etc.), and a traditional I / O controller 140 for coupling traditional (e.g., Personal System 2 (PS / 2)) devices to the system. One or more Universal Serial Bus (USB) controllers 142 connect multiple input devices, such as a keyboard and mouse 144 combination. A network controller 134 may also be coupled to the ICH 130. In some embodiments, a high-performance network controller (not shown) is coupled to the processor bus 110. It should be understood that the system 100 shown is exemplary and not limiting, as other types of data processing systems configured in different ways may also be used. For example, I / O controller hub 130 may be integrated within one or more processors 102 , or memory controller hub 116 and I / O controller hub 130 may be integrated within a discrete external graphics processor, such as external graphics processor 112 .
[0053] Figure 2 is a block diagram of an embodiment of a processor 200 having one or more processor cores 202A- 202N, an integrated memory controller 214 , and an integrated graphics processor 208 . Figure 2 Those elements having the same reference numbers (or names) as those in any other figure herein may operate or function in any manner similar to, but not limited to, those described elsewhere herein. Processor 200 may include additional cores up to and including additional core 202N represented by a dashed box. Processor cores 202A to 202N each include one or more internal cache units 204A to 204N. In some embodiments, each processor core may also access one or more shared cache units 206.
[0054] Internal cache units 204A to 204N and shared cache unit 206 represent a cache memory hierarchy within processor 200. The cache memory hierarchy may include at least one level of instruction and data cache within each processor core and one or more levels of shared mid-level cache, such as level 2 (L2), level 3 (L3), level 4 (L4), or other levels of cache, where the highest level of cache is classified as LLC before external memory. In some embodiments, cache coherency logic maintains coherency between each cache unit 206 and 204A to 204N.
[0055] In some embodiments, the processor 200 may further include a set of one or more bus controller units 216 and a system agent core 210. The one or more bus controller units 216 manage a set of peripheral buses, such as one or more peripheral component interconnect buses (e.g., PCI, PCI Express). The system agent core 210 provides management functions for each processor component. In some embodiments, the system agent core 210 includes one or more integrated memory controllers 214 for managing access to each external memory device (not shown).
[0056] In some embodiments, one or more of the processor cores 202A to 202N include support for simultaneous multithreading. In such embodiments, the system agent core 210 includes components for coordinating and operating the cores 202A to 202N during multithreaded processing. In addition, the system agent core 210 may also include a power control unit (PCU) including logic and components for regulating the power state of the processor cores 202A to 202N and the graphics processor 208.
[0057] In some embodiments, the processor 200 additionally includes a graphics processor 208 for performing graphics processing operations. In some embodiments, the graphics processor 208 is coupled to a set of shared cache units 206 and a system agent core 210, which includes one or more integrated memory controllers 214. In some embodiments, a display controller 211 is coupled to the graphics processor 208 to drive the graphics processor output to one or more coupled displays. In some embodiments, the display controller 211 can be a separate module coupled to the graphics processor via at least one interconnect, or can be integrated within the graphics processor 208 or the system agent core 210.
[0058] In some embodiments, a ring-based interconnect unit 212 is used to couple the internal components of the processor 200. However, alternative interconnect units may be used, such as point-to-point interconnects, switched interconnects, or other technologies, including those well known in the art. In some embodiments, the graphics processor 208 is coupled to the ring interconnect 212 via an I / O link 213.
[0059] Exemplary I / O link 213 represents at least one of a plurality of types of I / O interconnects, including packaged I / O interconnects that facilitate communication between various processor components and high-performance embedded memory modules 218, such as eDRAM modules. In some embodiments, each of processor cores 202A-202N and graphics processor 208 use embedded memory modules 218 as a shared last-level cache.
[0060] In some embodiments, the processor cores 202A to 202N are homogeneous cores that execute the same instruction set architecture. In another embodiment, the processor cores 202A to 202N are heterogeneous in terms of instruction set architecture (ISA), wherein one or more of the processor cores 202A to 202N execute a first instruction set, while at least one of the other cores executes a subset of the first instruction set or a different instruction set. In one embodiment, the processor cores 202A to 202N are homogeneous in terms of microarchitecture, wherein one or more cores with relatively high power consumption are coupled with one or more power cores with lower power consumption. In addition, the processor 200 can be implemented on one or more chips or as a SoC integrated circuit having the illustrated components in addition to other components.
[0061] Figure 3 3 is a block diagram of a graphics processor 300, which may be a discrete graphics processing unit, or may be a graphics processor integrated with multiple processing cores. In some embodiments, the graphics processor communicates via a memory-mapped I / O interface to registers on the graphics processor and using commands placed in processor memory. In some embodiments, the graphics processor 300 includes a memory interface 314 for accessing memory. The memory interface 314 may be an interface to local memory, one or more internal caches, one or more shared external caches, and / or to system memory.
[0062] In some embodiments, the graphics processor 300 also includes a display controller 302 for driving display output data to a display device 320. The display controller 302 includes hardware for one or more overlapping planes of the display and a composition of multiple layers of video or user interface elements. In some embodiments, the graphics processor 300 includes a video codec engine 306 for encoding, decoding, or transcoding media to, from, or between one or more media encoding formats, including but not limited to: Moving Picture Experts Group (MPEG) (such as MPEG-2), Advanced Video Coding (AVC) formats (such as H.264 / MPEG-4 AVC), and Society of Motion Picture and Television Engineers (SMPTE) 421 M / VC-1, and Joint Photographic Experts Group (JPEG) formats (such as JPEG, and Motion JPEG (MJPEG) formats).
[0063] In some embodiments, graphics processor 300 includes a block image transfer (BLIT) engine 304 to perform two-dimensional (2D) rasterizer operations, including, for example, bit boundary block transfers. However, in one embodiment, 2D graphics operations are performed using one or more components of a graphics processing engine (GPE) 310. In some embodiments, GPE 310 is a compute engine for performing graphics operations, including three-dimensional (3D) graphics operations and media operations.
[0064] In some embodiments, GPE 310 includes a 3D pipeline 312 for performing 3D operations, such as rendering three-dimensional images and scenes using processing functions that act on 3D primitive shapes (e.g., rectangles, triangles, etc.). 3D pipeline 312 includes programmable and fixed functional elements that perform various tasks within the elements and / or generated execution threads to 3D / media subsystem 315. Although 3D pipeline 312 can be used to perform media operations, embodiments of GPE 310 also include a media pipeline 316 that is specifically used to perform media operations, such as video post-processing and image enhancement.
[0065] In some embodiments, the media pipeline 316 includes fixed-function or programmable logic units to perform one or more specialized media operations, such as video decoding acceleration, video deinterlacing, and video encoding acceleration, instead of, or on behalf of the video codec engine 306. In some embodiments, in addition, the media pipeline 316 also includes a thread generation unit to generate threads for execution on the 3D / media subsystem 315. The generated threads perform calculations for media operations on one or more graphics execution units included in the 3D / media subsystem 315.
[0066] In some embodiments, the 3D / media subsystem 315 includes logic for executing threads generated by the 3D pipeline 312 and the media pipeline 316. In one embodiment, the pipeline sends thread execution requests to the 3D / media subsystem 315, which includes thread dispatch logic for arbitrating and dispatching each request to available thread execution resources. The execution resources include an array of graphics execution units for processing 3D and media threads. In some embodiments, the 3D / media subsystem 315 includes one or more internal caches for thread instructions and data. In some embodiments, the subsystem also includes shared memory (including registers and addressable memory) to share data between threads and for storing output data.
[0067] Graphics processing engine
[0068] Figure 4is a block diagram of a graphics processing engine 410 of a graphics processor according to some embodiments. In one embodiment, the graphics processing engine (GPE) 410 is Figure 3 One version of the GPE 310 is shown. Figure 4 Those elements having the same reference number (or name) as elements in any other figure herein may operate or function in any manner similar to that described elsewhere herein, but are not limited to such. Figure 3 410. The 3D pipeline 312 and the media pipeline 316 of the GPE 410. The media pipeline 316 is optional in some embodiments of the GPE 410 and may not be explicitly included in the GPE 410. For example and in at least one embodiment, separate media and / or image processors are coupled to the GPE 410.
[0069] In some embodiments, the GPE 410 is coupled to or includes a command streamer 403 that provides a command stream to the 3D pipeline 312 and / or the media pipeline 316. In some embodiments, the command streamer 403 is coupled to a memory, which may be a system memory, or one or more cache memories of an internal cache memory and a shared cache memory. In some embodiments, the command streamer 403 receives commands from the memory and sends these commands to the 3D pipeline 312 and / or the media pipeline 316. The commands are instructions obtained from a ring buffer storing commands for the 3D pipeline 312 and the media pipeline 316. In one embodiment, in addition, the ring buffer may also include a batch command buffer storing multiple batches of multiple commands. The commands for the 3D pipeline 312 may also include references to data stored in the memory, such as, but not limited to, vertex and geometry data for the 3D pipeline 312 and / or image data and memory objects for the media pipeline 316. The 3D pipeline 312 and the media pipeline 316 process the commands and data by performing operations via logic within the respective pipelines or by dispatching one or more execution threads to the graphics core array 414 .
[0070] In various embodiments, the 3D pipeline 312 can execute one or more shader programs, such as vertex shaders, geometry shaders, pixel shaders, fragment shaders, compute shaders, or other shader programs, by processing instructions and dispatching execution threads to the graphics core array 414. The graphics core array 414 provides a unified execution resource block. The multi-purpose execution logic (e.g., execution unit) within the graphics core array 414 includes support for various 3D API shader languages and can execute multiple simultaneous execution threads associated with multiple shaders.
[0071] In some embodiments, graphics core array 414 also includes execution logic for performing media functions such as video and / or image processing. In one embodiment, in addition to graphics processing operations, the execution unit also includes general logic that can be programmed to perform parallel general computing operations. The general logic can be connected to Figure 1 (one or more) processor cores 107 or Figure 2 The general logic within cores 202A to 202N in the FPGA performs processing operations in parallel or in combination.
[0072] Output data generated by threads executing on the graphics core array 414 can output data to memory in a unified return buffer (URB) 418. URB 418 can store data for multiple threads. In some embodiments, URB 418 can be used to send data between different threads executing on the graphics core array 414. In some embodiments, URB 418 can also be used for synchronization between threads on the graphics core array and fixed function logic within shared function logic 420.
[0073] In some embodiments, graphics core array 414 is scalable such that the array includes a variable number of graphics cores each having a variable number of execution units based on the target power and performance level of GPE 410. In one embodiment, execution resources are dynamically scalable such that execution resources can be enabled or disabled as needed.
[0074] The graphics core array 414 is coupled to a shared function logic 420, which includes a plurality of resources shared between the graphics cores in the graphics core array. The shared functions within the shared function logic 420 are hardware logic units that provide dedicated supplementary functions to the graphics core array 414. In various embodiments, the shared function logic 420 includes, but is not limited to, a sampler 421, a math 422, and an inter-thread communication (ITC) 423 logic. In addition, some embodiments implement one or more caches 425 within the shared function logic 420. The shared functions are implemented in the case where the demand for a given dedicated function is not sufficient to be included in the graphics core array 414. Instead, a single instance of the dedicated function is implemented as an independent entity in the shared function logic 420 and shared between the execution resources within the graphics core array 414. The exact set of functions shared between the graphics core array 414 and included within the graphics core array 414 varies between embodiments.
[0075] Figure 5 is a block diagram of another embodiment of a graphics processor 500 . Figure 5 Those elements having the same reference numbers (or names) as elements in any other figure herein may operate or function in any manner similar to that described elsewhere herein, but are not limited to these.
[0076] In some embodiments, graphics processor 500 includes ring interconnect 502, pipeline front end 504, media engine 537, and graphics cores 580A to 580N. In some embodiments, ring interconnect 502 couples the graphics processor to other processing units, including other graphics processors or one or more general-purpose processor cores. In some embodiments, the graphics processor is one of multiple processors integrated into a multi-core processing system.
[0077] In some embodiments, the graphics processor 500 receives batches of commands via the ring interconnect 502. The incoming commands are interpreted by the command streamer 503 in the pipeline front end 504. In some embodiments, the graphics processor 500 includes scalable execution logic for performing 3D geometry processing and media processing via (one or more) graphics cores 580A to 580N. For 3D geometry processing commands, the command streamer 503 supplies the commands to the geometry pipeline 536. For at least some media processing commands, the command streamer 503 supplies the commands to the video front end 534, which is coupled to the media engine 537. In some embodiments, the media engine 537 includes a video quality engine (VQE) 530 for video and image post-processing and a multi-format encoding / decoding (MFX) 533 engine for providing hardware accelerated media data encoding and decoding. In some embodiments, the geometry pipeline 536 and the media engine 537 each generate an execution thread, which is used for thread execution resources provided by at least one graphics core 580A.
[0078] In some embodiments, the graphics processor 500 includes scalable thread execution resource characterization module cores 580A to 580N (sometimes referred to as core slicing), and each scalable thread execution resource characterization module core has multiple sub-cores 550A to 550N, 560A to 560N (sometimes referred to as core sub-slicing). In some embodiments, the graphics processor 500 can have any number of graphics cores 580A to 580N. In some embodiments, the graphics processor 500 includes a graphics core 580A, which has at least a first sub-core 550A and a second sub-core 560A. In other embodiments, the graphics processor is a low-power processor with a single sub-core (e.g., 550A). In some embodiments, the graphics processor 500 includes multiple graphics cores 580A to 580N, each of which includes a group of first sub-cores 550A to 550N and a group of second sub-cores 560A to 560N. Each of the group of first sub-cores 550A to 550N includes at least a first group of execution units 552A to 552N and media / texture samplers 554A to 554N. Each of the group of second sub-cores 560A to 560N includes at least a second group of execution units 562A to 562N and samplers 564A to 564N. In some embodiments, each sub-core 550A to 550N, 560A to 560N shares a group of shared resources 570A to 570N. In some embodiments, the shared resources include shared cache memory and pixel operation logic. Other shared resources may also be included in various embodiments of the graphics processor.
[0079] Execution Unit
[0080] Figure 6 Illustrated is thread execution logic 600 that includes an array of processing elements employed in some embodiments of a GPE. Figure 6 Those elements having the same reference numbers (or names) as elements in any other figure herein may operate or function in any manner similar to that described elsewhere herein, but are not limited to these.
[0081] In some embodiments, thread execution logic 600 includes a shader processor 602, a thread dispatcher 604, an instruction cache 606, a scalable execution unit array including a plurality of execution units 608A to 608N, a sampler 610, a data cache 612, and a data port 614. In one embodiment, the scalable execution unit array can be dynamically scaled by enabling or disabling one or more execution units (e.g., any one of execution units 608A, 608B, 608C, 608D, up to 608N-1 and 608N) based on the computational requirements of the workload. In one embodiment, the included components are interconnected via an interconnect structure that links to each of the components. In some embodiments, thread execution logic 600 includes one or more connections to a memory (such as a system memory or a cache memory) through the instruction cache 606, the data port 614, the sampler 610, and one or more of the execution unit arrays 608A to 608N. In some embodiments, each execution unit (e.g., 608A) is an independently programmable general-purpose computing unit capable of executing multiple simultaneous hardware threads while processing multiple data elements in parallel for each thread. In various embodiments, the array of execution units 608A to 608N is scalable to include any number of separate execution units.
[0082] In some embodiments, execution units 608A to 608N are primarily used to execute shader programs. Shader processor 602 can process various shader programs and dispatch execution threads associated with the shader programs via thread dispatcher 604. In one embodiment, thread dispatcher includes logic for arbitrating thread initiation requests from graphics and media pipelines and instantiating the requested threads on one or more execution units 608A to 608N. For example, the geometry pipeline (e.g., Figure 5 536) can dispatch vertex processing, tessellation or geometry shaders to thread execution logic 600 ( Figure 6 In some embodiments, thread dispatcher 604 may also process runtime thread generation requests from executing shader programs.
[0083] In some embodiments, execution units 608A to 608N support instruction sets (the instruction sets include native support for many standard 3D graphics shader instructions), so that shader programs from graphics libraries (e.g., Direct 3D and OpenGL) are executed with minimal conversion. These execution units support vertex and geometry processing (e.g., vertex programs, geometry programs, vertex shaders), pixel processing (e.g., pixel shaders, fragment shaders), and general processing (e.g., compute and media shaders). Each of execution units 608A to 608N is capable of multi-issue single instruction multiple data (SIMD) execution, and multi-threaded operations can achieve an efficient execution environment in the face of high latency memory access. Each hardware thread within each execution unit has a dedicated high-bandwidth register file and associated independent thread state. For pipelines capable of integer, single-precision floating-point operations and double-precision floating-point operations, SIMD branch functions, logical operations, transcendental operations, and other miscellaneous operations, execution is multi-issue per clock. While waiting for data from memory or one of the shared functions, dependency logic within execution units 608A to 608N causes the waiting thread to sleep until the requested data has returned. While the waiting thread is sleeping, hardware resources may be dedicated to processing other threads. For example, during a delay associated with a vertex shader operation, an execution unit may execute operations of a pixel shader, a fragment shader, or another type of shader program including a different vertex shader.
[0084] Each of the execution units 608A-608N operates on an array of data elements. The number of data elements is the "execution size," or number of channels of an instruction. An execution channel is a logical unit that performs data element access, masking, and flow control within an instruction. The number of channels may be independent of the number of physical arithmetic logic units (ALUs) or floating point units (FPUs) for a particular graphics processor. In some embodiments, the execution units 608A-608N support integer and floating point data types.
[0085] The execution unit instruction set includes SIMD instructions. Various data elements can be stored in registers as compressed data types, and the execution unit will process various elements based on the data size of the element. For example, when operating on a 256-bit wide vector, the 256-bit vector is stored in a register, and the execution unit operates on the vector as four separate 64-bit compressed data elements (data elements of quadruple word length (QW) size), eight separate 32-bit compressed data elements (data elements of double word length (DW) size), sixteen separate 16-bit compressed data elements (data elements of word length (W) size), or thirty-two separate 8-bit data elements (data elements of byte (B) size). However, different vector widths and register sizes are possible.
[0086] One or more internal instruction caches (e.g., 606) are included in the thread execution logic 600 to cache thread instructions for the execution unit. In some embodiments, one or more data caches (e.g., 612) are included to cache thread data during thread execution. In some embodiments, a sampler 610 is included to provide texture sampling for 3D operations and media sampling for media operations. In some embodiments, the sampler 610 includes a dedicated texture or media sampling function to process texture or media data during the sampling process before providing the sampled data to the execution unit.
[0087] During execution, the graphics and media pipeline sends a thread initiation request to the thread execution logic 600 via the thread generation and dispatch logic. Once a set of geometric objects has been processed and rasterized into pixel data, the pixel processor logic (e.g., pixel shader logic, fragment shader logic, etc.) within the shader processor 602 is called to further calculate output information and cause the result to be written to the output surface (e.g., color buffer, depth buffer, stencil printing buffer, etc.). In some embodiments, the pixel shader or fragment shader calculates the value of each vertex attribute, which is interpolated across the rasterized object. In some embodiments, the pixel processor logic within the shader processor 602 then executes the pixel or fragment shader program supplied by the application programming interface (API). To execute the shader program, the shader processor 602 dispatches the thread to the execution unit (e.g., 608A) via the thread dispatcher 604. In some embodiments, the pixel shader 602 uses the texture sampling logic in the sampler 610 to access the texture data in the texture map stored in the memory. Arithmetic operations on texture data and input geometry data compute pixel color data for each geometry fragment, or discard one or more pixels without further processing.
[0088] In some embodiments, data port 614 provides a memory access mechanism for thread execution logic 600 to output processed data to memory for processing on the graphics processor output pipeline. In some embodiments, data port 614 includes or is coupled to one or more cache memories (e.g., data cache 612) to cache data via the data port for memory access.
[0089] Figure 7700 is a block diagram illustrating a graphics processor instruction format 700 according to some embodiments. In one or more embodiments, a graphics processor execution unit supports an instruction set having instructions in multiple formats. Solid line boxes illustrate components that are typically included in execution unit instructions, while dashed lines include optional components or components that are only included in a subset of instructions. In some embodiments, the instruction format 700 described and illustrated is a macroinstruction, because the macroinstruction is the instruction supplied to the execution unit, as opposed to the micro-operations generated from instruction decoding (once the instruction is processed).
[0090] In some embodiments, the graphics processor execution unit natively supports instructions in the 128-bit instruction format 710. A 64-bit compressed instruction format 730 may be used for some instructions based on the selected instruction, instruction options, and number of operands. The native 128-bit instruction format 710 provides access to all instruction options, while some options and operations are restricted to the 64-bit instruction format 730. The native instructions available in the 64-bit instruction format 730 vary depending on the embodiment. In some embodiments, the instructions are partially compressed using a set of index values in the index field 713. The execution unit hardware references a set of compression tables based on the index values and uses the compression table output to reconstruct the native instructions in the 128-bit instruction format 710.
[0091] For each format, the instruction opcode 712 defines the operation to be performed by the execution unit. The execution unit executes each instruction in parallel across multiple data elements of each operand. For example, in response to an add instruction, the execution unit performs a synchronous add operation across each color channel, the color channel representing a texture element or a picture element. By default, the execution unit executes each instruction across all data channels of the operand. In some embodiments, the instruction control field 714 enables control of certain execution options, such as channel selection (e.g., prediction) and data channel sorting (e.g., mixing). For instructions using the 128-bit instruction format 710, the execution size field 716 limits the number of data channels that will be executed in parallel. In some embodiments, the execution size field 716 is not available for the 64-bit compressed instruction format 730.
[0092] Some execution unit instructions have up to three operands, including two source operands (src0 720, src1 722) and one destination operand 718. In some embodiments, the execution unit supports dual destination instructions, where one of the destinations is implicit. Data manipulation instructions may have a third source operand (e.g., SRC2 724), where the instruction opcode 712 determines the number of source operands. The last source operand of an instruction may be an immediate (e.g., hard-coded) value passed with the instruction.
[0093] In some embodiments, the 128-bit instruction format 710 includes an access / addressing mode field 726, which defines, for example, whether direct register addressing mode or indirect register addressing mode is used. When direct register addressing mode is used, the register address of one or more operands is provided directly by bits in the instruction.
[0094] In some embodiments, the 128-bit instruction format 710 includes an access / address mode field 726 that specifies the address mode and / or access mode for the instruction. In one embodiment, the access mode is used to define the data access alignment for the instruction. Some embodiments support access modes, including 16-byte aligned access modes and 1-byte aligned access modes, wherein the byte alignment of the access mode determines the access alignment of the instruction operands. For example, when in a first mode, the instruction can use byte aligned addressing for source operands and destination operands, and when in a second mode, the instruction can use 16-byte aligned addressing for all source operands and destination operands.
[0095] In one embodiment, the address mode portion of the access / address mode field 726 determines whether the instruction uses direct addressing or indirect addressing. When direct register addressing mode is used, the bits in the instruction directly provide the register address of one or more operands. When indirect register addressing mode is used, the register address of one or more operands can be calculated based on the address register value and the address immediate field in the instruction.
[0096] In some embodiments, instructions are grouped based on the opcode 712 bit field to simplify opcode decoding 740. For 8-bit opcodes, the 4th, 5th, and 6th bits allow the execution unit to determine the type of opcode. The precise opcode grouping shown is exemplary only. In some embodiments, the move and logic opcode group 742 includes data movement and logic instructions (e.g., move (mov), compare (cmp)). In some embodiments, the move and logic group 742 shares five most significant bits (MSBs), wherein the move (mov) instruction adopts the form of 0000xxxxb, and the logic instruction adopts the form of 0001xxxxb. The flow control instruction group 744 (e.g., call (call), jump (jmp)) includes instructions in the form of 0010xxxxb (e.g., 0x20). The miscellaneous instruction group 746 includes a mixture of instructions, including synchronization instructions (e.g., wait (wait), send (send)) in the form of 0011xxxxb (e.g., 0x30). The parallel math instruction group 748 includes component-wise arithmetic instructions (e.g., add, mul) in the form of 0100xxxxb (e.g., 0x40). The parallel math group 748 performs arithmetic operations in parallel across data channels. The vector math group 750 includes arithmetic instructions (e.g., dp4) in the form of 0101xxxxb (e.g., 0x50). The vector math group performs arithmetic operations on vector operands, such as dot product operations.
[0097] Graphics Pipeline
[0098] Figure 8 is a block diagram of another embodiment of a graphics processor 800 . Figure 8 Those elements having the same reference numbers (or names) as elements in any other figure herein may operate or function in any manner similar to that described elsewhere herein, but are not limited to these.
[0099] In some embodiments, the graphics processor 800 includes a graphics pipeline 820, a media pipeline 830, a display engine 840, a thread execution logic 850, and a rendering output pipeline 870. In some embodiments, the graphics processor 800 is a graphics processor within a multi-core processing system that includes one or more general-purpose processing cores. The graphics processor is controlled by register writes to one or more control registers (not shown) or by commands issued to the graphics processor 800 via the ring interconnect 802. In some embodiments, the ring interconnect 802 couples the graphics processor 800 to other processing components, such as other graphics processors or general-purpose processors. Commands from the ring interconnect 802 are interpreted by a command streamer 803, which supplies instructions to separate components of the graphics pipeline 820 or the media pipeline 830.
[0100] In some embodiments, command streamer 803 directs the operation of vertex fetcher 805, which reads vertex data from memory and executes vertex processing commands provided by command streamer 803. In some embodiments, vertex fetcher 805 provides vertex data to vertex shader 807, which performs coordinate space conversion and lighting operations on each vertex. In some embodiments, vertex fetcher 805 and vertex shader 807 execute vertex processing instructions by dispatching execution threads to execution units 852A-852B via thread dispatcher 831.
[0101] In some embodiments, execution units 852A-852B are vector processor arrays with instruction sets for performing graphics and media operations. In some embodiments, execution units 852A-852B have an attached L1 cache 851 that is dedicated to each array or shared between arrays. The cache can be configured as a data cache, an instruction cache, or a single cache that is partitioned to contain data and instructions in different partitions.
[0102] In some embodiments, the graphics pipeline 820 includes a tessellation component for performing hardware accelerated tessellation of 3D objects. In some embodiments, the programmable shell shader 811 configures the tessellation operation. The programmable domain shader 817 provides back-end evaluation of the tessellation output. The tessellation 813 operates at the direction of the shell shader 811 and contains dedicated logic for generating a detailed set of geometric objects based on a coarse geometric model that is provided as input to the graphics pipeline 820. In some embodiments, if tessellation is not used, the tessellation components (e.g., the shell shader 811, the tessellation 813, and the domain shader 817) can be bypassed.
[0103] In some embodiments, the complete geometric object may be processed by the geometry shader 819 via one or more threads dispatched to the execution units 852A-852B, or may proceed directly to the clipper 829. In some embodiments, the geometry shader operates on entire geometric objects (rather than vertices or vertex patches as in previous stages of the graphics pipeline). If tessellation is disabled, the geometry shader 819 receives input from the vertex shader 807. In some embodiments, the geometry shader 819 may be programmed by a geometry shader program to perform geometry tessellation when the tessellation unit is disabled.
[0104] Before rasterization, the clipper 829 processes the vertex data. The clipper 829 can be a fixed function clipper or a programmable clipper with clipping and geometry shader functions. In some embodiments, the rasterizer and depth test component 873 in the rendering output pipeline 870 dispatches a pixel shader to convert the geometric object into its per-pixel representation. In some embodiments, the pixel shader logic is included in the thread execution logic 850. In some embodiments, the application can bypass the rasterizer and depth test component 873 and access the unrasterized vertex data via the outflow unit 823.
[0105] The graphics processor 800 has an interconnect bus, interconnect structure, or some other interconnect mechanism that allows data and messages to be passed among the main components of the graphics processor. In some embodiments, execution units 852A-852B and associated cache(s) 851, texture and media samplers 854, and texture / sampler cache 858 are interconnected via data ports 856 to perform memory accesses and communicate with the processor's rendering output pipeline components. In some embodiments, samplers 854, caches 851, 858, and execution units 852A-852B each have separate memory access paths.
[0106] In some embodiments, the rendering output pipeline 870 includes a rasterizer and a depth test component 873, which converts vertex-based objects into associated pixel-based representations. In some embodiments, the rasterizer logic includes a window device / masker unit for performing fixed-function triangle and line rasterization. An associated rendering cache 878 and a depth cache 879 are also available in some embodiments. A pixel operation component 877 performs pixel-based operations on data, but in some instances, pixel operations associated with 2D operations (e.g., using mixed bit block image transfer) are performed by the 2D engine 841, or replaced by overlapping display planes by the display controller 843 at display time. In some embodiments, a shared L3 cache 875 can be used for all graphics components, thereby allowing data to be shared without using the main system memory.
[0107] In some embodiments, the graphics processor media pipeline 830 includes a media engine 837 and a video front end 834. In some embodiments, the video front end 834 receives pipeline commands from the command streamer 803. In some embodiments, the media pipeline 830 includes a separate command streamer. In some embodiments, the video front end 834 processes the media commands before sending the commands to the media engine 837. In some embodiments, the media engine 837 includes a thread generation function for generating threads for dispatching to the thread execution logic 850 via the thread dispatcher 831.
[0108] In some embodiments, the graphics processor 800 includes a display engine 840. In some embodiments, the display engine 840 is external to the processor 800 and is coupled to the graphics processor via the ring interconnect 802, or some other interconnect bus or structure. In some embodiments, the display engine 840 includes a 2D engine 841 and a display controller 843. In some embodiments, the display engine 840 includes dedicated logic that can operate independently of the 3D pipeline. In some embodiments, the display controller 843 is coupled to a display device (not shown), which can be a system integrated display device (such as in a laptop computer), or an external display device attached via a display device connector.
[0109] In some embodiments, the graphics pipeline 820 and the media pipeline 830 are configurable to perform operations based on multiple graphics and media programming interfaces and are not dedicated to any one application programming interface (API). In some embodiments, the driver software for the graphics processor converts API calls dedicated to a specific graphics or media library into commands that can be processed by the graphics processor. In some embodiments, support is provided for the Open Graphics Library (OpenGL), the Open Computing Language (OpenCL) and / or the Vulkan graphics and computing APIs all from the Khronos Group. In some embodiments, support can also be provided for Microsoft's Direct3D library. In some embodiments, a combination of these libraries can be supported. Support can also be provided for the open source computer vision library (OpenCV). If a mapping can be made from the pipeline of a future API to the pipeline of a graphics processor, future APIs with compatible 3D pipelines will also be supported.
[0110] Graphics pipeline programming
[0111] Fig. 9A is a block diagram illustrating a graphics processor command format 900 according to some embodiments. Fig. 9B is a block diagram illustrating a graphics processor command sequence 910 according to an embodiment. Fig. 9A The solid-line boxes in illustrate components that are generally included in the graphics commands, while the dashed lines include components that are optional or included only in a subset of the graphics commands. Fig. 9A The exemplary graphics processor command format 900 includes a data field for identifying the target client 902 of the command, a command operation code (opcode) 904, and associated data 906 for the command. Some commands also include a sub-opcode 905 and a command size 908.
[0112] In some embodiments, client 902 defines a client unit of a graphics device that processes command data. In some embodiments, a graphics processor command parser checks the client field of each command to adjust further processing of the command and routes the command data to the appropriate client unit. In some embodiments, a graphics processor client unit includes a memory interface unit, a rendering unit, a 2D unit, a 3D unit, and a media unit. Each client unit has a corresponding processing pipeline for processing the command. Once the command is received by the client unit, the client unit reads the opcode 904 and the sub-opcode 905 (if present) to determine the operation to be performed. The client unit uses the information in the data field 906 to execute the command. For some commands, it is expected that a clear command size 908 is defined to define the size of the command. In some embodiments, the command parser automatically determines the size of at least some of the commands in the command based on the command opcode. In some embodiments, the commands are aligned via multiples of the double word length.
[0113] Fig. 9B An exemplary graphics processor command sequence 910 is shown in the flowchart of FIG. In some embodiments, software or firmware of a data processing system featuring an embodiment of a graphics processor uses the version of the command sequence shown to initiate, execute, and terminate a set of graphics operations. The sample command sequence is shown and described for exemplary purposes only, as the embodiments are not limited to these specific commands or this command sequence. Moreover, the commands may be issued as a batch of commands in a command sequence so that the graphics processor will process the command sequence in an at least partially simultaneous manner.
[0114] In some embodiments, the graphics processor command sequence 910 may begin with a pipeline flush command 912 to cause any active graphics pipeline to complete currently pending commands for that pipeline. In some embodiments, the 3D pipeline 922 and the media pipeline 924 are not operating simultaneously. The pipeline flush is performed to cause the active graphics pipeline to complete any pending commands. In response to the pipeline flush, the command parser for the graphics processor will stop command processing until the active drawing engine completes pending operations and invalidates the associated read cache. Optionally, any data marked as 'dirty' in the render cache may be flushed to memory. In some embodiments, the pipeline flush command 912 may be used for pipeline synchronization or before placing the graphics processor in a low power state.
[0115] In some embodiments, when a command sequence requires the graphics processor to explicitly switch between pipelines, a pipeline select command 913 is used. In some embodiments, a pipeline select command 913 is only required once in an execution context before issuing pipeline commands, unless the context is to issue commands for two pipelines. In some embodiments, a pipeline flush command 912 is required immediately before a pipeline switch via a pipeline select command 913.
[0116] In some embodiments, pipeline control commands 914 configure the graphics pipeline for operation and are used to program 3D pipeline 922 and media pipeline 924. In some embodiments, pipeline control commands 914 configure pipeline states for active pipelines. In one embodiment, pipeline control commands 914 are used for pipeline synchronization and for clearing data from one or more cache memories within an active pipeline before processing a batch of commands.
[0117] In some embodiments, commands 916 for return buffer states are used to configure a set of return buffers for corresponding pipelines to write data. Some pipeline operations require allocating, selecting, or configuring one or more return buffers into which the operation writes intermediate data during processing. In some embodiments, the graphics processor also uses one or more return buffers to store output data and perform cross-thread communication. In some embodiments, configuring return buffer states 916 includes selecting the size and number of return buffers for the set of pipeline operations.
[0118] The remaining commands in the command sequence differ based on the active pipeline for operation. Based on pipeline decision 920 , the command sequence is tailored for either the 3D pipeline 922 starting at 3D pipeline state 930 , or the media pipeline 924 starting at media pipeline state 940 .
[0119] The commands for configuring the 3D pipeline state 930 include 3D state setting commands for vertex buffer state, vertex element state, constant color state, depth buffer state, and other state variables to be configured before processing 3D primitive commands. The values of these commands are determined at least in part based on the specific 3D API in use. In some embodiments, the 3D pipeline state 930 commands can also selectively disable or bypass specific pipeline elements (if those elements will not be used).
[0120] In some embodiments, 3D primitive 932 commands are used to submit 3D primitives to be processed by the 3D pipeline. The commands and associated parameters passed to the graphics processor via the 3D primitive 932 commands will be forwarded to the vertex acquisition function in the graphics pipeline. The vertex acquisition function uses the 3D primitive 932 command data to generate multiple vertex data structures. The vertex data structure is stored in one or more return buffers. In some embodiments, 3D primitive 932 commands are used to perform vertex operations on the 3D primitives via vertex shaders. In order to process vertex shaders, the 3D pipeline 922 dispatches the shader execution thread to the graphics processor execution unit.
[0121] In some embodiments, the 3D pipeline 922 is triggered via an execution 934 command or event. In some embodiments, a register write triggers the command execution. In some embodiments, the execution is triggered via a 'go' or 'kick' command in the command sequence. In one embodiment, the command execution is triggered using a pipeline synchronization command to flush the command sequence through the graphics pipeline. The 3D pipeline will perform geometry processing on the 3D primitives. Once the operation is completed, the generated geometric objects are rasterized and the pixel engine shades the generated pixels. For these operations, additional commands for controlling pixel shading and pixel backend operations may also be included.
[0122] In some embodiments, when performing media operations, the graphics processor command sequence 910 follows the media pipeline 924 path. Generally, the specific purpose and manner of programming the media pipeline 924 depends on the media or computing operation to be performed. During the media decoding process, specific media decoding operations can be offloaded to the media pipeline. In some embodiments, the media pipeline can also be bypassed, and the media decoding can be performed in whole or in part using resources provided by one or more general processing cores. In one embodiment, the media pipeline also includes elements for general purpose graphics processor unit (GPGPU) operations, wherein the graphics processor is used to perform SIMD vector operations using compute shader programs that are not explicitly related to rendering graphics primitives.
[0123] In some embodiments, the media pipeline 924 is configured in a similar manner to the 3D pipeline 922. A set of commands for configuring the media pipeline state 940 is dispatched or placed into a command queue, before the media object commands 942. In some embodiments, the commands 940 for the media pipeline state include data for configuring the media pipeline elements that will be used to process the media objects. This includes data for configuring the video decoding and video encoding logic within the media pipeline, such as encoding or decoding formats. In some embodiments, the commands 940 for the media pipeline state also support the use of one or more pointers for "indirect" state elements that contain a batch of state settings.
[0124] In some embodiments, media object commands 942 supply pointers to media objects for processing by the media pipeline. The media object includes a memory buffer that contains video data to be processed. In some embodiments, all media pipeline states must be valid before issuing media object commands 942. Once the pipeline states are configured and media object commands 942 are queued, the media pipeline 924 is triggered via an execute 944 command or an equivalent execution event (e.g., a register write). The output from the media pipeline 924 can then be post-processed by operations provided by the 3D pipeline 922 or the media pipeline 924. In some embodiments, GPGPU operations are configured and executed in a manner similar to media operations.
[0125] Graphics software architecture
[0126] Fig.10 An exemplary graphics software architecture for data processing system 1000 according to some embodiments is illustrated. In some embodiments, the software architecture includes 3D graphics application 1010, operating system 1020, and at least one processor 1030. In some embodiments, processor 1030 includes graphics processor 1032 and one or more general purpose processor cores 1034. Graphics application 1010 and operating system 1020 are each executed in system memory 1050 of the data processing system.
[0127] In some embodiments, the 3D graphics application 1010 includes one or more shader programs that include shader instructions 1012. The shader language instructions may be in a high-level shader language, such as a high-level shader language (HLSL) or an OpenGL shader language (GLSL). The application also includes executable instructions 1014 in a machine language suitable for execution by a general purpose processor core 1034. The application also includes graphics objects 1016 defined by vertex data.
[0128] In some embodiments, the operating system 1020 is a Microsoft® Windows® operating system from Microsoft Corporation, a dedicated UNIX-style operating system, or an open source UNIX-style operating system using a Linux kernel variant. The operating system 1020 can support a graphics API 1022, such as a Direct3D API, an OpenGL API, or a Vulkan API. When the Direct3D API is in use, the operating system 1020 uses a front-end shader compiler 1024 to compile any shader instruction 1012 in HLSL into a lower-level shader language. The compilation can be a just-in-time (JIT) compilation, or the application can execute the shader pre-compilation. In some embodiments, in the process of compiling the 3D graphics application 1010, a high-level shader is compiled into a low-level shader. In some embodiments, the shader instruction 1012 is provided in an intermediate form, such as a version of the standard portable intermediate representation (SPIR) used by the Vulkan API.
[0129] In some embodiments, the user mode graphics driver 1026 includes a backend shader compiler 1027 that converts shader instructions 1012 into hardware-specific representations. When using the OpenGL API, the shader instructions 1012 in the GLSL high-level language are passed to the user mode graphics driver 1026 for compilation. In some embodiments, the user mode graphics driver 1026 uses the operating system kernel mode function 1028 to communicate with the kernel mode graphics driver 1029. In some embodiments, the kernel mode graphics driver 1029 communicates with the graphics processor 1032 to dispatch commands and instructions.
[0130] IP Core Implementation
[0131] One or more aspects of at least one embodiment may be implemented by representative code stored on a machine-readable medium that represents and / or defines logic within an integrated circuit (such as a processor). For example, a machine-readable medium may include instructions representing the various logics within a processor. When read by a machine, the instructions may cause the machine to manufacture logic for performing the techniques described herein. Such representations (referred to as "IP cores") are reusable units of logic for an integrated circuit that may be stored on a tangible, machine-readable medium as a hardware model that describes the structure of the integrated circuit. The hardware model may be supplied to each consumer or manufacturing facility that loads the hardware model on a manufacturing machine that manufactures the integrated circuit. The integrated circuit may be manufactured so that the circuit performs the operations described in association with any of the embodiments described herein.
[0132] Fig.11 1 is a block diagram illustrating an IP core development system 1100 that can be used to manufacture an integrated circuit to perform operations according to an embodiment. The IP core development system 1100 can be used to generate modular, reusable designs that can be incorporated into a larger design or used to build an entire integrated circuit (e.g., a SOC integrated circuit). The design facility 1130 can generate a software simulation 1110 of the IP core design using a high-level programming language (e.g., C / C++). The software simulation 1110 can be used to design, test, and verify the behavior of the IP core using a simulation model 1112. The simulation model 1112 can include functional, behavioral, and / or timing simulations. A register transfer level (RTL) design 1115 can then be created or synthesized by the simulation model 1112. The RTL design 1115 is an abstraction of the behavior of an integrated circuit (including associated logic executed using the modeled digital signals) that models the flow of digital signals between hardware registers. In addition to the RTL design 1115, a lower level design at a logic level or transistor level can also be created, designed, or synthesized. As a result, the specific details of the initial design and simulation can vary.
[0133] The RTL design 1115 or equivalent can be further synthesized by the design facility into a hardware model 1120, which can be in a hardware description language (HDL) or some other representation of physical design data. The HDL can be further simulated or tested to verify the IP core design. The IP core design can be stored using a non-volatile memory 1140 (e.g., a hard disk, flash memory, or any non-volatile storage medium) for delivery to a third-party manufacturing facility 1165. Alternatively, the IP core design can be transmitted (e.g., via the Internet) via a wired connection 1150 or a wireless connection 1160. The manufacturing facility 1165 can then manufacture an integrated circuit based at least in part on the IP core design. The manufactured integrated circuit can be configured to perform operations according to at least one embodiment described herein.
[0134] Exemplary System-on-Chip Integrated Circuit
[0135] Figure 12 to Figure 14 An exemplary integrated circuit and associated graphics processor that can be manufactured using one or more IP cores according to various embodiments described herein are illustrated. In addition to what is illustrated, other logic and circuits may also be included, including additional graphics processors / cores, peripheral interface controllers, or general purpose processor cores.
[0136] Fig.12is a block diagram illustrating an exemplary system-on-chip integrated circuit 1200 that can be manufactured using one or more IP cores according to an embodiment. The exemplary integrated circuit 1200 includes one or more application processors 1205 (e.g., CPUs), at least one graphics processor 1210, and may additionally include an image processor 1215 and / or a video processor 1220, any of which may be modular IP cores from the same or multiple different design facilities. The integrated circuit 1200 includes peripheral or bus logic, including a USB controller 1225, a UART controller 1230, a SPI / SDIO controller 1235, and an I2S / I2C controller 1240. In addition, the integrated circuit may also include a display device 1245, which is coupled to one or more of a high-definition multimedia interface (HDMI) controller 1250 and a mobile industry processor interface (MIPI) display interface 1255. Storage may be provided by a flash memory subsystem 1260 (including flash memory and a flash memory controller). A memory interface may be provided via a memory controller 1265 to access SDRAM or SRAM memory devices. Additionally, some integrated circuits also include an embedded security engine 1270 .
[0137] Fig.13 1 is a block diagram illustrating an exemplary graphics processor 1310 of a system-on-chip integrated circuit that may be manufactured using one or more IP cores according to an embodiment. The graphics processor 1310 may be Fig.12 The graphics processor 1310 includes a vertex processor 1305 and one or more fragment processors 1315A to 1315N (e.g., 1315A, 1315B, 1315C, 1315D, all the way to 1315N-1 and 1315N). The graphics processor 1310 can execute different shader programs via separate logic, so that the vertex processor 1305 is optimized to perform operations for the vertex shader program, while the one or more fragment processors 1315A to 1315N perform fragment (e.g., pixel) shading operations for the fragment or pixel shader program. The vertex processor 1305 performs the vertex processing stage of the 3D graphics pipeline and generates primitives and vertex data. The (one or more) fragment processors 1315A to 1315N use the primitives and vertex data generated by the vertex processor 1305 to generate a frame buffer displayed on a display device. In one embodiment, the fragment processor(s) 1315A- 1315N are optimized to execute fragment shader programs provided in the OpenGL API, which can be used to perform similar operations as pixel shader programs provided in the Direct 3D API.
[0138] In addition, graphics processor 1310 also includes one or more memory management units (MMUs) 1320A-1320B, one or more caches 1325A-1325B, and (one or more) circuit interconnects 1330A-1330B. One or more MMUs 1320A-1320B provide graphics processor 1310 (including vertex processor 1305 and / or (one or more) fragment processors 1315A-1315N) with virtual to physical address mappings that can reference vertex or image / texture data stored in memory in addition to vertex or image / texture data stored in one or more caches 1325A-1325B. In one embodiment, one or more MMUs 1320A-1320B can communicate with other MMUs within the system (including with Fig.12 The graphics processor 1310 may be synchronized with one or more MMUs associated with one or more application processors 1205, image processor 1215, and / or video processor 1220 so that each processor 1205 to 1220 may participate in a shared or unified virtual memory system. According to an embodiment, one or more circuit interconnects 1330A to 1330B enable the graphics processor 1310 to interact with other IP cores within the SoC via an internal bus of the SoC or via a direct connection.
[0139] Fig.14 is a block diagram illustrating an additional exemplary graphics processor 1410 of a system-on-chip integrated circuit that may be fabricated using one or more IP cores in accordance with an embodiment. The graphics processor 1410 may be Fig.12 A variation of the graphics processor 1210 of FIG. The graphics processor 1410 includes Fig.13 One or more MMUs 1320A-1320B, cache(s) 1325A-1325B, and circuit interconnect(s) 1330A-1330B of integrated circuit 1300.
[0140] Graphics processor 1410 includes one or more shader cores 1415A to 1415N (e.g., 1415A, 1415B, 1415C, 1415D, 1415E, 1415F, all the way to 1315N-1 and 1315N), which provide a unified shader core architecture in which a single core or type or core can execute all types of programmable shader code, including shader program code to implement vertex shaders, fragment shaders, and / or compute shaders. The exact number of shader cores present may vary in embodiments and implementations. In addition, the graphics processor 1410 also includes an inter-core task manager 1405, which acts as a thread dispatcher for dispatching execution threads to one or more shader cores 1415A to 1415N and a tile unit 1418 for accelerating tile operations for tile-based rendering, wherein rendering operations of a scene are subdivided in image space, for example to exploit local spatial coherence within the scene or to optimize the use of internal caches.
[0141] Exemplary Graphics Virtualization Architecture
[0142] Some embodiments of the present invention are implemented on a platform utilizing full graphics processor unit (GPU) virtualization. Thus, an overview of GPU virtualization techniques employed in one embodiment of the present invention is provided below, followed by a detailed description of an apparatus and method for mode-driven page table shadowing.
[0143] One embodiment of the present invention uses a complete GPU virtualization environment that runs a native graphics driver in the client, and an intermediary delivery that achieves good performance, scalability, and secure isolation between clients. This embodiment provides each virtual machine (VM) with a virtual full-function GPU that can directly access performance-critical resources in most cases without intervention from the hypervisor, while capturing and emulating privileged operations from the client at the lowest cost. In one embodiment, a virtual GPU (vGPU) with full GPU features is presented to each VM. In most cases, the VM can directly access performance-critical resources without intervention from the hypervisor, while capturing and emulating privileged operations from the client to provide secure isolation between VMs. Each quantum switches the vGPU context to share the physical GPU between multiple VMs.
[0144] Fig.15A high-level system architecture on which embodiments of the present invention may be implemented is illustrated, including a graphics processing unit (GPU) 1500, a central processing unit (CPU) 1520, and a system memory 1510 shared between the GPU 1500 and the CPU 1520. The rendering engine 1502 obtains GPU commands from a command buffer 1512 in the system memory 1510 to accelerate graphics rendering using a variety of different features. The display engine 1504 obtains pixel data from a frame buffer 1514 and then sends the pixel data to an external monitor for display.
[0145] Some architectures use system memory 1510 as graphics memory, while other GPUs may use on-die memory. System memory 1510 may be mapped into multiple virtual address spaces via the GPU page tables 1506. A 2 GB global virtual address space, called global graphics memory, is accessible from both the GPU 1500 and the CPU 1520, mapped via the global page tables. Local graphics memory space is supported in the form of multiple 2 GB local virtual address spaces, but is limited to access from the rendering engine 1502 via the local page tables. Global graphics memory is mostly a frame buffer 1514, but is also used as a command buffer 1512. A large number of data accesses are made to local graphics memory when hardware acceleration is in progress. GPUs with on-die memory employ a similar page table mechanism.
[0146] In one embodiment, CPU 1520 programs GPU 1500 via GPU-specific commands in a producer-consumer model, such as Fig.15 As shown in . According to high-level programming APIs such as OpenGL and DirectX, the graphics driver programs the GPU commands into the command buffer 1512, including the main buffer and the batch buffer. The GPU 1500 then obtains and executes the command. The main buffer (ring buffer) can link other batch buffers together. The terms "main buffer" and "ring buffer" are used interchangeably below. The batch buffer is used to pass most of the commands of each programming model (up to ~98%). The register tuple (head, tail) is used to control the ring buffer. In one embodiment, the CPU 1520 submits commands to the GPU 1500 by updating the tail, and the GPU 1500 obtains the command from the head, and then notifies the CPU 1520 by updating the head after the command has been executed.
[0147] As described above, one embodiment of the present invention is implemented in a complete GPU virtualization platform with brokered delivery. Therefore, each VM is presented with a fully functional GPU to run native graphics drivers inside the VM. However, there are significant challenges in the following three aspects: (1) the complexity of virtualizing the entire complex modern GPU, (2) the performance due to multiple VMs sharing the GPU, and (3) complete security isolation between VMs without any compromise.
[0148] Fig.16 A GPU virtualization architecture according to one embodiment of the present invention is illustrated, the GPU virtualization architecture including a hypervisor 1610, a privileged virtual machine (VM) 1620, and one or more user VMs 1631-1632 running on a GPU 1600. A virtualization stub module 1611 running in the hypervisor 1610 extends memory management to include an extended page table (EPT) 1614 for user VMs 1631-1632, and a privileged virtual memory management unit (PVMMU) 1612 for the privileged VM 1620 to implement a capture and delivery strategy. In one embodiment, each VM 1620, 1631-1632 runs a native graphics driver 1628, which can directly access performance-critical resources of frame buffers and command buffers using resource partitioning as described below. To protect privileged resources, i.e., I / O registers and PTEs, corresponding accesses from user VMs 1631 to 1632 and the graphics driver 1628 in privileged VM 1620 are captured and forwarded to the virtualization mediator 1622 in privileged VM 1620 for emulation. In one embodiment, as illustrated, virtualization mediator 1622 uses a hypercall to access physical GPU 1600.
[0149] In addition, in one embodiment, the virtualization mediator 1622 implements a GPU scheduler 1626 that runs concurrently with the CPU scheduler 1616 in the hypervisor 1610 to share the physical GPU 1600 between VMs 1631 to 1632. One embodiment uses the physical GPU 1600 to directly execute all commands submitted from the VM, so it avoids the complexity of emulating the rendering engine, which is the most complex part of the GPU. At the same time, resource delivery of the frame buffer and command buffer minimizes the intervention of the hypervisor 1610 on CPU access, while the GPU scheduler 1626 ensures that each VM quantum is used for direct GPU execution. Therefore, the illustrated embodiment achieves good performance when sharing the GPU between multiple VMs.
[0150] In one embodiment, the virtualization stub 1611 selectively captures or passes client accesses to certain GPU resources. The virtualization stub 1611 manipulates EPT 1614 entries to selectively present or hide specific address ranges to user VMs 1631 to 1632, while using reserved bits PTE in PVMMU 1612 for privileged VM 1620 to selectively capture or pass client accesses to specific address ranges. In both cases, peripheral input / output (PIO) accesses are captured. All captured accesses are forwarded to the virtualization mediator 1622 for emulation, and the virtualization mediator 1611 uses hypercalls to access the physical GPU 1600.
[0151] As mentioned above, in one embodiment, the virtualization mediator 1622 emulates a virtual GPU (vGPU) 1624 for privileged resource access and performs context switching between vGPUs 1624. At the same time, the privileged VM 1620 graphics driver 1628 is used to initialize the physical device and manage power. One embodiment adopts a flexible release model to ease the binding between the virtualization mediator 1622 and the hypervisor 1610 by implementing the virtualization mediator 1622 as a kernel module in the privileged VM 1620.
[0152] The separate CPU / GPU scheduling mechanism is implemented via the CPU scheduler 1616 and the GPU scheduler 1626. This is done because the cost of a GPU context switch may be more than 1000 times the cost of a CPU context switch (e.g., ~700 us vs. ~300 ns). In addition, the number of CPU cores in a computer system may be different from the number of GPU cores. Therefore, in one embodiment, the GPU scheduler 1626 is implemented separately from the existing CPU scheduler 1616. The separate scheduling mechanism results in the need for concurrent access to resources from the CPU and the GPU. For example, when the CPU is accessing the graphics memory of VM1 1631, the GPU may be accessing the graphics memory of VM21632 at the same time.
[0153] As discussed above, in one embodiment, a native graphics driver 1628 is executed inside each VM 1620, 1631 to 1632, and the native graphics driver directly accesses a portion of performance-critical resources through privileged operations emulated by the virtualization mediator 1622. The separation scheduling mechanism leads to the resource partitioning design described below. To better support resource partitioning, one embodiment reserves a memory mapped I / O (MMIO) register window to transmit resource partitioning information to the VM.
[0154] In one embodiment, the location and definition of virt_info has been incorporated into the hardware specification as a virtualization extension, so the graphics driver 1628 handles the extension natively and future GPU generations follow the specification for backward compatibility.
[0155] Although in Fig.16 1610 as separate components, but in one embodiment, privileged VM 1620 including virtualization mediator 1622 (and its vGPU instances 1624 and GPU scheduler 1626 ) is implemented as a module within hypervisor 1610 .
[0156] In one embodiment, the virtualization mediator 1622 manages the vGPU 1624 of all VMs by trapping and emulating privileged operations. The virtualization mediator 1622 handles physical GPU interrupts and can generate virtual interrupts to specified VMs 1631 to 1632. For example, a physical completion interrupt of a command execution may trigger a virtual completion interrupt and be passed to the rendering owner. The idea of emulating each semantic vGPU instance is simple; however, the implementation involves a lot of engineering work and a deep understanding of the GPU 1600. For example, some graphics drivers can access approximately 700 I / O registers.
[0157] In one embodiment, the GPU scheduler 1626 implements a coarse-grained quality of service (QoS) policy. A specific time quantum can be selected as the time slice for each VM 1631 to 1632 to share the GPU 1600 resources. For example, in one embodiment, a time quantum of 16 ms is selected as the scheduling time slice because this value results in low human perception of image changes. This relatively large quantum is also selected because the cost of GPU context switching is more than 1000 times the cost of CPU context switching, so the quantum cannot be as small as the time slice in the CPU scheduler 1616. Commands from VMs 1631 to 1632 are continuously submitted to the GPU 1600 until the client / VM exhausts its time slice. In one embodiment, the GPU scheduler 1626 waits for the client ring buffer to become free before switching, because most GPUs today are non-preemptive, which may affect fairness. In order to minimize the waiting overhead, a coarse-grained flow control mechanism can be implemented by tracking command submissions to ensure that the piled commands are within certain limits at any time. Therefore, the time drift between the allocated time slices and the execution time is relatively small compared to a large quantum, thus achieving a coarse-grained QoS policy.
[0158] In one embodiment, upon rendering context switching, when switching rendering engines between vGPUs 1624, internal pipeline states and I / O register states are saved and restored, and cache / TLB flushes are performed. The internal pipeline state is not visible to the CPU, but can be saved and restored via GPU commands. Saving / restoring the I / O register state can be achieved by reading / writing the register list in the rendering context. The internal caches and translation lookaside buffers (TLBs) included in modern GPUs for accelerating data access and address translation must be flushed using commands at the rendering context switch to ensure isolation and correctness. In one embodiment, the steps for switching contexts are: 1) saving the current I / O state, 2) flushing the current context, 3) using additional commands to save the current context, 4) using additional commands to restore the new context, and 5) restoring the I / O state of the new context.
[0159] As mentioned, one embodiment uses a dedicated ring buffer to carry additional GPU commands. The (audited) client ring buffer can be reused for execution, but it is unsafe to insert commands directly into the client ring buffer because the CPU may continue to queue more commands, causing the content to be overwritten. To avoid race conditions, one embodiment switches from the client ring buffer to its own dedicated ring buffer. At the end of the context switch, this embodiment switches from the dedicated ring buffer to the client ring buffer of the new VM.
[0160] One embodiment reuses the privileged VM 1620 graphics driver to initialize the display engine, and then manages the display engine to display the different VM frame buffers.
[0161] When both vGPUs 1624 have the same resolution, only the frame buffer location is switched. For different resolutions, the privileged VM can use the hardware scaler, a common feature in modern GPUs, to automatically scale the resolution. Both techniques take only a few milliseconds. In many cases, display management may not be required, such as when the VM is not displayed on a physical display (e.g., when the VM is hosted on a remote server).
[0162] like Fig.16 As shown in FIG. 1 , one embodiment transfers access to the frame buffer and the command buffer to accelerate performance-critical operations from VMs 1631 to 1632. For a global graphics memory space of 2 GB, graphics memory resource partitioning and address space expansion techniques may be employed. For a local graphics memory space, each graphics memory space also has a size of 2 GB. Since the local graphics memory can only be accessed by GPU 1600, each VM local graphics memory may be implemented by rendering context switching.
[0163] As mentioned, one embodiment partitions the global graphics memory between VMs 1631 to 1632. As explained above, the separate CPU / GPU scheduling mechanism requires that the CPU and GPU can access the global graphics memory of different VMs at the same time, so each VM must use its own resources for rendering at any time, resulting in a resource partitioning approach to the global graphics memory.
[0164] Fig.17 Additional details are illustrated for one embodiment of a graphics virtualization architecture 1700 that includes multiple VMs (e.g., VM 1730 and VM 1740) managed by a hypervisor 1710, including access to a full array of GPU features in GPU 1720. In various embodiments, hypervisor 1710 may enable VM 1730 or VM 1740 to use graphics memory and other GPU resources for GPU virtualization. Based on GPU virtualization technology, one or more virtual GPUs (vGPUs) (e.g., vGPUs 1760A and 1760B) may access the full functionality provided by GPU 1720 hardware. In various embodiments, hypervisor 1710 may track, manage the resources and lifecycle of vGPUs 1760A and 1760B as described herein.
[0165] In some embodiments, vGPU 1760A-B may include a virtual GPU device presented to VM 1730, 1740 and may be used to interact with a native GPU driver (e.g., as described above with respect to Fig.16 1760A-B). VM 1730 or VM 1740 can then access the full array of GPU features and use the virtual GPU device in vGPU 1760A-B to access the virtual graphics processor. For example, once VM 1730 is captured in hypervisor 1710, hypervisor 1710 can manipulate the vGPU instance (e.g., vGPU 1760A) and determine whether VM 1730 can access the virtual GPU device in vGPU 1760A. The vGPU context can be switched per quantum or event. In some embodiments, context switching can occur per GPU rendering engine (such as 3D rendering engine 1722 or bit block transfer rendering engine 1724). Periodic switching allows multiple VMs to share a physical GPU in a manner that is transparent to the workload of the VM.
[0166] GPU virtualization can take various forms. In some embodiments, VM 1730 can be enabled using device delivery, where the entire GPU 1720 is presented to VM 1730 as if they were directly connected. Much like a single central processing unit (CPU) core can be designated for exclusive use by VM 1730, GPU 1720 can also be designated for exclusive use by VM 1730 (e.g., even for a limited time). Another virtualization model is time-sharing, where GPU 1720 or a portion thereof can be shared by multiple VMs (e.g., VM 1730 and VM 1740) in a multiplexed manner. In other embodiments, device 1700 can also use other GPU virtualization models. In various embodiments, graphics memory associated with GPU 1720 can be partitioned and allocated to each vGPU 1760A-B in hypervisor 1710.
[0167] In various embodiments, a graphics translation table (GTT) may be used by a VM or GPU 1720 to map graphics processor memory to system memory or to convert GPU virtual addresses to physical addresses. In some embodiments, the hypervisor 1710 may manage graphics memory mappings via a shadow GTT, and the shadow GTT may be maintained in a vGPU instance (e.g., vGPU 1760A). In various embodiments, each VM may have a corresponding shadow GTT for maintaining mappings between graphics memory addresses and physical memory addresses (e.g., machine memory addresses in a virtualized environment). In some embodiments, the shadow GTT may be shared and maintain mappings for multiple VMs. In some embodiments, each VM 1730 or VM 1740 may include both a per-process GTT and a global GTT.
[0168] In some embodiments, the device 1700 may use system memory as graphics memory. The system memory may be mapped into multiple virtual address spaces through a GPU page table. The device 1700 may support a global graphics memory space and a per-process graphics memory address space. The global graphics memory space may be a virtual address space (e.g., 2 GB) mapped through a global graphics translation table (GGTT). The lower portion of this address space is sometimes referred to as an opening accessible from the GPU 1720 and the CPU (not shown). The upper portion of this address space is referred to as a high-order graphics memory space or a hidden graphics memory space that can only be used by the GPU 1720. In various embodiments, the shadow global graphics translation table (SGGTT) may be used by VM 1730, VM 1740, hypervisor 1710, or GPU 1720 to translate image memory addresses into corresponding system memory addresses based on the global memory address space.
[0169] In full GPU virtualization, the static global graphics memory space partitioning scheme may face scalability issues. For example, for a 2 GB global graphics memory space, the first 512 megabytes (MB) of virtual address space can be reserved for opening, and the remaining portion (1536 MB) can become the high (hidden) graphics memory space. With the static global graphics memory space partitioning scheme, each VM with full GPU virtualization enabled can be allocated with 128 MB opening and 384 MB high graphics memory space. Therefore, the 2 GB global graphics memory space can only accommodate a maximum of four VMs.
[0170] In addition to scalability issues, VMs with limited graphics memory space may also experience performance degradation. Sometimes, when media applications make extensive use of GPU media hardware acceleration, severe performance degradation can be observed in some media-heavy workloads of the media applications. As an example, in order to decode one channel of 1080p H.264 / Advanced Video Coding (AVC) bitstream, at least 40 MB of graphics memory may be required. Therefore, decoding 10 channels of 1080p H264 / AVC bitstream may require at least 400 MB of graphics memory space. At the same time, some graphics memory space may need to be reserved for surface compositing / color conversion, switching display frame buffers during decoding, etc. In this case, 512 MB of graphics memory space per VM may not be enough for the VM to run multi-video encoding or decoding.
[0171] In various embodiments, the device 100 may utilize an on-demand SGGTT to implement GPU graphics memory overcommitment. In some embodiments, the hypervisor 1710 may construct an SGGTT on demand that may include all pending translations of graphics memory virtual addresses of owner VMs from different GPU components.
[0172] In various embodiments, at least one VM managed by hypervisor 1710 may be allocated more global graphics memory address space and memory than static partitions. In some embodiments, at least one VM managed by hypervisor 1710 may be allocated or have access to the entire high graphics memory address space. In some embodiments, at least one VM managed by hypervisor 1710 may be allocated or have access to the entire graphics memory address space.
[0173] Hypervisor / VMM 1710 may use command parser 1718 to detect the potential memory working set of the GPU rendering engine for commands submitted by VM 1730 or VM 1740. In various embodiments, VM 1730 may have a corresponding command buffer (not shown) for holding commands from 3D workload 1732 or media workload 1734. Similarly, VM 1740 may have a corresponding command buffer (not shown) for holding commands from 3D workload 1742 or media workload 1744. In other embodiments, VM 1730 or VM 1740 may have other types of graphics workloads.
[0174] In various embodiments, command parser 1718 may scan commands from a VM and determine whether the command contains a memory operand. If so, the command parser may, for example, read the relevant graphics memory space mapping from the VM's GTT and then write it to the workload-specific portion of the SGGTT. After scanning the entire command buffer of the workload, an SGGTT that maintains the memory address space mapping associated with the workload may be generated or updated. In addition, by scanning the pending commands from VM 1730 or VM 1740, command parser 1718 may also improve the security of GPU operations (e.g., by mitigating malicious operations).
[0175] In some embodiments, one SGGTT may be generated to hold translations for all workloads from all VMs. In some embodiments, one SGGTT may be generated to hold translations for all workloads, for example, from only one VM. Workload-specific SGGTT portions may be constructed on demand by command parser 1718 to hold translations for specific workloads (e.g., 3D workload 1732 from VM 1730 or media workload 1744 from VM 1740). In some embodiments, command parser 1718 may insert the SGGTT into SGGTT queue 1714 and the corresponding workload into workload queue 1716.
[0176] In some embodiments, GPU scheduler 1712 can build such an on-demand SGGTT at execution time. A particular hardware engine may use only a small portion of the graphics memory address space allocated to VM 1730 at execution time, and GPU context switching occurs rarely. To take advantage of this GPU feature, hypervisor 1710 can use the SGGTT of VM 1730 to only keep execution and pending transformations for individual GPU components (rather than the entire portion of the global graphics memory address space allocated to VM 1730).
[0177] The GPU scheduler 1712 for the GPU 1720 may be separated from the scheduler of the CPU in the device 1700. In some embodiments, in order to exploit hardware parallelism, the GPU scheduler 1712 may schedule workloads of different GPU engines (e.g., the 3D rendering engine 1722, the bit block transfer rendering engine 1724, the video command streamer (VCS) rendering engine 1726, and the video enhanced command streamer (VECS) rendering engine 1728) separately. For example, the VM 1730 may be 3D-intensive, and the 3D workload 1732 may need to be scheduled to the 3D rendering engine 1722 at one moment. At the same time, the VM 1740 may be media-intensive, and the media workload 1744 may need to be scheduled to the VCS rendering engine 1726 and / or the VECS rendering engine 1728. In this case, the GPU scheduler 1712 may schedule the 3D workload 1732 from the VM 1730 and the media workload 1744 from the VM 1740 separately.
[0178] In various embodiments, the GPU scheduler 1712 may track the executing SGGTTs used by the corresponding rendering engine in the GPU 1720. In this case, the hypervisor 1710 may retain a per-rendering engine SGGTT for tracking all executing graphics memory working sets in the corresponding rendering engine. In some embodiments, the hypervisor 1710 may retain a single SGGTT for tracking all executing graphics memory working sets for all rendering engines. In some embodiments, such tracking may be based on a separate executing SGGTT queue (not shown). In some embodiments, such tracking may be based on a tag on the SGGTT queue 1714 (e.g., using a registry). In some embodiments, such tracking may be based on a tag on the workload queue 1716 (e.g., using a registry).
[0179] During the scheduling process, the GPU scheduler 1712 may check the SGGTTs from the SGGTT queue 1714 for the workloads to be scheduled from the workload queue 1716. In some embodiments, in order to schedule the next VM for a particular rendering engine, the GPU scheduler 1712 may check whether the graphics memory working set of a particular workload used by the VM of that rendering engine conflicts with the graphics memory working set executed or to be executed by that rendering engine. In other embodiments, such conflict checking may be extended to checking by all other rendering engines using the executing or to be executed graphics memory working sets. In various embodiments, such conflict checking may be based on the corresponding SGGTT in the SGGTT queue 1714 or based on the SGGTT retained by the hypervisor 1710 for tracking all executing graphics memory working sets in the corresponding rendering engine as discussed above.
[0180] If there is no conflict, the GPU scheduler 1712 can integrate the executing and pending graphics memory working sets together. In some embodiments, the resulting SGGTTs for the executing and pending graphics memory working sets of a particular rendering engine can also be generated and stored, for example, in the SGGTT queue 1714 or other data storage device. In some embodiments, the resulting SGGTTs for the executing and pending graphics memory working sets of all rendering engines associated with one VM can also be generated and stored if the graphics memory addresses of all these workloads do not conflict with each other.
[0181] Before submitting the selected VM workload to the GPU 1720, the hypervisor 1710 may write the corresponding SGGTT page into the GPU 1720 (e.g., into the graphics translation table 1750). Thus, the hypervisor 1710 may enable this workload to be executed with the correct mapping in the global graphics memory space. In various embodiments, all of these translation entries may be written into the graphics translation table 1750, into the lower memory space 1754 or the upper memory space 1752. In some embodiments, the graphics translation table 1750 may include a separate table per VM to hold these translation entries. In other embodiments, the graphics translation table 1750 may also include a separate table per rendering engine to apply to these translation entries. In various embodiments, the graphics translation table 1750 may include at least a graphics memory address to be executed.
[0182] However, if there is a conflict as determined by GPU scheduler 1712, then GPU scheduler 1712 may delay scheduling of this VM and instead attempt to schedule another workload of the same or a different VM. In some embodiments, such a conflict may be detected if two or more VMs may attempt to use the same graphics memory address (e.g., for the same rendering engine or two different rendering engines). In some embodiments, GPU scheduler 1712 may change the scheduler policy to avoid selecting one or more of the rendering engines that may conflict with each other. In some embodiments, GPU scheduler 1712 may suspend execution of a hardware engine to mitigate the conflict.
[0183] In some embodiments, memory overcommitment during GPU virtualization as discussed herein can coexist with a static global graphics memory space partitioning scheme. As an example, the opening of the lower memory space 1754 can still be used for static partitioning of all VMs. The upper graphics memory space in the upper memory space 1752 can be used for the memory overcommitment scheme. Compared to the static global graphics memory space partitioning scheme, the memory overcommitment scheme during GPU virtualization can enable each VM to use the entire upper graphics memory space in the upper memory space 1752, which can allow some applications within each VM to use a larger graphics memory space to obtain improved performance.
[0184] In the case of a static global graphics memory space partitioning scheme, a VM that initially requires most of the protected memory can only use a small portion at runtime, while other VMs may be in a state of lack of memory. In the case of memory overcommitment, the hypervisor can allocate memory to VMs on demand, and the saved memory can be used to support more VMs. In the case of SGGTT-based memory overcommitment, only the graphics memory space used by the workload to be executed can be allocated at runtime, which saves graphics memory space and supports more VMs to access GPU 1720.
[0185] Current architectures enable hosting of GPU workloads in cloud and datacenter environments. Full GPU virtualization is one of the fundamental enabling technologies used in GPU clouds. In full GPU virtualization, the virtual machine monitor (VMM), especially the virtual GPU (vGPU) driver, captures and emulates guest access to privileged GPU resources for security and multiplexing, while accessing performance-critical resources through the CPU, such as CPU access to graphics memory. Once submitted, GPU commands are executed directly by the GPU without VMM intervention. As a result, near-native performance is achieved.
[0186] Current systems use system memory for the GPU engine to access the Global Graphics Translation Table (GGTT) and / or Per Process Graphics Translation Table (PPGTT) to translate from GPU graphics memory addresses to system memory addresses. A shading mechanism can be used for the GGTT / PPGTT of the client GPU page table.
[0187] The VMM can use a shadow PPGTT that is synchronized with the client PPGTT. The client PPGTT is write-protected so that the shadow PPGTT can be continuously synchronized with the client PPGTT by capturing and emulating client modifications of its PPGTT. Currently, the GGTT for each vGPU is shadowed and partitioned between each VM, and the PPGTT is shadowed and each VM is shadowed (e.g., on a per-process basis). Since the GGTT PDE table remains within the PCI bar0 MMIO range, the shadow for the GGTT page table is simple. However, the shadow for the PPGTT relies on write protection of the client PPGTT page table, and traditional shadow page tables are very complex (and therefore also vulnerable) and inefficient. For example, the performance overhead of the CPU shadow page table in the current architecture is ~30%. Therefore, in some of these systems, an enlightenment shadow page table is used, which modifies the client graphics driver to collaboratively identify pages for page table pages and / or modifies the client graphics driver when it is released.
[0188] Embodiments of the present invention include a memory management unit (MMU) such as an I / O memory management unit (IOMMU) to remap GPN (guest page number) mapped from a client PPGTT to HPN (host page number) without relying on an inefficient / complex shadow PPGTT. At the same time, one embodiment retains a global shadow GGTT page table for address inflation. These techniques are generally referred to as hybrid layer address mapping (HLAM).
[0189] By default, IOMMU cannot be used for some intermediate delivery architectures because multiple VMs can use only a single secondary translation. One embodiment of the present invention uses the following techniques to solve this problem:
[0190] 1. Use IOMMU to perform two-layer translation without shadow PPGTT. Specifically, in one embodiment, the GPU translates from graphics memory address (GM_ADDR) to GPN, and the IOMMU translates from GPN to HPN, instead of a shadow PPGTT that translates from GM_ADDR to HPN, where write protection is applied to the client PPGTT.
[0191] 2. In one embodiment, the IOMMU page table is managed for each VM and is switched (or partially switched) when the vGPU is switched. That is, when a VM / vGPU is scheduled, the IOMMU page table of the corresponding VM is loaded.
[0192] 3. However, in one embodiment, the GGTT mapped addresses are shared, and since the vCPU can access the GGTT mapped addresses (such as, for example, openings), this global shadow GGTT must remain valid even when the vGPU of this VM is not scheduled. Thus, one embodiment of the present invention uses a hybrid layer address translation that preserves the global shadow GGTT but uses the client PPGTT directly.
[0193] 4. In one embodiment, the GPN address space is partitioned to move the GGTT mapped GPN addresses (which become inputs to the IOMMU, such as GPNs) to a dedicated address range. This can be achieved by capturing and emulating the GGTT page tables. In one embodiment, the GPNs are modified from the GGTT with a large offset to avoid overlap with the PPGTT in the IOMMU mapping.
[0194] Fig.18 The illustrated architecture employed in one embodiment wherein an IOMMU 1830 is enabled for device virtualization. The illustrated architecture includes two VMs 1801, 1811 executing on a hypervisor / VMM 1820 (although the underlying principles of the invention may be implemented with any number of VMs). Each VM 1801, 1811 includes a driver 1802, 1812 (e.g., a native graphics driver) that manages the client PPGTT and GGTT 1803, 1813, respectively. The illustrated IOMMU 1830 includes a HLAM module 1831 for implementing the hybrid layer address mapping techniques described herein. Note that in this embodiment, there is no shadow PPGTT.
[0195] In one embodiment, a GPN to HPN translation page table 1833 of the entire client VM (client VM 1811 in the example) is prepared in the IOMMU mapping, and each vGPU switch triggers an IOMMU page table swap. That is, when each VM 1801, 1811 is scheduled, its corresponding GPN to HPN translation table 1833 is swapped. In one embodiment, HLAM 1831 distinguishes between GGTTGPN and PPGTT GPN and modifies the GGTT GPN so that the GGTT GPN does not overlap with the PPGTT GPN when performing a lookup in the translation table 1833. Specifically, in one embodiment, the virtual GPN generation logic 1832 converts the GGTT GPN into a virtual GPN, which is then used to perform a lookup in the translation table 1833 to identify the corresponding HPN.
[0196] In one embodiment, a virtual GPN is generated by shifting the GGTT by a specified (possibly large) offset to ensure that the mapped address does not overlap / conflict with the PPGTT GPN. Additionally, in one embodiment, since the CPU can access the GGTT mapping address (e.g., open) at any time, the global shadow GGTT will always be valid and maintained in the IOMMU mapping 1833 of each VM.
[0197] In one embodiment, the hybrid layer address mapping 1831 solution partitions the IOMMU address range into two parts: a lower portion reserved for PPGTT GPN to HPN translation, and an upper portion reserved for GGTT virtual GPN to HPN translation. Since the GPN is provided by the VM / client 1811, the GPN should be within the range of the client memory size. In one embodiment, the client PPGTT page table remains unchanged, and all GPNs from the PPGTT are sent directly to the graphics translation hardware / IOMMU through workload execution. However, in one embodiment, MMIO reads / writes from the client VM are captured, and the GGTT page table changes are captured and changed as described herein (e.g., a large offset is added to the GPN to ensure no overlap with the PPGTT mapping in the IOMMU).
[0198] Remote virtualized graphics processing
[0199] In some embodiments of the invention, a server performs graphics virtualization, virtualizing a physical GPU and running graphics applications on behalf of a client. Fig.19 One such embodiment is illustrated, where two clients 1901-1902 are connected to a server 1930 via a network 1910 (such as the Internet and / or a private network). The server 1930 implements a virtualized graphics environment, where a hypervisor 1960 allocates resources from one or more physical GPUs 1938, presenting the resources to VMs / applications 1932-1933 as virtual GPUs 1934-1935. Graphics processing resources may be allocated according to a resource allocation policy 1961, which may enable the hypervisor 1960 to allocate resources based on the requirements of the applications 1932-1933 (e.g., higher performance graphics applications require more resources), user accounts associated with the applications 1932-1933 (e.g., some users pay extra for higher performance), and / or the current load on the system. The allocated GPU resources may include, for example, multiple groups of graphics processing engines, such as 3D engines, block transfer engines, execution units, and media engines, to name a few.
[0200] In one embodiment, the user of each client 1901-1902 has an account on a service that hosts server(s) 1930. For example, the service may provide a subscription service to provide users with remote access to online applications 1932-1933, such as video games, productivity applications, and multi-player virtual reality applications. In one embodiment, in response to user input 1907-1908 from the client 1901-1902, the application is remotely executed on the virtual machine. Although not in Fig.19 , but one or more CPUs may also be virtualized and used to execute applications 1932 to 1933 , with graphics processing operations offloaded to vGPUs 1934 to 1935 .
[0201] In one embodiment, in response to the execution of graphics operations, vGPUs 1934-1935 generate a sequence of image frames. For example, in a first-person shooter game, a user may specify input 1907 to move a character around a fantasy world. In one embodiment, the generated images are compressed (e.g., by compression circuitry / logic, not shown) and streamed to clients 1901-1902 over network 1910. In one implementation, a video compression algorithm such as H.261 may be used; however, a variety of different compression techniques may be used. Decoders 1905-1906 decode the input video stream and then render it on the respective displays 1903-1904 of clients 1901-1902.
[0202] use Fig.19 In the system illustrated in , high-performance graphics processing resources such as GPU 1938 can be allocated to different clients that subscribe to the service. In an online game implementation, for example, server 1930 can host new video games when they are released. The video game program code is then executed in a virtualized environment, and the resulting video frames are compressed and streamed to each client 1901 to 1902. Clients 1901 to 1902 in this architecture do not require a large amount of graphics processing resources. For example, even a relatively low-power smartphone or tablet with decoders 1905 to 1906 will be able to decompress the video stream. Therefore, the latest graphics-intensive video games can be played on any type of client that can compress video. Although video games are described as one possible implementation, the basic principles of the present invention can be used for any form of application that requires graphics processing resources (e.g., graphic design applications, interactive and non-interactive ray tracing applications, productivity software, video editing software, etc.).
[0203] Apparatus and method for allocating tile cache between virtual machines and applications
[0204] In one embodiment, a tile cache is used to store tile data used for 3D rendering. A "tile" may be a graphics tile used for tile-based rendering techniques (such as tile-based immediate mode rendering). Different applications / VMs may share a single tile cache within the GPU. This may be problematic when one VM / application consumes a larger portion of the tile cache than it should.
[0205] One embodiment of the present invention allows for different priorities to be assigned to VMs or applications with respect to allocation of tile cache to ensure that higher priority applications are guaranteed tile cache storage ahead of lower priority applications.
[0206] Fig. 20 The figure shows an embodiment in which two different applications and / or VMs are running - app0 / VM0 and app1 / VM1. Of course, embodiments of the present invention may include more than two apps / VMs. Each of the apps / VMs may be running a 3D application that streams 3D commands through a command streamer 2001. In particular, each app / VM may have its own command queue to which it sends commands that are then processed by the command streamer 2001. In the illustrated embodiment, the tile cache allocation module 2002 allocates a portion of the tile cache 2012 to each app / VM based on the relative priority associated with the app / VM. In the illustrated embodiment, the first region 2020 is allocated to app0 / VM0 and the second region 2021 is allocated to app1 / VM1. The size of each region 2020-2021 can be allocated based on the relative priority of app0 / VM0 and app1 / VM1. For example, if app1 / VM1 is assigned a lower priority than app0 / VM0, it will be assigned a relatively smaller portion of the tile cache 2012. Priorities may be specified with integer values from 1 (lowest priority) to 4 (highest priority). Thus, if app0 / VM0 is assigned a priority of 4 and app1 / VM1 is assigned a priority of 1, app0 / VM0 may be assigned 80% (4 / 5) of the tile cache 2012 and app1 / VM1 may be assigned the remaining 20% (1 / 5).
[0207] In one embodiment, a tile cache memory region 2041 is defined within the system memory as an overflow region. If an app / VM requires more space than is allocated in the tile cache 2012, the data overflows to the tile cache memory region 2041. This can be implemented in a manner that is transparent to the end user. For example, upon receiving a request for data stored in the tile cache 2012, the tile cache allocation module 2002 can determine whether the requested data is in the tile cache 2012 or in the tile cache region 2041 in the system memory 2040. If in the system memory 2040, it can perform a virtual to physical address translation to locate the physical address in the system memory 2040 (or hand off the memory request to the memory controller). In one embodiment, the tile cache 2012 is 4-8 megabytes, but the underlying principles of the invention are not limited to any particular size for the tile cache.
[0208] In one embodiment, the priority can be set based on the type of app / VM. For example, if a particular 3D app requires very low latency (e.g., an interactive 3D game), the highest priority available can be assigned to this 3D app. Conversely, if the 3D app is non-interactive and does not require the same low latency, a relatively lower priority can be assigned to this app. Additionally, the priority can be set based on whether the app is a foreground app or a background app (e.g., providing a higher priority to a foreground app).
[0209] The techniques described herein prevent a particular application or VM from monopolizing the entire tile cache at the expense of another application or VM. Using these techniques, each application or VM will be allocated a specific portion of the tile cache. When this portion is consumed, data will overflow to the designated memory area.
[0210] exist Fig.21 The method according to one embodiment of the present invention is illustrated in FIG. The method can be implemented within the context of the graphics processing architecture described herein, but is not limited to any particular architecture.
[0211] At 2101, the priority of each of the different Apps / VMs that share the tile cache is determined. At 2102, tile cache regions are allocated based on the relative priority of each of the Apps / VMs. If a particular region becomes full, as determined at 2103, the excess tile data will overflow into system memory at 2104. In either case, the process returns to 2101 to determine whether a new App / VM has been launched and whether a new priority-based reallocation is required.
[0212] Power supply in virtualized graphics environments
[0213] Hardware entities such as functional units, graphics engines, or slices are assigned to separate VMs. In one embodiment, the power management unit independently controls the voltage and / or frequency provided to each of the hardware entities according to the VM to which the hardware entity is assigned. Thus, in addition to assigning slices to VMs to adjust performance, the voltage / frequency provided to a slice (or a separate component included in a slice) may also be dynamically adjusted (e.g., voltage / frequency may be increased to improve performance).
[0214] Fig. 22 A particular embodiment is shown that includes a common hardware component 2200 shared by all VMs and separate hardware entities 2210 that are individually assigned to different VMs. For example, the common hardware component 2200 may include a memory controller, potentially with one or more cache layers and a TLB shared by the hardware entity 2210. As mentioned, the hardware entity 2210 may include circuits and / or logic at various levels of granularity, such as a slice, a graphics engine, or a functional unit. For example, the hardware entity may include an instruction fetch / decode unit; an instruction scheduler; an execution unit; an individual functional unit within an execution unit; an L1, L2, or L3 cache; a traversal unit; a sampler; a media unit; a register allocation unit; or a retirement / reorder unit, to name a few examples.
[0215] In one embodiment, once the hardware entity 2210 is assigned to a separate VM, the performance of the hardware entity can be controlled by the power / performance management unit 2205. For example, the power / performance management unit 2205 can individually adjust the voltage / frequency provided to each of the hardware entities 2210. In one embodiment, dynamic voltage and frequency locking is performed, the frequency is controlled by a digital phase-locked loop (DPLL), and the operating voltage is regulated by an integrated voltage regulator module (IVRM). Each hardware entity 2210 can have its own voltage regulation module and a set of DPLLs controlled by the power / performance management unit 2205. The power / performance management unit 2205 can adjust the voltage / frequency based on the VM assigned to each hardware entity 2210 and the priority associated with each VM. For example, the power / performance management unit 2205 can allocate a higher voltage / frequency to a VM requiring relatively high performance and allocate a lower voltage / frequency to a VM operating at relatively low performance. A power budget can be established on the GPS chip, and the power / performance management unit 2205 will adjust the voltage / frequency to keep the GPU within its specified power budget.
[0216] In addition, as in Fig. 22As illustrated in , the power / performance management unit 2205 can adjust the voltage / frequency based on monitoring data collected from each of the hardware entities 2210. For example, the temperature can be read from each of the hardware entities 2210, and performance data can be collected from performance counters throughout the hardware entities 2210. If the temperature of a particular hardware entity is above, for example, a specified threshold, the power / performance management unit 2205 can reduce the voltage / frequency provided to this entity. Likewise, if the performance data indicates that a particular entity is overloaded (e.g., because an internal queue is full), it can increase the voltage / frequency to that hardware entity 2210 so that the hardware entity 2210 can perform its operations more efficiently.
[0217] The power / performance management entity 2205 tracks the hardware entities 2210 allocated to each of the VMs and thus tracks power consumption at the VM level. Pre-provisioning limits on power consumption (voltage and therefore frequency) may be enforced by the power / performance management hardware 2205 on each of the VMs.
[0218] exist Fig.23 The method according to one embodiment of the present invention is illustrated in FIG. The method can be implemented within the context of the graphics processing architecture described herein, but is not limited to any particular architecture.
[0219] At 2301, an initial allocation of hardware entities to VMs is performed based on the priority and / or processing requirements of the VMs (or applications executed on the VMs). At 2302, the voltage / frequency provided to each of the hardware entities is independently set based on the priority and / or processing requirements of the allocated VMs. At 2303, monitoring is performed by collecting the temperature reported by the temperature sensor and the performance data from the performance counters distributed between each hardware entity. In addition, any changes to the priority and / or processing requirements of the VMs or each VM are detected. If it is determined at 2304 that a change is detected or one or more thresholds are reached, the voltage / frequency is adjusted and / or the hardware entities are reallocated across the VMs according to the detected changes at 2306. For example, if the GPU exceeds its power budget or if the temperature is above a threshold, the voltage / frequency of all hardware entities or a subset thereof can be reduced. Similarly, if the processing requirements or priority of the VMs have changed, the number of slices allocated to the VM can be adjusted. As another example, if the performance counter indicates that a particular hardware entity is overloaded, the work can be offloaded to another hardware entity. Various adjustments can be made at 2306 according to the underlying principles of the present invention. If no changes or thresholds are detected, then at 2305 the existing voltage / frequency assignments and existing assignments of hardware entities to VMs are maintained.
[0220] Virtualizing Shared Local Memory (SLM)
[0221] Shared Local Memory (SLM) is a small local memory (e.g., 1-2MB) utilized by functional units within the GPU. The SLM is not accessible within the system address space and is not part of the cache hierarchy used by the GPU. Since the SLM is not virtualized today, one VM or application may consume the entire SLM, degrading the performance of other VMs / applications.
[0222] One embodiment of the present invention virtualizes the SLM and intelligently allocates portions of the SLM to different virtual machines (VMs) or applications. This embodiment includes techniques to allow portions of data to overflow from each VM into system memory when the VM-allocated portion of the SLM is full. In one implementation, the thread scheduler within the GPU allocates less than the entire SLM, but informs the VM or application that it has been given the total amount. It will then allocate a portion of the space from the SLM to the VM / application, spilling the remainder into system memory in a manner that is transparent to the VM or application.
[0223] Fig.24 The diagram shows one embodiment where two VMs (VM0 and VM1) compete for storage of the SLM 2412 within the GPU 2411. If both VMs request the full SLM space (e.g., 1MB), one embodiment of the SLM controller 2432 will share the SLM between the two VMs (e.g., giving 512kB to each) and spill the rest into the virtual SLM storage 2441 in the system memory 2440 (potentially hitting the L3 cache 2438). In most cases, the VMs will not use most of the space in the SLM, so accesses to the system memory 2440 will occur infrequently.
[0224] In one embodiment, thread scheduler 2435 and / or SLM controller 2432 tracks those portions of SLM space that are in SLM 2412 and those portions that overflow into system memory 2440. As a result of these techniques, thread dispatching performed by thread scheduler 2435 will not stall as in current implementations.
[0225] In one embodiment, when a request is received from a VM, the SLM controller 2432 checks to determine whether the request will be provided to the actual SLM 2432 or will overflow to the SLM area 2441 in the system memory 2440. If the data is in the SLM area 2441, the conversion circuitry and / or logic within the SLM controller 2432 converts and redirects the request to the system memory address required to access the virtual SLM space 2441.
[0226] In one embodiment, VM1 accesses its portion of system memory by specifying a different base address than that used by VM2. This base address is then combined with an offset to identify the data in SLM 2412. If stored in SLM area 2441 in system memory 2440, SLM controller 2432 will translate the request into the required system memory address. For example, the base+offset combination may point to an address in SLM 2412 that is not assigned to a VM, and SLM controller 2432 will map the base+offset value to the appropriate system address.
[0227] Although the SLM controller 2432 may evenly distribute the SLMs 2412 among the VMs as described above, in embodiments where the VMs are assigned different priorities, the SLM controller 2432 may distribute a larger portion of the SLMs 2412 to the VMs with higher priorities. For example, if VM0 has a priority of 1 (the highest priority) and VM1 has a priority of 3, the SLM 2412 may distribute ¼ of the SLM to VM1 and ¾ to VM0 (i.e., 1 / 3+1 and 3 / 3+1). Of course, the SLMs 2412 may be distributed to VMs with different priorities in a variety of ways while still being consistent with the underlying principles of the invention.
[0228] exist Fig.28 The method according to one embodiment of the present invention is illustrated in FIG. The method can be implemented within the context of the graphics processing architecture described herein, but is not limited to any particular architecture.
[0229] At 2801, SLMs are allocated among multiple VMs. As discussed above, this may involve allocating SLMs equally among the VMs or allocating SLMs according to the relative priorities of the VMs. In response to an SLM request from one of the VMs that includes a base / offset combination, a determination is made at 2803 as to whether the data is stored in the SLM or in system memory. If the data is stored in the SLM, then at 2804, the SLM is accessed using the base / offset. If not, then at 2805, the base / offset is converted to a system memory address (e.g., within a system memory range allocated to store overflow from the SLM).
[0230] Memory structure supply
[0231] In one embodiment, the memory structure in a virtualized GPU implementation is shared by various graphics processing resources in the GPU (e.g., EUs, samplers, shader data ports, etc.), and is also shared by all VMs in the virtualized environment. Dynamic memory structure provisioning logic allocates a portion of the memory structure bandwidth to each of these resources based on the specific VM for which the resource is performing its function.
[0232] Fig.26 The diagram illustrates one implementation in which various resources within a GPU 2610, including EUs 2610, pixel shaders 2611, samplers 2612, and data ports 2613, are shared among multiple virtual machines 2660-2661 via a hypervisor 2655. For example, a first set of EUs 2610 may be processing graphics data for VM 2660 while a second set is processing graphics data for VM 2661. Each of the resources 2610-2613 and VMs 2660-2661 compete for use of a memory structure 2630 that couples all system components to a cache hierarchy 2620 and system memory 2630. While in Fig.26 A particular set of resources 2610 - 2613 is shown in the figure, but any collection or grouping of resources (such as slices or individual functional units, for example) may be used to implement the underlying principles of the invention.
[0233] In one embodiment, dynamic memory structure allocation logic 2600 allocates usage of memory structures to each of GPU resources 2610-2613 based on the VM for which each resource is performing work. For example, in a simple case where each VM is assigned the same priority, dynamic memory structure allocation module 2600 allocates 50% of usage of memory structure 2630 to VM 2660 and 50% to VM 2661. Alternatively, if VM 2660 is assigned a higher priority than VM 2661, dynamic memory structure allocation module 2600 will allocate relatively more cycles on memory structure 2630 to VM 2660.
[0234] In one embodiment, counter 2650 may be programmed by hypervisor 2655 to implement priority-based allocation. For example, if VM 2660 is assigned a priority of 5 and VM 2661 is assigned a priority of 2, the counter may be initially set to 5 for VM 2660 and decremented for each transaction associated with VM 2660 on memory structure 2630. Once the counter reaches a value of 0, another counter (or the same counter) may be set to a value of 2 for VM 2661 and will decrement as VM 2661 uses the memory structure until it reaches 0. The first counter will then be reset to 5 and the process continues. In this example, VM 2661 is allocated 2 cycles of memory structure 2630 for every 5 cycles allocated to VM 2660. In this manner, VM 2660 is allocated a portion of the memory structure based on its priority relative to VM 2661. Relative priority may be implemented in a variety of different ways.
[0235] The counter may be decremented in response to various events associated with the use of the memory structure 2630. For example, the counter may be decremented at the end of a specified time period (e.g., microsecond blocks) or after a certain number of transactions or operations have progressed through the memory structure 2630. A minimum memory structure allocation may be specified so that each resource 2610-2613 is allocated a sufficient portion of the memory structure 2630.
[0236] exist Fig. 27 The method according to one embodiment of the present invention is illustrated in FIG. The method can be implemented within the context of the graphics processing architecture described herein, but is not limited to any particular architecture.
[0237] Priorities associated with different VMs executed by the graphics processing resource are identified at 2701. In one embodiment, this is accomplished using a VM / context ID associated with each VM and identifying a priority associated with the VM / context ID. Priorities may be adjusted statically based on the quality of service guaranteed for a particular user and / or may be adjusted dynamically based on the workload submitted by each VM.
[0238] At 2702, a counter value is programmed according to the relative priority of each VM running on the system (as in the specific example provided above). At 2703, a variable N is set to 0. At 2704, a counter value is programmed according to the relative priority of each VM running on the system (as in the specific example provided above). N The associated graphics processing resource allocation memory structure (initially VM0 for N=0). At 2705, the usage of the memory structure will be associated with VM N Associated COUNTER N As mentioned above, the counter is decremented after one or more blocks of cycles have passed, after one or more transactions have been completed, or after a specified block of time has passed. When COUNTER is determined at 2706 N When 0 is reached, then a determination is made at 2707 as to whether this is the last VM to be serviced. If not, then at 2708 the value of N is incremented and a request is made to the next VM (e.g., VM N+1 ) is allocated a memory structure for graphics processing resources associated with the first VM. Once it is determined at 2707 that the last VM has been serviced, a determination is made at 2709 as to whether any VM priorities have changed. If not, the process returns to 2703 and the graphics processing resources currently associated with the first VM are again provided access to the memory structure. If so, the process returns to 2702 where a new program counter value is stored according to the new relative priority.
[0239] The end result of these embodiments is that each VM is allocated access to the memory structure according to its assigned priority, thereby ensuring fair access to all VMs based on priority.
[0240] In some embodiments, a graphics processing unit (GPU) is communicatively coupled to a host / processor core to accelerate graphics operations, machine learning operations, pattern analysis operations, and various general-purpose GPU (GPGPU) functions. The GPU can be communicatively coupled to the host processor / core via a bus or another interconnect (e.g., a high-speed interconnect such as PCIe or NVLink). In other embodiments, the GPU can be integrated on the same package or chip as the core and communicatively coupled to the core via an internal processor bus / interconnect (i.e., inside the package or chip). Regardless of the manner in which the GPU is connected, the processor core can assign work to the GPU in the form of a sequence of commands / instructions contained in a work descriptor. The GPU then uses dedicated circuits / logic to efficiently process these commands / instructions.
[0241] In the following description, a large number of specific details are set forth to provide a more thorough explanation. However, it will be apparent to those skilled in the art that the embodiments described herein may be practiced without one or more of these specific details. In other cases, well-known features are not described to avoid obscuring the details of embodiments of the present invention.
[0242] System Overview
[0243] Fig.28 2800 is a block diagram illustrating a computing system 2800 configured to implement one or more aspects of the embodiments described herein. The computing system 2800 includes a processing subsystem 2801 having one or more processors 2802 and a system memory 2804, the one or more processors and the system memory communicating via an interconnect path, which may include a memory hub 2805. The memory hub 2805 may be a separate component within a chipset component, or may be integrated within the one or more processors 2802. The memory hub 2805 is coupled to an I / O subsystem 2811 via a communication link 2806. The I / O subsystem 2811 includes an I / O hub 2807, which may enable the computing system 2800 to receive input from one or more input devices 2808. In addition, the I / O hub 2807 may enable a display controller (which may be included in the one or more processors 2802) to provide output to one or more display devices 2810A. In one embodiment, the one or more display devices 2810A coupled to the I / O hub 2807 may include a local display device, an internal display device, or an embedded display device.
[0244] In one embodiment, the processing subsystem 2801 includes one or more parallel processors 2812, which are coupled to the memory hub 2805 via a bus or other communication link 2813. The communication link 2813 can be one of any number of standard-based communication link technologies or protocols (such as but not limited to PCI Express), or can be a vendor-specific communication interface or communication structure. In one embodiment, the one or more parallel processors 2812 form a computationally concentrated parallel or vector processing system that includes a large number of processing cores and / or processing clusters such as integrated many-core (MIC) processors. In one embodiment, the one or more parallel processors 2812 form a graphics processing subsystem that can output pixels to one of the one or more display devices 2810A coupled via the I / O hub 2807. The one or more parallel processors 2812 may also include a display controller and display interface (not shown) to enable direct connection to one or more display devices 2810B.
[0245] Within the I / O subsystem 2811, a system storage unit 2814 may be connected to the I / O hub 2807 to provide a storage mechanism for the computing system 2800. The I / O switch 2816 may be used to provide an interface mechanism to enable connection between the I / O hub 2807 and other components that may be integrated into the platform, such as a network adapter 2818 and / or a wireless network adapter 2819, as well as various other devices that may be added via one or more plug-in devices 2820. The network adapter 2818 may be an Ethernet adapter or another wired network adapter. The wireless network adapter 2819 may include one or more of Wi-Fi, Bluetooth, near field communication (NFC), or other network devices including one or more wireless radio components.
[0246] The computing system 2800 may include other components not explicitly shown, including USB or other port connections, optical storage drivers, video capture devices, etc., which may also be connected to the I / O hub 2807. Fig.28 The communication paths interconnecting the various components may be implemented using any suitable protocol such as a PCI (Peripheral Component Interconnect) based protocol (e.g., PCI-Express), or any other bus or point-to-point communication interface(s) and / or protocol such as the NV-Link high-speed interconnect or an interconnect protocol known in the art.
[0247] In one embodiment, one or more parallel processors 2812 are incorporated into circuits optimized for graphics and video processing, including, for example, video output circuits, and the circuits constitute a graphics processing unit (GPU). In another embodiment, one or more parallel processors 2812 are incorporated into circuits optimized for general-purpose processing while retaining the basic computing architecture described in more detail herein. In yet another embodiment, the components of the computing system 2800 can be integrated with one or more other system elements on a single integrated circuit. For example, one or more parallel processors 2812, a memory hub 2805, (one or more) processors 2802, and an I / O hub 2807 can be integrated into a system-on-chip (SoC) integrated circuit. Alternatively, the components of the computing system 2800 can be integrated into a single package to form a system-in-package (SIP) configuration. In one embodiment, at least a portion of the components of the computing system 2800 can be integrated into a multi-chip module (MCM), which can be interconnected with other multi-chip modules to form a modular computing system.
[0248] It should be understood that the computing system 2800 shown herein is illustrative and variations and modifications are possible. The connection topology can be modified as needed, including the number and arrangement of bridges, the number of (one or more) processors 2802, and the number of (one or more) parallel processors 2812. For example, in some embodiments, the system memory 2804 is directly connected to the (one or more) processors 2802 rather than through a bridge, and other devices communicate with the system memory 2804 via the memory hub 2805 and the (one or more) processors 2802. In other alternative topologies, (one or more) parallel processors 2812 are connected to the I / O hub 2807 or directly to one of the one or more processors 2802, rather than to the memory hub 2805. In other embodiments, the I / O hub 2807 and the memory hub 2805 can be integrated into a single chip. Some embodiments may include two or more groups of (one or more) processors 2802 attached via multiple sockets, which can be coupled to two or more instances of (one or more) parallel processors 2812.
[0249] Some specific components shown herein are optional and may not be included in all embodiments of computing system 2800. For example, any number of add-in cards or peripheral devices may be supported, or some components may be omitted. In addition, some architectures may be specific to the Fig.28 Different terminology is used for components that are similar to the components shown. For example, in some architectures, the memory hub 2805 may be referred to as a north bridge, while the I / O hub 2807 may be referred to as a south bridge.
[0250] Fig.29A The parallel processor 2900 according to an embodiment is illustrated. The various components of the parallel processor 2900 may be implemented using one or more integrated circuit devices such as a programmable processor, an application specific integrated circuit (ASIC), or a field programmable gate array (FPGA). According to an embodiment, the illustrated parallel processor 2900 is Fig.28 A variation of one or more parallel processors 2812 shown in .
[0251] In one embodiment, parallel processor 2900 includes parallel processing unit 2902. The parallel processing unit includes an I / O unit 2904, which enables communication with other devices (which include other instances of parallel processing unit 2902). I / O unit 2904 can be directly connected to other devices. In one embodiment, I / O unit 2904 is connected to other devices via the use of a hub or switch interface such as memory hub 2805. The connection between memory hub 2805 and I / O unit 2904 forms a communication link 2813. Within parallel processing unit 2902, I / O unit 2904 is connected to host interface 2906 and memory cross switch 2916, wherein host interface 2906 receives commands related to performing processing operations and memory cross switch 2916 receives commands related to performing memory operations.
[0252] When the host interface 2906 receives the command buffer via the I / O unit 2904, the host interface 2906 can direct the work operations for executing these commands to the front end 2908. In one embodiment, the front end 2908 is coupled with a scheduler 2910, which is configured to distribute commands or other work items to the processing cluster array 2912. In one embodiment, the scheduler 2910 ensures that the processing cluster array 2912 is correctly configured and in a valid state before distributing tasks to the processing clusters of the processing cluster array 2912. In one embodiment, the scheduler 2910 is implemented via firmware logic executed on a microcontroller. The microcontroller-implemented scheduler 2910 can be configured to perform complex scheduling and work distribution operations at coarse and fine granularity, thereby achieving fast preemption and context switching of threads executed on the processing array 2912. In one embodiment, the host software can prove the workload for scheduling on the processing array 2912 via one of a plurality of graphics processing doorbells. The workload can then be automatically distributed in the processing array 2912 by the scheduler 2910 logic within the scheduler microcontroller.
[0253] Processing cluster array 2912 may include up to "N" processing clusters (e.g., cluster 2914A, cluster 2914B, up to cluster 2914N). Each cluster 2914A to 2914N of processing cluster array 2912 may execute a large number of concurrent threads. Scheduler 2910 may use various scheduling and / or work distribution algorithms to allocate work to clusters 2914A to 2914N of processing cluster array 2912, which may vary depending on the workload caused by each type of program or calculation. Scheduling may be handled dynamically by scheduler 2910, or may be partially assisted by compiler logic in the process of compiling program logic configured to be executed by processing cluster array 2912. In one embodiment, different clusters 2914A to 2914N of processing cluster array 2912 may be allocated to process different types of programs or to perform different types of calculations.
[0254] Processing cluster array 2912 can be configured to perform various types of parallel processing operations. In one embodiment, processing cluster array 2912 is configured to perform general parallel computing operations. For example, processing cluster array 2912 may include logic for performing processing tasks (including filtering of video and / or audio data), performing modeling operations (including physical operations), and performing data transformations.
[0255] In one embodiment, the processing cluster array 2912 is configured to perform parallel graphics processing operations. In embodiments where the parallel processor 2900 is configured to perform graphics processing operations, the processing cluster array 2912 may include additional logic for supporting the execution of such graphics processing operations, including but not limited to texture sampling logic for performing texture operations and tessellation logic and other vertex processing logic. In addition, the processing cluster array 2912 may be configured to execute shader programs associated with graphics processing, such as but not limited to vertex shaders, tessellation shaders, geometry shaders, and pixel shaders. The parallel processing unit 2902 may transfer data from the system memory via the I / O unit 2904 for processing. During processing, the transferred data may be stored in an on-chip memory (e.g., parallel processor memory 2922) during processing and then written back to the system memory.
[0256] In one embodiment, when the parallel processing unit 2902 is used to perform graphics processing, the scheduler 2910 can be configured to divide the processing workload into tasks of approximately equal size to better enable the distribution of graphics processing operations to multiple clusters 2914A to 2914N of the processing cluster array 2912. In some embodiments, portions of the processing cluster array 2912 can be configured to perform different types of processing. For example, a first portion can be configured to perform vertex shading and topology generation, a second portion can be configured to perform tessellation and geometry shading, and a third portion can be configured to perform pixel shading or other screen space operations to generate a rendered image for display. Intermediate data generated by one or more of the clusters 2914A to 2914N can be stored in a buffer to allow the intermediate data to be transferred between the clusters 2914A to 2914N for further processing.
[0257] During operation, the processing cluster array 2912 may receive processing tasks to be executed via the scheduler 2910, which receives commands defining the processing tasks from the front end 2908. For graphics processing operations, a processing task may include data to be processed, such as surface (patch) data, primitive data, vertex data, and / or pixel data, as well as state parameters and commands (e.g., which program to execute) that define how the data is to be processed. The scheduler 2910 may be configured to obtain an index corresponding to a task or may receive an index from the front end 2908. The front end 2908 may be configured to ensure that the processing cluster array 2912 is configured to a valid state before a workload specified by an incoming command buffer (e.g., a batch buffer, a push buffer, etc.) is initiated.
[0258] Each of the one or more instances of the parallel processing unit 2902 may be coupled to a parallel processor memory 2922. The parallel processor memory 2922 may be accessed via a memory crossbar switch 2916, which may receive memory requests from the processing cluster array 2912 and the I / O unit 2904. The memory crossbar switch 2916 may access the parallel processor memory 2922 via a memory interface 2918. The memory interface 2918 may include a plurality of partition units (e.g., partition unit 2920A, partition unit 2920B, up to partition unit 2920N), which may each be coupled to a portion (e.g., memory unit) of the parallel processor memory 2922. In one embodiment, the number of partition units 2920A to 2920N is configured to be equal to the number of memory units, such that a first partition unit 2920A has a corresponding first memory unit 2924A, a second partition unit 2920B has a corresponding memory unit 2924B, and an Nth partition unit 2920N has a corresponding Nth memory unit 2924N. In other embodiments, the number of partition units 2920A to 2920N may not be equal to the number of memory devices.
[0259] In various embodiments, the memory units 2924A to 2924N may include various types of memory devices, including dynamic random access memory (DRAM) or graphics random access memory, such as synchronous graphics random access memory (SGRAM), including graphics double data rate (GDDR) memory. In one embodiment, the memory units 2924A to 2924N may also include 3D stacked memory, including but not limited to high bandwidth memory (HBM). Those skilled in the art will appreciate that the specific implementation of the memory units 2924A to 2924N may vary and may be selected from one of a variety of conventional designs. Rendering targets such as frame buffers or texture maps may be stored on the memory units 2924A to 2924N, allowing the partition units 2920A to 2920N to write to portions of each rendering target in parallel to efficiently use the available bandwidth of the parallel processor memory 2922. In some embodiments, in order to support a unified memory design that utilizes system memory together with local cache memory, the local instance of the parallel processor memory 2922 may be excluded.
[0260] In one embodiment, any of the clusters 2914A to 2914N of the processing cluster array 2912 can process data to be written to any of the memory units 2924A to 2924N within the parallel processor memory 2922. The memory crossbar 2916 can be configured to transmit the output of each cluster 2914A to 2914N to any partition unit 2920A to 2920N or another cluster 2914A to 2914N, which can perform additional processing operations on the output. Each cluster 2914A to 2914N can communicate with a memory interface 2918 through the memory crossbar 2916 to read from or write to various external memory devices. In one embodiment, memory crossbar switch 2916 has connections to memory interface 2918 to communicate with I / O unit 2904, and to local instances of parallel processor memory 2922, thereby enabling processing units within different processing clusters 2914A through 2914N to communicate with system memory or other memory that is not local to parallel processing unit 2902. In one embodiment, memory crossbar switch 2916 may use virtual channels to separate traffic flows between clusters 2914A through 2914N and partition units 2920A through 2920N.
[0261] Although a single instance of parallel processing unit 2902 is illustrated as being within parallel processor 2900, any number of instances of parallel processing unit 2902 may be included. For example, multiple instances of parallel processing unit 2902 may be provided on a single add-in card, or multiple add-in cards may be interconnected. Different instances of parallel processing unit 2902 may be configured to interoperate even if different instances have different numbers of processing cores, different amounts of local parallel processor memory, and / or other configuration differences. For example, and in one embodiment, some instances of parallel processing unit 2902 may include higher precision floating point units relative to other instances. Systems incorporating one or more instances of parallel processing unit 2902 or parallel processor 2900 may be implemented in various configurations and form factors, including but not limited to desktop computers, laptop computers or handheld personal computers, servers, workstations, game consoles, and / or embedded systems.
[0262] Fig.29B is a block diagram of a partition unit 2920 according to an embodiment. In one embodiment, the partition unit 2920 is Fig.29A29 . As illustrated, the partition unit 2920 includes an L2 cache 2921, a frame buffer interface 2925, and an ROP 2926 (raster operation unit). The L2 cache 2921 is a read / write cache configured to perform load and store operations received from the memory crossbar switch 2916 and the ROP 2926. Read misses and emergency write-back requests are output by the L2 cache 2921 to the frame buffer interface 2925 for processing. Updates may also be sent to the frame buffer via the frame buffer interface 2925 for processing. In one embodiment, the frame buffer interface 2925 interfaces with one of the memory units in the parallel processor memory, such as the memory units 2924A to 2924N of FIG. 29 (e.g., within the parallel processor memory 2922).
[0263] In graphics applications, ROP 2926 is a processing unit that performs raster operations such as stenciling, z-testing, blending, etc. ROP 2926 then outputs the processed graphics data stored in graphics memory. In some embodiments, ROP 2926 includes compression logic that compresses depth or color data written to memory and decompresses depth or color data read from memory. The compression logic can be lossless compression logic that uses one or more of a variety of compression algorithms. The type of compression performed by ROP 2926 can vary depending on the statistical characteristics of the data to be compressed. For example, in one embodiment, incremental color compression is performed on depth and color data on a per-tile basis.
[0264] In some embodiments, ROP 2926 is included within each processing cluster (e.g., clusters 2914A to 2914N of FIG. 29 ) rather than within partition unit 2920. In such embodiments, read and write requests for pixel data are transmitted through memory crossbar 2916 rather than pixel fragment data. The processed graphics data may be displayed on a display device such as Fig.28 to one of the one or more display devices 2810, is routed for further processing by the processor(s) 2802, or is routed for processing by the Fig.29A further processed by one of the processing entities within parallel processor 2900.
[0265] Fig.29C29. It is a block diagram of a processing cluster 2914 within a parallel processing unit according to an embodiment. In one embodiment, the processing cluster is an instance of one of the processing clusters 2914A to 2914N of FIG. 29. The processing cluster 2914 can be configured to execute multiple threads in parallel, wherein the term "thread" refers to an instance of a specific program executed on a specific input data set. In some embodiments, a single instruction multiple data (SIMD) instruction issuance technique is used to support the parallel execution of a large number of threads without providing multiple independent instruction units. In other embodiments, a single instruction multiple thread (SIMT) technique is used to support the parallel execution of a large number of roughly synchronized threads using a common instruction unit configured to issue instructions to a group of processing engines within each of the processing clusters. Unlike the SIMD execution mechanism in which all processing engines generally execute the same instruction, SIMT execution allows different threads to more easily follow the divergent execution path through a given thread program. It will be appreciated by those skilled in the art that the SIMD processing mechanism represents a functional subset of the SIMT processing mechanism.
[0266] The operation of the processing cluster 2914 can be controlled via a pipeline manager 2932 that distributes processing tasks to the SIMT parallel processor. The pipeline manager 2932 receives instructions from the scheduler 2910 of Figure 29 and manages the execution of those instructions via the graphics multiprocessor 2934 and / or the texture unit 2936. The illustrated graphics multiprocessor 2934 is an exemplary instance of a SIMT parallel processor. However, various types of SIMT parallel processors of different architectures can be included in the processing cluster 2914. One or more instances of the graphics multiprocessor 2934 can be included in the processing cluster 2914. The graphics multiprocessor 2934 can process data, and the data crossbar switch 2940 can be used to distribute the processed data to one of multiple possible destinations including other shading units. The pipeline manager 2932 can promote the distribution of processed data by specifying a destination for the processed data to be distributed via the data crossbar switch 2940.
[0267] Each graphics multiprocessor 2934 within a processing cluster 2914 may include the same set of function execution logic (e.g., arithmetic logic units, load store units, etc.). The function execution logic may be configured in a pipelined manner, where a new instruction may be issued before a previous instruction is completed. The function execution logic supports a variety of operations, including integer and floating point arithmetic, comparison operations, Boolean operations, bit shifts, and calculations of various algebraic functions. In one embodiment, the same functional unit hardware may be utilized to perform different operations, and any combination of functional units may exist.
[0268] The instructions transmitted to the processing cluster 2914 constitute threads. A group of threads executed on the group of parallel processing engines is a thread group. The thread group executes the same program on different input data. Each thread in the thread group can be assigned to a different processing engine in the graphics multiprocessor 2934. The thread group can include fewer threads than the number of processing engines in the graphics multiprocessor 2934. When the thread group includes fewer threads than the number of processing engines, one or more of the processing engines may be idle during the cycle of processing the thread group. The thread group can also include more threads than the number of processing engines in the graphics multiprocessor 2934. When the thread group includes more threads than the number of processing engines in the graphics multiprocessor 2934, processing can be performed on consecutive clock cycles. In one embodiment, multiple thread groups can be executed simultaneously on the graphics multiprocessor 2934.
[0269] In one embodiment, the graphics multiprocessor 2934 includes an internal cache memory for performing load and store operations. In one embodiment, the graphics multiprocessor 2934 can abandon the internal cache and use the cache memory (e.g., L1 cache 308) within the processing cluster 2914. Each graphics multiprocessor 2934 can also access the L2 cache within the partition unit (e.g., partition unit 2920A to 2920N of Figure 29) shared between all processing clusters 2914, and can be used to transfer data between threads. The graphics multiprocessor 2934 can also access off-chip global memory, which can include one or more of the local parallel processor memory and / or system memory. Any memory outside the parallel processing unit 2902 can be used as global memory. In which the processing cluster 2914 includes multiple instances of the graphics multiprocessor 2934, the embodiment can share common instructions and data that can be stored in the L1 cache 308.
[0270] Each processing cluster 2914 may include an MMU 2945 (memory management unit) configured to map virtual addresses to physical addresses. In other embodiments, one or more instances of the MMU 2945 may reside within the memory interface 2918 of FIG. 29 . The MMU 2945 includes a set of page table entries (PTEs) for mapping virtual addresses to physical addresses of tiles (more referred to as tiles) and optionally cache line indexes. The MMU 2945 may include an address translation lookaside buffer (TLB) or cache that may reside within the graphics multiprocessor 2934 or L1 cache or processing cluster 2914. Physical addresses are processed to distribute surface data access locality to allow efficient request interleaving between partition units. The cache line index may be used to determine whether a request for a cache line is a hit or a miss.
[0271] In graphics and computing applications, the processing cluster 2914 can be configured so that each graphics multiprocessor 2934 is coupled to a texture unit 2936 to perform texture mapping operations, such as determining texture sample locations, reading texture data, and filtering texture data. The texture data is read from an internal texture L1 cache (not shown) or in some embodiments from an L1 cache within the graphics multiprocessor 2934, and is obtained from an L2 cache, a local parallel processor memory, or a system memory as needed. Each graphics multiprocessor 2934 outputs a processed task to a data crossbar 2940 to provide the processed task to another processing cluster 2914 for further processing or to store the processed task in an L2 cache, a local parallel processor memory, or a system memory via a memory crossbar 2916. The preROP 2942 (pre-raster operation unit) is configured to receive data from the graphics multiprocessor 2934 and direct the data to the ROP units, which can be located with partition units (e.g., partition units 2920A to 2920N of FIG. 29) as described herein. The preROP 2942 unit optimizes color blending, organizes pixel color data, and performs address translation.
[0272] It should be understood that the core architecture described herein is illustrative and variations and modifications are possible. Any number of processing units, such as graphics multiprocessors 2934, texture units 2936, preROPs 2942, etc., may be included in a processing cluster 2914. In addition, although only one processing cluster 2914 is shown, a parallel processing unit as described herein may include any number of instances of a processing cluster 2914. In one embodiment, each processing cluster 2914 may be configured to operate independently of other processing clusters 2914 using separate and distinct processing units, L1 caches, etc.
[0273] Fig.29D A graphics multiprocessor 2934 is shown according to one embodiment. In such an embodiment, the graphics multiprocessor 2934 is coupled to a pipeline manager 2932 of a processing cluster 2914. The graphics multiprocessor 2934 has an execution pipeline that includes, but is not limited to, an instruction cache 2952, an instruction unit 2954, an address mapping unit 2956, a register file 2958, one or more general purpose graphics processing unit (GPGPU) cores 2962, and one or more load / store units 2966. The GPGPU cores 2962 and the load / store units 2966 are coupled to a cache memory 2972 and a shared memory 2970 via a memory and cache interconnect 2968.
[0274] In one embodiment, the instruction cache 2952 receives a stream of instructions to be executed from the pipeline manager 2932. These instructions are cached in the instruction cache 2952 and dispatched for execution by the instruction unit 2954. The instruction unit 2954 can dispatch instructions as thread groups (e.g., warps), each thread of the thread group is assigned to a different execution unit within the GPGPU core 2962. Instructions can access any of the local, shared, or global address spaces by specifying an address within the unified address space. The address mapping unit 2956 can be used to convert addresses in the unified address space to different memory addresses that can be accessed by the load / store unit 2966.
[0275] The register file 2958 provides a set of registers for the functional units of the graphics multiprocessor 324. The register file 2958 provides temporary storage for operands for the data paths of the functional units (e.g., GPGPU core 2962, load / store unit 2966) connected to the graphics multiprocessor 324. In one embodiment, the register file 2958 is divided between each of the functional units so that each functional unit is allocated a dedicated portion of the register file 2958. In one embodiment, the register file 2958 is divided between the different warps being executed by the graphics multiprocessor 324.
[0276] The GPGPU cores 2962 may each include a floating point unit (FPU) and / or an integer arithmetic logic unit (ALU) for executing instructions of the graphics multiprocessor 324. Depending on the embodiment, the architecture of the GPGPU cores 2962 may be similar or different. For example, and in one embodiment, the first part of the GPGPU core 2962 includes a single-precision FPU and an integer ALU, while the second part of the GPGPU core includes a double-precision FPU. In one embodiment, the FPU may implement the IEEE 754-2008 floating-point arithmetic standard or enable variable-precision floating-point arithmetic. In addition, the graphics multiprocessor 324 may also include one or more fixed-function or special-function units for performing specific functions such as copying rectangles or pixel blending operations. In one embodiment, one or more of the GPGPU cores may also include fixed or special-function logic.
[0277] In one embodiment, the GPGPU core 2962 includes SIMD logic capable of executing a single instruction to multiple sets of data. In one embodiment, the GPGPU core 2962 can physically execute SIMD4, SIMD8 and SIMD16 instructions, and logically execute SIMD1, SIMD2 and SIMD32 instructions. SIMD instructions for the GPGPU core can be generated by a shader compiler at compile time, or automatically generated when executing a program written and compiled for a single program multiple data (SPMD) or SIMT architecture. Multiple threads of a program configured for a SIMT execution model can be executed via a single SIMD instruction. For example and in one embodiment, eight SIMT threads performing the same or similar operation can be executed in parallel via a single SIMD8 logic unit.
[0278] The memory and cache interconnect 2968 is an interconnect network that connects each of the functional units of the graphics multiprocessor 324 to the register file 2958 and the shared memory 2970. In one embodiment, the memory and cache interconnect 2968 is a crossbar interconnect that allows the load / store unit 2966 to implement load and store operations between the shared memory 2970 and the register file 2958. The register file 2958 can operate at the same frequency as the GPGPU core 2962, so data transfers between the GPGPU core 2962 and the register file 2958 have very low latency. The shared memory 2970 can be used to implement communication between threads executing on the functional units within the graphics multiprocessor 2934. For example, the cache memory 2972 can be used as a data cache to cache texture data transferred between the functional units and the texture unit 2936. The shared memory 2970 can also be used as a cached managed program. In addition to automatically cached data stored in cache memory 2972, threads executing on GPGPU core 2962 can also programmatically store data in shared memory.
[0279] FIG. 30A to FIG. 30B Additional graphics multiprocessors are illustrated according to an embodiment. The illustrated graphics multiprocessors 3025, 3050 are Fig.29C A variation of the graphics multiprocessor 2934. The illustrated graphics multiprocessors 3025, 3050 may be configured as streaming multiprocessors (SMs) capable of executing a large number of execution threads simultaneously.
[0280] Fig. 30A A graphics multiprocessor 3025 is shown according to an additional embodiment. The graphics multiprocessor 3025 includes Fig.29DThe graphics multiprocessor 3025 may include multiple additional instances of execution resource units of the graphics multiprocessor 2934. For example, the graphics multiprocessor 3025 may include multiple instances of instruction units 3032A to 3032B, register files 3034A to 3034B, and (one or more) texture units 3044A to 3044B. The graphics multiprocessor 3025 also includes multiple groups of graphics or compute execution units (e.g., GPGPU cores 3036A to 3036B, GPGPU cores 3037A to 3037B, GPGPU cores 3038A to 3038B) and multiple groups of load / store units 3040A to 3040B. In one embodiment, the execution resource unit has a common instruction cache 3030, texture and / or data cache memory 3042, and shared memory 3046.
[0281] Various components may communicate via the interconnect structure 3027. In one embodiment, the interconnect structure 3027 includes one or more crossbar switches that are used to enable communication between various components of the graphics multiprocessor 3025. In one embodiment, the interconnect structure 3027 is a separate high-speed network fabric layer on which each component of the graphics multiprocessor 3025 is stacked. Components of the graphics multiprocessor 3025 communicate with remote components via the interconnect structure 3027. For example, the GPGPU cores 3036A to 3036B, 3037A to 3037B, and 3078A to 3038B may all communicate with the shared memory 3046 via the interconnect structure 3027. The interconnect structure 3027 may arbitrate communications within the graphics multiprocessor 3025 to ensure fair bandwidth allocation between components.
[0282] Fig. 30B A graphics multiprocessor 3050 is shown according to an additional embodiment. Fig.29D and Fig. 30A As shown, the graphics processor includes multiple sets of execution resources 3056A-3056D, each of which includes multiple instruction units, register files, GPGPU cores, and load-store units. The execution resources 3056A-3056D can work with (one or more) texture units 3060A-3060D to perform texture operations while sharing an instruction cache 3054 and a shared memory 3062. In one embodiment, the execution resources 3056A-3056D can share multiple instances of the instruction cache 3054 and the shared memory 3062 as well as texture and / or data cache memories 3058A-3058B. The various components can be connected via Fig. 30A The interconnect structure 3027 communicates with a similar interconnect structure 3052 .
[0283] Those skilled in the art will understand that Fig.28 , FIG. 29A to FIG. 29D and FIG. 30A to FIG. 30B The architecture described in is illustrative and does not limit the scope of the embodiments of the present invention. Therefore, the techniques described herein can be implemented on any appropriately configured processing unit, including but not limited to: one or more mobile application processors; one or more desktop computer or server central processing units (CPUs), including multi-core CPUs; one or more parallel processing units such as parallel processing unit 2902 of Figure 29; and one or more graphics processors or special processing units, without departing from the scope of the embodiments described herein.
[0284] In some embodiments, a parallel processor or GPGPU as described herein is communicatively coupled to a host / processor core to accelerate graphics operations, machine learning operations, pattern analysis operations, and various general-purpose GPU (GPGPU) functions. The GPU can be communicatively coupled to the host processor / core via a bus or other interconnect (e.g., a high-speed interconnect such as PCIe or NVLink). In other embodiments, the GPU can be integrated on the same package or chip as the core and communicatively coupled to the core via an internal processor bus / interconnect (i.e., inside the package or chip). Regardless of the manner in which the GPU is connected, the processor core can assign work to the GPU in the form of a sequence of commands / instructions contained in a work descriptor. The GPU then uses dedicated circuits / logic to efficiently process these commands / instructions.
[0285] Technologies for GPU to host processor interconnect
[0286] Fig.31A An exemplary architecture is illustrated in which multiple GPUs 3110 to 3113 are communicatively coupled to multiple multi-core processors 3105 to 3106 via high-speed links 3140 to 3143 (e.g., buses, point-to-point interconnects, etc.). In one embodiment, the high-speed links 3140 to 3143 support 4 GB / s, 30 GB / s, 80 GB / s, or higher communication throughput, depending on the implementation. Various interconnect protocols can be used, including but not limited to PCIe 4.0 or 5.0 and NVLink 2.0. However, the underlying principles of the invention are not limited to any particular communication protocol or throughput.
[0287] Furthermore, in one embodiment, two or more of the GPUs 3110 to 3113 are interconnected via high-speed links 3144 to 3145, which may be implemented using the same or different protocols / links as used for high-speed links 3140 to 3143. Similarly, two or more of the multi-core processors 3105 to 3106 may be connected via high-speed link 3133, which may be a symmetric multiprocessor (SMP) bus running at 20 GB / s, 30 GB / s, 120 GB / s, or higher. Alternatively, Fig.31A All communications between the various system components shown in can be accomplished using the same protocol / links (eg, through a common interconnect structure). However, as mentioned, the underlying principles of the invention are not limited to any particular type of interconnect technology.
[0288] In one embodiment, each multi-core processor 3105-3106 is communicatively coupled to a processor memory 3101-3102 via a memory interconnect 3130-3131, respectively, and each GPU 3110-3113 is communicatively coupled to a GPU memory 3120-3123 via a GPU memory interconnect 3150-3153, respectively. The memory interconnects 3130-3131 and 3150-3153 may utilize the same or different memory access technologies. By way of example and not limitation, the processor memory 3101-3102 and the GPU memory 3120-3123 may be a volatile memory such as a dynamic random access memory (DRAM) (including stacked DRAM), a graphics DDR SDRAM (GDDR) (e.g., GDDR5, GDDR6), or a high bandwidth memory (HBM), and / or may be a non-volatile memory such as 3D XPoint or Nano-Ram. In one embodiment, some portion of the memory may be volatile memory and another portion may be non-volatile memory (eg, using a two-level memory (2LM) hierarchy).
[0289] As described below, although the various processors 3105-3106 and GPUs 3110-3113 may each be physically coupled to a specific memory 3101-3102, 3120-3123, respectively, a unified memory architecture may be implemented in which the same virtual system address space (also referred to as an "effective address" space) is distributed among all the various physical memories. For example, the processor memories 3101-3102 may each include 64 GB of system memory address space, and the GPU memories 3120-3123 may each include 32 GB of system memory address space (resulting in a total of 256 GB of addressable memory in the described example).
[0290] Fig.31BAdditional details of the interconnection between the multi-core processor 3107 and the graphics acceleration module 3146 according to one embodiment are illustrated. The graphics acceleration module 3146 may include one or more GPU chips integrated on a line card coupled to the processor 3107 via the high-speed link 3140. Alternatively, the graphics acceleration module 3146 may be integrated on the same package or chip as the processor 3107.
[0291] The illustrated processor 3107 includes a plurality of cores 3160A to 3160D, each of which has a translation lookaside buffer 3161A to 3161D and one or more caches 3162A to 3162D. These cores may include various other components (e.g., instruction fetch units, branch prediction units, decoders, execution units, reorder buffers, etc.) for executing instructions and processing data not shown to avoid obscuring the basic principles of the present invention. Caches 3162A to 3162D may include level 1 (L1) and level 2 (L2) caches. In addition, one or more shared caches 3126 may be included in the cache hierarchy and shared by each group of cores 3160A to 3160D. For example, one embodiment of the processor 3107 includes 24 cores, each core having its own L1 cache, 12 shared L2 caches, and 12 shared L3 caches. In this embodiment, one of the L2 cache and the L3 cache is shared by two adjacent cores. The processor 3107 and the graphics accelerator integrated module 3146 are connected to the system memory 3141 , which may include processor memories 3101 to 3102 .
[0292] The data and instructions stored in the various caches 3162A-3162D, 3156, and the system memory 3141 are maintained consistent via inter-core communications via the consistency bus 3164. For example, each cache may have cache consistency logic / circuitry associated therewith to communicate via the consistency bus 3164 in response to a detected read or write to a particular cache line. In one embodiment, a cache snooping protocol is implemented via the consistency bus 3164 to snoop cache accesses. Cache snooping / consistency techniques are well understood by those skilled in the art, and are not described in detail herein to avoid obscuring the basic principles of the present invention.
[0293] In one embodiment, the proxy circuit 3125 communicatively couples the graphics acceleration module 3146 to the consistency bus 3164, thereby allowing the graphics acceleration module 3146 to participate in the cache consistency protocol as a peer of the core. Specifically, the interface 3135 provides connectivity to the proxy circuit 3125 through a high-speed link 3140 (e.g., a PCIe bus, NVLink, etc.), and the interface 3137 connects the graphics acceleration module 3146 to the link 3140.
[0294] In one embodiment, the accelerator integrated circuit 3136 provides cache management, memory access, context management, and interrupt management services on behalf of multiple graphics processing engines 3131, 3132, N of the graphics acceleration module 3146. The graphics processing engines 3131, 3132, N may each include a separate graphics processing unit (GPU). Alternatively, the graphics processing engines 3131, 3132, N may include different types of graphics processing engines such as graphics execution units, media processing engines (e.g., video encoders / decoders), samplers, and block image transfer engines within the GPU. In other words, the graphics acceleration module may be a GPU having multiple graphics processing engines 3131 to 3132, N, or the graphics processing engines 3131 to 3132, N may be separate GPUs integrated on a common package, line card, or chip.
[0295] In one embodiment, the accelerator integrated circuit 3136 includes a memory management unit (MMU) 3139 for performing various memory management functions such as virtual to physical memory translation (also known as effective to real memory translation) and a memory access protocol for accessing the system memory 3141. The MMU 3139 may also include a translation lookaside buffer (TLB) (not shown) for caching virtual / effective to physical / real address translations. In one embodiment, the cache 3138 stores commands and data for efficient access by the graphics processing engines 3131 to 3132, N. In one embodiment, the data stored in the cache 3138 and the graphics memory 3133 to 3134, N is kept consistent with the core cache 3162A to 3162D, 3156 and the system memory 3111. As mentioned, this can be accomplished via proxy circuitry 3125, which participates in cache coherence mechanisms on behalf of cache 3138 and memories 3133 to 3134, N (e.g., sending updates to cache 3138 related to modifications / accesses of cache lines on processor caches 3162A to 3162D, 3156 and receiving updates from cache 3138).
[0296] A set of registers 3145 stores context data for threads executed by the graphics processing engines 3131 to 3132, N, and a context management circuit 3148 manages thread contexts. For example, the context management circuit 3148 may perform save and restore operations to save and restore contexts of various threads during context switching (e.g., where a first thread is saved and a second thread is stored so that the second thread can be executed by the graphics processing engine). For example, upon context switching, the context management circuit 3148 may store current register values to a designated area in memory (e.g., identified by a context pointer). The context management circuit may then restore register values upon returning to context. In one embodiment, the interrupt management circuit 3147 receives and processes interrupts received from system devices.
[0297] In one embodiment, the virtual / effective address from the graphics processing engine 3131 is converted by the MMU 3139 to an actual / physical address in the system memory 3111. One embodiment of the accelerator integrated circuit 3136 supports multiple (e.g., 4, 8, 16) graphics accelerator modules 3146 and / or other accelerator devices. The graphics accelerator module 3146 can be dedicated to a single application executed on the processor 3107, or can be shared between multiple applications. In one embodiment, a virtual graphics execution environment is presented in which the resources of the graphics processing engines 3131 to 3132, N are shared with multiple applications or virtual machines (VMs). Resources can be subdivided into "slices" that are allocated to different VMs and / or applications based on the processing requirements and priorities associated with the VMs and / or applications.
[0298] Thus, the accelerator integrated circuit acts as a bridge for the system of graphics acceleration module 3146 and provides address translation and system memory cache services. In addition, the accelerator integrated circuit 3136 can provide virtualization facilities for the host processor to manage virtualization of the graphics processing engine, interrupts, and memory management.
[0299] Since the hardware resources of the graphics processing engines 3131-3132, N are explicitly mapped to the actual address space seen by the host processor 3107, any host processor can directly address these resources using effective address values. In one embodiment, one function of the accelerator integrated circuit 3136 is the physical separation of the graphics processing engines 3131-3132, N so that they appear on the system as independent units.
[0300] As mentioned, in the illustrated embodiment, one or more graphics memories 3133-3134, M are respectively coupled to each of the graphics processing engines 3131-3132, N. The graphics memories 3133-3134, M store instructions and data processed by each of the graphics processing engines 3131-3132, N. The graphics memories 3133-3134, M may be volatile memory, such as DRAM (including stacked DRAM), GDDR memory (e.g., GDDR5, GDDR6), or HBM, and / or may be non-volatile memory, such as 3D XPoint or Nano-Ram.
[0301] In one embodiment, in order to reduce data traffic on link 3140, biasing techniques are used to ensure that the data stored in graphics memory 3133 to 3134, M is the data most frequently used by graphics processing engines 3131 to 3132, N, and preferably not used (at least not frequently) by cores 3160A to 3160D. Similarly, the biasing mechanism attempts to keep data needed by the core (and preferably not the graphics processing engines 3131 to 3132, N) within caches 3162A to 3162D, 3156 of the core and system memory 3111.
[0302] Fig.31C Another embodiment is shown in which an accelerator integrated circuit 3136 is integrated within the processor 3107. In this embodiment, the graphics processing engines 3131-3132, N communicate directly with the accelerator integrated circuit 3136 via the interface 3137 and the interface 3135 through the high-speed link 3140 (which may also utilize any form of bus or interface protocol). The accelerator integrated circuit 3136 can perform operations related to Fig.31B The same operations are described, but given their close proximity to the coherency bus 3162 and caches 3162A to 3162D, 3126, it is possible to operate at a higher throughput.
[0303] One embodiment supports different programming models, including a dedicated process programming model (without graphics acceleration module virtualization) and a shared programming model (with virtualization). The shared programming model may include a programming model controlled by the accelerator integrated circuit 3136 and a programming model controlled by the graphics acceleration module 3146.
[0304] In one embodiment of a dedicated process model, graphics processing engines 3131 to 3132, N are dedicated to a single application or process under a single operating system. A single application can focus other application requests to graphics engines 3131 to 3132, N, thereby providing virtualization within a VM / partition.
[0305] In a dedicated process programming model, the graphics processing engines 3131 to 3132, N can be shared by multiple VM / application partitions. The shared model requires a hypervisor that virtualizes the graphics processing engines 3131 to 3132, N to allow access by each operating system. For a single-partition system without a hypervisor, the graphics processing engines 3131 to 3132, N are owned by the operating system. In both cases, the operating system can virtualize the graphics processing engines 3131 to 3132, N to provide access to each process or application.
[0306] For the shared programming model, the graphics acceleration module 3146 or the separate graphics processing engines 3131 to 3132, N use a process handle to select a process element. In one embodiment, the process element is stored in the system memory 3111 and can be addressed using the effective address to real address conversion technology described herein. The process handle can be an implementation-specific value provided to the host process when registering its context with the graphics processing engine 3131 to 3132, N (i.e., calling the system software to add a process element to the process element link table). The lower 16 bits of the process handle can be the offset of the process element within the process element link table.
[0307] Fig.31D An exemplary accelerator integrated slice 3190 is illustrated. As used herein, a "slice" includes a specified portion of the processing resources of the accelerator integrated circuit 3136. The application effective address space 3182 within the system memory 3111 stores process elements 3183. In one embodiment, the process element 3183 is stored in response to a GPU call 3181 from an application 3180 executed on the processor 3107. The process element 3183 contains a process state for the corresponding application 3180. The work descriptor (WD) 3184 contained in the process element 3183 can be a single job requested by the application, or it can contain a pointer to a job queue. In the latter case, the WD 3184 is a pointer to a job request queue in the application address space 3182.
[0308] The graphics acceleration module 3146 and / or individual graphics processing engines 3131 to 3132, N may be shared by all processes or a subset of processes in the system. Embodiments of the present invention include an infrastructure for establishing process state and sending a WD 3184 to the graphics acceleration module 3146 to start a job in a virtual environment.
[0309] In one embodiment, the dedicated process programming model is implementation specific. In this model, a single process owns a graphics acceleration module 3146 or a separate graphics processing engine 3131. Since the graphics acceleration module 3146 is owned by a single process, the hypervisor initializes the accelerator integrated circuit 3136 for the partition to which it belongs, and the operating system initializes the accelerator integrated circuit 3136 for the process to which it belongs when the graphics acceleration module 3146 is allocated.
[0310] In operation, the WD acquisition unit 3191 in the accelerator integrated slice 3190 acquires the next WD 3184, which includes an indication of the work to be performed by one of the graphics processing engines of the graphics acceleration module 3146. As illustrated, the data from the WD 3184 can be stored in the register 3145 and used by the MMU 3139, the interrupt management circuit 3147 and / or the context management circuit 3146. For example, one embodiment of the MMU 3139 includes a fragment / page march circuit for accessing the fragment / page table 3186 within the OS virtual address space 3185. The interrupt management circuit 3147 can process the interrupt event 3192 received from the graphics acceleration module 3146. When performing graphics operations, the effective address 3193 generated by the graphics processing engine 3131 to 3132, N is converted to an actual address by the MMU 3139.
[0311] In one embodiment, the same set of registers 3145 is replicated for each graphics processing engine 3131 to 3132, N and / or graphics acceleration module 3146, and this set of registers can be initialized by the hypervisor or operating system. Each of these replicated registers can be included in the accelerator integrated slice 3190. Table 1 shows exemplary registers that can be initialized by the hypervisor.
[0312] Table 1 - Hypervisor Initialization Registers
[0313] 1 Slice Control Register 2 Real Address (RA) Dispatch Process Area Pointer 3 Authorization Mask Override Register 4 Interrupt vector table entry offset 5 Interrupt vector table entry limit 6 Status Register 7 Logical Partition ID 8 Real Address (RA) Manager Accelerator Utilizes Record Pointers 9 Storage Description Register
[0314] Example registers that may be initialized by the operating system are shown in Table 2.
[0315] Table 2 - Operating System Initialization Registers
[0316] 1 Process and thread identities 2 Effective Address (EA) context save / restore pointer 3 Virtual Address (VA) Accelerator Utilizes Record Pointers 4 Virtual Address (VA) stores the fragment table pointer 5 Authorization Mask 6 Job Descriptor
[0317] In one embodiment, each WD 3184 is specific to a particular graphics acceleration module 3146 and / or graphics processing engine 3131-3132, N. The WD contains all the information needed by the graphics processing engine 3131-3132, N to complete its work, or the WD can be a pointer to a memory location where the application has established a command queue for work to be completed.
[0318] Fig.31E Additional details of one embodiment of the sharing model are illustrated. The embodiment includes a hypervisor real address space 3198 in which a process element list 3199 is stored. The hypervisor real address space 3198 is accessible via a hypervisor 3196 that virtualizes a graphics acceleration module engine for an operating system 3195.
[0319] The shared programming model allows all processes or a subset of processes from all partitions or a subset of partitions in the system to use the graphics acceleration module 3146. There are two programming models where the graphics acceleration module 3146 is shared by multiple processes and partitions: time-sliced sharing and graphics direct sharing.
[0320] In this model, the hypervisor 3196 owns the graphics acceleration module 3146 and makes its functionality available to all operating systems 3195. In order for the graphics acceleration module 3146 to support virtualization of the hypervisor 3196, the graphics acceleration module 3146 may follow the following requirements:
[0321] 1) The application's job requests must be autonomous (i.e., no state needs to be maintained between jobs), or the graphics acceleration module 3146 must provide a context save and restore mechanism. 2) The graphics acceleration module 3146 guarantees that the application's job requests are completed within a specified amount of time, including any conversion errors, or the graphics acceleration module 3146 provides the ability to preempt job processing. 3) When operating in a direct sharing programming model, the graphics acceleration module 3146 must ensure fairness between processes.
[0322] In one embodiment, for the shared model, an application 3180 is required to make an operating system 3195 system call using a graphics acceleration module 3146 type, a work descriptor (WD), an authorization mask register (AMR) value, and a context save / restore region pointer (CSRP). The graphics acceleration module 3146 type describes the target acceleration function for the system call. The graphics acceleration module 3146 type can be a system-specific value. The WD is formatted specifically for the graphics acceleration module 3146 and can be in the following form: a graphics acceleration module 3146 command; an effective address pointer to a user-defined structure; an effective address pointer to a command queue; or any other data structure used to describe the work to be performed by the graphics acceleration module 3146. In one embodiment, the AMR value is the AMR state for the current process. The value passed to the operating system is similar to the application that sets the AMR. If the implementation of the accelerator integrated circuit 3136 and the graphics acceleration module 3146 does not support the user authorization mask override register (UAMOR), the operating system can apply the current UAMOR value to the AMR value before passing the AMR in the hypervisor call. The hypervisor 3196 may optionally apply the current authorization mask override register (AMOR) value before placing the AMR into the process element 3183. In one embodiment, the CSRP is one of the registers 3145 that contains the effective address of an area in the application address space 3182 for the graphics acceleration module 3146 to save and restore context state. This pointer is optional if state does not need to be saved between jobs or when a job is preempted. The context save / restore area may be a plugged in system memory.
[0323] Upon receiving the system call, the operating system 3195 can verify that the application 3180 is registered and authorized to use the graphics acceleration module 3146. The operating system 3195 then calls the hypervisor 3196 using the information shown in Table 3.
[0324] Table 3 - Parameters of the operating system's call to the hypervisor
[0325] 1 Job Descriptor (WD) 2 Authorization Mask Register (AMR) value (may be masked) 3 Effective Address (EA) Context Save / Restore Region Pointer (CSRP) 4 Process ID (PID) and optional thread ID (TID) 5 Virtual Address (VA) Accelerator Utilization Record Pointer (AURP) 6 Virtual address of the storage segment table pointer (SSTP) 7 Logical Interrupt Service Number (LISN)
[0326] Upon receiving the hypervisor call, the hypervisor 3196 verifies that the operating system 3195 has registered and is authorized to use the graphics acceleration module 3146. The hypervisor 3196 then places the process element 3183 into the process element link table for the corresponding graphics acceleration module 3146 type. The process element may contain the information shown in Table 4.
[0327] Table 4 - Process element information
[0328] 1 Job Descriptor (WD) 2 Authorization Mask Register (AMR) value (may be masked) 3 Effective Address (EA) Context Save / Restore Region Pointer (CSRP) 4 Process ID (PID) and optional thread ID (TID) 5 Virtual Address (VA) Accelerator Utilization Record Pointer (AURP) 6 Virtual address of the storage segment table pointer (SSTP) 7 Logical Interrupt Service Number (LISN) 8 Interrupt vector table, derived from the hypervisor call parameters 9 Status Register (SR) Value 10 Logical Partition ID (LPID) 11 Real Address (RA) Manager Accelerator Utilizes Record Pointers 12 Storage Descriptor Register (SDR)
[0329] In one embodiment, the hypervisor initializes multiple accelerator integrated slices 3190 of registers 3145 .
[0330] like Fig.31F As shown, one embodiment of the present invention employs a unified memory addressable via a common virtual memory address space for accessing physical processor memories 3101 to 3102 and GPU memories 3120 to 3123. In this embodiment, operations executed on GPUs 3110 to 3113 utilize the same virtual / effective memory address space to access processor memories 3101 to 3102, and vice versa, thereby simplifying programmability. In one embodiment, the first portion of the virtual / effective address space is allocated to processor memory 3101, the second portion is allocated to second processor memory 3102, the third portion is allocated to GPU memory 3120, and so on. The entire virtual / effective memory space (sometimes referred to as the effective address space) is thus distributed on each of processor memories 3101 to 3102 and GPU memories 3120 to 3123, thereby allowing any processor or GPU to access any physical memory having a virtual address mapped to the memory.
[0331] In one embodiment, bias / coherency management circuits 3194A-3194E within one or more of the MMUs 3139A-3139E ensure cache coherency between the caches of the host processor (e.g., 3105) and the GPUs 3110-3113, as well as implement biasing techniques that indicate physical memory where certain types of data should be stored. Fig.31F Multiple instances of bias / consistency management circuits 3194A to 3194E are illustrated in , but the bias / consistency circuits may also be implemented within an MMU of one or more host processors 3105 and / or within an accelerator integrated circuit 3136.
[0332] One embodiment allows the GPU-attached memory 3120 to 3123 to be mapped as part of the system memory and accessed using shared virtual memory (SVM) technology, but without suffering from the typical performance drawbacks associated with full system cache coherence. The ability to access the GPU-attached memory 3120 to 3123 as system memory does not incur heavy cache coherence overhead, which provides a favorable operating environment for GPU offloading. This arrangement allows the host processor 3105 software to set operands and access calculation results without the overhead of traditional I / O DMA data copies. These traditional copies involve driver calls, interrupts, and memory mapped I / O (MMIO) accesses, which are all inefficient relative to simple memory accesses. At the same time, the ability to access the GPU-attached memory 3120 to 3123 without cache coherence overhead may be critical to the execution time of the offloaded calculation. For example, in the case of a large number of streaming write memory services, the cache coherence overhead can significantly reduce the effective write bandwidth seen by the GPU 3110 to 3113. The efficiency of operand setup, the efficiency of result access, and the efficiency of GPU computation all play an important role in determining the effectiveness of GPU offloading.
[0333] In one embodiment, the selection between GPU bias and host processor bias is driven by a bias tracker data structure. For example, a bias table may be used, which may be a page granular structure including 1 or 2 bits per GPU attached memory page (i.e., controlled at the granularity of a memory page). The bias table may be implemented in the stolen memory range of one or more GPU attached memories 3120 to 3123, with or without a bias cache in GPUs 3110 to 3113 (e.g., to cache frequently / recently used entries of the bias table). Alternatively, the entire bias table may be maintained within the GPU.
[0334] In one embodiment, the bias table entry associated with each access to the GPU attached memory 3120 to 3123 is accessed before the GPU memory is actually accessed, resulting in the following operations. First, local requests from GPUs 3110 to 3113 whose pages are found in the GPU bias are forwarded directly to the corresponding GPU memory 3120 to 3123. Local requests from the GPUs whose pages are found in the host bias are forwarded to the processor 3105 (e.g., over a high-speed link as discussed above). In one embodiment, the request from the processor 3105 to find the requested page in the host processor bias completes the request like a normal memory read. Alternatively, the request for the GPU bias page can be forwarded to the GPUs 3110 to 3113. If the GPU is not currently using the page, the GPU can convert the page to the host processor bias.
[0335] The bias state of a page can be changed by a software-based mechanism, a hardware-assisted software-based mechanism, or, for a limited set of cases, a hardware-only based mechanism.
[0336] One mechanism for changing the bias state employs an API call (e.g., OpenCL) which in turn calls the device driver of the GPU which in turn sends a message (or queues a command descriptor) to the GPU, thereby directing the GPU to change the bias state and, for certain transitions, perform a cache flush operation in the host. The cache flush operation is required for a transition from host processor 3105 bias to GPU bias, but not for the reverse transition.
[0337] In one embodiment, cache coherency is maintained by temporarily presenting GPU biased pages that are not cacheable to the host processor 3105. To access these pages, the processor 3105 may request access from the GPU 3110, which may or may not grant access immediately, depending on the implementation. Therefore, to reduce communication between the processor 3105 and the GPU 3110, it is advantageous to ensure that the GPU biased pages are pages that are needed by the GPU but not by the host processor 3105, and vice versa.
[0338] Graphics processing pipeline
[0339] Fig.32 29. A graphics processing pipeline 3200 is illustrated in accordance with an embodiment. In one embodiment, a graphics processor may implement the illustrated graphics processing pipeline 3200. The graphics processor may be included in a parallel processing subsystem as described herein, such as the parallel processor 2900 of FIG. 29. In one embodiment, the parallel processor is Fig.2829 ). As described herein, various parallel processing systems may implement the graphics processing pipeline 3200 via one or more instances of a parallel processing unit (e.g., parallel processing unit 2902 of FIG. 29 ). For example, a shader unit (e.g., graphics multiprocessor 3034 of FIG. 30 ) may be configured to perform the functionality of one or more of a vertex processing unit 3204, a tessellation control processing unit 3208, a tessellation evaluation processing unit 3212, a geometry processing unit 3216, and a fragment / pixel processing unit 3224. The functionality of the data assembler 3202, primitive assemblers 3206, 3214, 3218, tessellation unit 3210, rasterizer 3222, and raster operation unit 3226 may also be implemented by a processing cluster (e.g., Figure 3 Other processing engines and corresponding partition units (e.g., Figure 2 29 ). The graphics processing pipeline 3200 may also be implemented using dedicated processing units for one or more functions. In one embodiment, one or more portions of the graphics processing pipeline 3200 may be executed by parallel processing logic within a general-purpose processor (e.g., a CPU). In one embodiment, one or more portions of the graphics processing pipeline 3200 may access on-chip memory (e.g., parallel processor memory 2922 in FIG. 29 ) via a memory interface 3228, which may be an instance of the memory interface 2918 of FIG. 29 .
[0340] In one embodiment, data assembler 3202 is a processing unit that collects vertex data for surfaces and primitives. Data assembler 3202 then outputs vertex data including vertex attributes to vertex processing unit 3204. Vertex processing unit 3204 is a programmable execution unit that executes vertex shader programs to illuminate and transform vertex data as specified by the vertex shader programs. Vertex processing unit 3204 reads data stored in cache, local or system memory for processing vertex data, and can be programmed to convert vertex data from an object-based coordinate representation to a world space coordinate space or a normalized device coordinate space.
[0341] A first instance of primitive assembler 3206 receives vertex attributes from vertex processing unit 320. Primitive assembler 3206 reads the stored vertex attributes and constructs graphics primitives as needed for processing by tessellation control processing unit 3208. Graphics primitives include triangles, line segments, points, patches, etc. as supported by various graphics processing application programming interfaces (APIs).
[0342] The tessellation control processing unit 3208 treats the input vertices as control points of a geometric patch. These control points are transformed from an input representation from the patch (e.g., a basis for the patch) to a representation suitable for surface evaluation by the tessellation evaluation processing unit 3212. The tessellation control processing unit 3208 may also compute tessellation factors for the edges of the geometric patch. The tessellation factors apply to individual edges and quantify the viewpoint-dependent level of detail associated with the edge. The tessellation unit 3210 is configured to receive the tessellation factors for the edges of the patch and tessellate the patch into a plurality of geometric primitives such as lines, triangles, or quadrilateral primitives, which are transmitted to the tessellation evaluation processing unit 3212. The tessellation evaluation processing unit 3212 operates on the parameterized coordinates of the tessellated patch to generate a surface representation and vertex attributes for each vertex associated with the geometric primitive.
[0343] A second instance of primitive assembler 3214 receives vertex attributes from tessellation evaluation processing unit 3212, reads stored vertex attributes as needed, and constructs graphics primitives for processing by geometry processing unit 3216. Geometry processing unit 3216 is a programmable execution unit that executes geometry shader programs to transform graphics primitives received from primitive assembler 3214 as specified by the geometry shader programs. In one embodiment, geometry processing unit 3216 is programmed to subdivide the graphics primitives into one or more new graphics primitives and to compute parameters for rasterizing the new graphics primitives.
[0344] In some embodiments, the geometry processing unit 3216 can add or delete elements in the geometry stream. The geometry processing unit 3216 outputs parameters and vertices specifying new graphics primitives to the primitive assembler 3218. The primitive assembler 3218 receives the parameters and vertices from the geometry processing unit 3216 and constructs graphics primitives for processing by the viewport scaling, culling, and clipping unit 3220. The geometry processing unit 3216 reads data stored in the parallel processor memory or the system memory for processing geometry data. The viewport scaling, culling, and clipping unit 3220 performs clipping, culling, and viewport scaling, and outputs processed graphics primitives to the rasterizer 3222.
[0345] The rasterizer 3222 can perform depth culling and other depth-based optimizations. The rasterizer 3222 also performs scan conversion on new graphics primitives to generate fragments and outputs these fragments and associated coverage data to the fragment / pixel processing unit 3224. The fragment / pixel processing unit 3224 is a programmable execution unit configured to execute a fragment shader program or a pixel shader program. The fragment / pixel processing unit 3224 transforms the fragments or pixels received from the rasterizer 3222 as specified by the fragment or pixel shader program. For example, the fragment / pixel processing unit 3224 can be programmed to perform operations including but not limited to texture mapping, shading, blending, texture correction, and perspective correction to generate shaded fragments or pixels output to the raster operation unit 3226. The fragment / pixel processing unit 3224 can read data stored in a parallel processor memory or system memory to use when processing fragment data. The fragment or pixel shader program can be configured to color with samples, pixels, tiles, or other granularity according to the sampling rate configured for the processing unit.
[0346] Raster operation unit 3226 is a processing unit that performs raster operations including but not limited to stenciling, z-testing, blending, etc., and outputs pixel data as processed graphics data for storage in graphics memory (e.g., Figure 2 The parallel processor memory 222 and / or Figure 1 The raster operation unit 3226 may be configured to compress the z or color data written to the memory and to decompress the z or color data read from the memory.
[0347] In an embodiment, the term "engine" or "module" or "logic" may refer to, be part of, or include an application-specific integrated circuit (ASIC), electronic circuit, processor (shared processor, dedicated processor, or group processor) and / or memory (shared memory, dedicated memory, or group memory) that executes one or more software or firmware programs, combinational logic circuits, and / or other suitable components that provide the described functionality. In an embodiment, an engine or module may be implemented in firmware, hardware, software, or any combination of firmware, hardware, and software.
[0348] Embodiments of the present invention may include the steps described above. These steps may be embodied as machine executable instructions, which may be used to cause a general or special processor to perform these steps. Alternatively, these steps may be performed by specific hardware components containing hard-wired logic for performing these steps, or by any combination of programmed computer components and custom hardware components.
[0349] As described herein, instructions may refer to a specific configuration of hardware, such as an application specific integrated circuit (ASIC) configured to perform certain operations or having predetermined functions or software instructions stored in a memory implemented in a non-transitory computer readable medium. Thus, the techniques shown in the accompanying drawings may be implemented using code and data stored and executed on one or more electronic devices (e.g., an end station, a network element, etc.). Such electronic devices use computer machine readable media to store and transmit (internally and / or with other electronic devices over a network) code and data, such as non-transitory computer machine readable storage media (e.g., magnetic disks; optical disks; random access memory; read-only memory; flash memory storage devices; phase change memory) and transient computer machine readable communication media (e.g., electrical, optical, acoustic or other forms of propagated signals—e.g., carrier waves, infrared signals, digital signals, etc.).
[0350] In addition, such an electronic device typically includes a group of one or more processors coupled to one or more other components (e.g., one or more storage devices (non-transitory machine-readable storage media), user input / output devices (e.g., keyboards, touch screens and / or displays), and network connections). The coupling of the group of processors and other components is usually through one or more buses and bridges (also referred to as bus controllers). The storage devices and signals that carry network traffic represent one or more machine-readable storage media and machine-readable communication media, respectively. Therefore, the storage device of a given electronic device typically stores code and / or data for execution on the one or more processors of the group of that electronic device. Of course, different combinations of software, firmware, and / or hardware can be used to implement one or more parts of the embodiments of the present invention. Throughout this detailed description, for the purpose of explanation, a large number of specific details are set forth in order to provide a thorough understanding of the present invention. However, it will be obvious to those skilled in the art that the present invention can be practiced without some of these specific details. In some instances, well-known structures and functions are not described in detail in order to avoid obscuring the subject matter of the present invention. Thus, the scope and spirit of the present invention should be judged according to the following claims.
Claims
1. A device for efficient graphics virtualization, comprising: a command streamer for queuing commands from a plurality of virtual machines (VMs) or applications, the commands being distributed from the command streamer and executed by graphics processing resources of a graphics processing unit (GPU); a tile cache for storing graphics data associated with a plurality of VMs or applications when the commands are executed by the graphics processing resource; as well as tile cache allocation hardware logic to allocate a first portion of the tile cache to a first VM or application and a second portion of the tile cache to a second VM or application; The tile cache allocation hardware logic further allocates a first region in the system memory to store overflow data when the first portion of the tile cache and / or the second portion of the tile cache becomes full; The tile cache allocation hardware logic includes priority logic for determining a priority associated with each VM or application and selecting sizes of the first portion and the second portion of the tile cache according to the priority.
2. The apparatus of claim 1 , wherein the tile cache allocation hardware logic comprises circuitry and / or logic for determining whether the requested data is stored in the tile cache, and if not, sending the request to the first region in memory. 3 . The apparatus of claim 1 , wherein if the first VM or application has a relatively higher priority than the second VM or application, the tile cache allocation hardware logic is to allocate a relatively larger size to the first portion than to the second portion.
4. The apparatus according to claim 1, further comprising: a shared local memory (SLM) that is shared by a first VM or application and a second VM or application; as well as An SLM controller for allocating a first portion of the SLM to a first VM or application and allocating a second portion of the SLM to a second VM or application; The SLM controller further allocates a second area in the system memory to store overflow data when the first portion of the SLM and / or the second portion of the SLM becomes full.
5. The apparatus of claim 4, wherein the SLM controller includes circuitry and / or logic for determining whether the requested data is stored in the SLM, and if not, sending a request to a second region in memory.
6. The apparatus of claim 4 or 5, wherein the SLM controller comprises priority logic for determining a priority associated with each VM or application and determining the size of the first and second portions of the SLM according to the priority. 7 . The apparatus of claim 6 , wherein if a first VM or application has a relatively higher priority than a second VM or application, the SLM controller is configured to allocate a relatively larger size to the first portion than to the second portion.
8. The apparatus according to claim 1, wherein the graphics processing resource is subdivided into a plurality of slices, the apparatus further comprising: A power / performance management unit independently sets a voltage and / or frequency provided to each of the one or more slices based on identifying a slice for processing the first and second VMs or applications and a priority associated with the first VM or application and the second VM or application.
9. A method for efficient graphics virtualization, comprising: Queuing commands from multiple virtual machines (VMs) or applications, which are distributed and executed by graphics processing resources of a graphics processing unit (GPU); storing graphics data associated with a plurality of VMs or applications in a tile cache when the commands are executed by a graphics processing resource; as well as allocating a first portion of the tile cache to a first VM or application and allocating a second portion of the tile cache to a second VM or application; allocating a first region in a system memory to store overflow data when the first portion of the tile cache and / or the second portion of the tile cache becomes full; Also includes: Determine the priority associated with each VM or application; as well as The sizes of the first and second parts of the tile cache are selected according to the priority.
10. The method according to claim 9, further comprising: A determination is made as to whether the requested data is stored in the tile cache, and if not, a request is sent to a first region in memory. 11 . The method of claim 9 , wherein if the first VM or application has a relatively higher priority than the second VM or application, allocating a relatively larger size to the first portion than to the second portion.
12. The method according to claim 9 or 11, further comprising: allocating a first portion of a shared local memory (SLM) to a first VM or application and allocating a second portion of the SLM to a second VM or application; A second area in the system memory is allocated to store overflow data when the first portion of the SLM and / or the second portion of the SLM becomes full.
13. The method according to claim 12, further comprising: A determination is made as to whether the requested data is stored in the SLM, and if not, a request is sent to a second area in memory.
14. The method according to claim 12, further comprising: Determine the priority associated with each VM or application; as well as The sizes of the first and second parts of the SLM are selected according to the priority.
15. The method according to claim 14, further comprising: If the first VM or application has a relatively higher priority than the second VM or application, the first portion is allocated a relatively larger size than the second portion.
16. The method of claim 9, wherein the graphics processing resource is subdivided into a plurality of slices, the method further comprising: A voltage and / or frequency provided to each of the one or more slices is independently set based on identifying the slice for processing the first and second VMs or applications and the priorities associated with the first VM or application and the second VM or application.
17. A machine-readable medium having program code stored thereon which, when executed by a machine, causes the machine to perform the following operations: Queuing commands from multiple virtual machines (VMs) or applications, which are distributed and executed by graphics processing resources of a graphics processing unit (GPU); storing graphics data associated with a plurality of VMs or applications in a tile cache when the commands are executed by a graphics processing resource; as well as allocating a first portion of the tile cache to a first VM or application and allocating a second portion of the tile cache to a second VM or application; allocating a first region in a system memory to store overflow data when the first portion of the tile cache and / or the second portion of the tile cache becomes full; Also includes: Determine the priority associated with each VM or application; as well as The sizes of the first and second parts of the tile cache are selected according to the priority.
18. The machine-readable medium of claim 17, further comprising: A determination is made as to whether the requested data is stored in the tile cache, and if not, a request is sent to a first region in memory.
19. The machine-readable medium of claim 17, wherein if the first VM or application has a relatively higher priority than the second VM or application, the first portion is assigned a relatively larger size than the second portion.
20. The machine-readable medium of claim 17, further comprising: allocating a first portion of a shared local memory (SLM) to a first VM or application and allocating a second portion of the SLM to a second VM or application; A second area in the system memory is allocated to store overflow data when the first portion of the SLM and / or the second portion of the SLM becomes full.
21. The machine-readable medium of claim 20, further comprising: A determination is made as to whether the requested data is stored in the SLM, and if not, a request is sent to a second area in memory.
22. A device for efficient graphics virtualization, comprising: means for queuing commands from a plurality of virtual machines (VMs) or applications, the commands being distributed and executed by graphics processing resources of a graphics processing unit (GPU); means for storing graphics data associated with a plurality of VMs or applications in a tile cache when the command is executed by a graphics processing resource; as well as means for allocating a first portion of the tile cache to a first VM or application and a second portion of the tile cache to a second VM or application; means for allocating a first region in system memory to store overflow data when the first portion of the tile cache and / or the second portion of the tile cache becomes full; Also includes: means for determining a priority associated with each VM or application; as well as Means for selecting sizes of the first and second portions of the tile cache based on the priority.
23. The apparatus of claim 22, further comprising: means for determining whether the requested data is stored in the tile cache, and Means for, if not, sending the request to the first region in the memory.
24. The apparatus of claim 22, wherein if the first VM or application has a relatively higher priority than the second VM or application, the first portion is allocated a relatively larger size than the second portion.
25. The apparatus according to claim 22 or 24, further comprising: means for allocating a first portion of a shared local memory (SLM) to a first VM or application and allocating a second portion of the SLM to a second VM or application; Means for allocating a second area in system memory to store overflow data when the first portion of the SLM and / or the second portion of the SLM becomes full.
26. The apparatus of claim 25, further comprising: means for determining whether the requested data is stored in said SLM, and Means for, if not, sending the request to a second area in the memory.
27. The apparatus of claim 25, further comprising: means for determining a priority associated with each VM or application; as well as Means for selecting the size of the first and second portions of the SLM according to the priority.
28. The apparatus of claim 27, further comprising: Means for allocating a relatively larger size to the first portion than to the second portion if the first VM or application has a relatively higher priority than the second VM or application.
29. The apparatus of claim 22, wherein the graphics processing resource is subdivided into a plurality of slices, the apparatus further comprising: Means for independently setting a voltage and / or frequency provided to each of the one or more slices based on identifying a slice for processing a first and a second VM or application and a priority associated with the first VM or application and the second VM or application.
