Texture parallel processing method and device based on virtual graphics card, equipment and medium
By creating a texture thread pool in the Hypervisor virtualization environment and processing virtual GPU instructions according to texture priority, the problem of low texture processing performance and unfairness of virtual graphics cards is solved, and smoother and more efficient display performance is achieved.
Patent Information
- Application Number
- CN202411914199.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-15
AI Technical Summary
In the prior art, virtual graphics card texture processing in Hypervisor virtualization environment has problems of low performance and unfairness, especially in multi-screen design scenarios, resulting in poor display.
By obtaining virtual GPU instructions for the client system, creating a texture context and creating a texture thread based on texture priority, forming a thread pool. When a new virtual GPU instruction is received, the target texture thread is awakened from the thread pool for parallel processing, and the scheduling queue is inserted according to the texture priority to ensure high-priority tasks are prioritized.
It realizes parallel texture processing of the client system, improves the display fluency and display performance of the Hypervisor virtualization solution, and ensures the fairness of texture processing.
Smart Images

Figure CN119829211A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of virtualization technology, and in particular to a texture parallel processing method, device, equipment and medium based on a virtual graphics card. Background Art
[0002] Virtualization technology has been widely used in multiple systems in smart cockpits. Through methods such as multi-level scheduling and kernel isolation, this technology makes resource scheduling between client systems fairer and system operation safer. The current mainstream Hypervisor technology is mainly divided into two categories, Type I and Type II. These two types mainly differ in scheduling models, and there is no obvious difference in IO virtualization solutions. The former uses a two-level scheduling model in which the physical CPU schedules the virtual CPU and the virtual CPU schedules tasks to complete fair scheduling of tasks between virtual machine systems, including open source solutions such as XEN and ACRN; the latter retains the first-level scheduling model and turns the underlying logic originally executed by the Hypervisor into a single kernel module of the host system, including solutions such as KVM.
[0003] The common point of these two types of mainstream hypervisor technologies is that they use device virtualization solutions such as virtio, vhost and vhost-user to realize the access requirements of different virtual machine systems to physical external devices. For example, for a virtual graphics card, the rendering process of the client system applies for / releases video memory, creates / destroys contexts, binds and unbinds contexts, submits rendering tasks, submits synthesis tasks, and submits display tasks through VIRTIO GPU instructions. After the lower half of the backend simulation program of the host system parses the instructions, it completes the corresponding task simulation according to the content of the rendering process instructions.
[0004] In the current graphics card virtualization technology solution, multiple applications and display services of the client system will create one or more texture contexts through the VIRTIOGPU instruction, which makes the front-end driver trigger GPU instructions related to the texture context in parallel, and then queue them in the back-end simulation program of the host system for processing. The multi-screen design of the client system has independent application scenarios for different screens, and the display service needs to meet multi-screen synthesis and multi-screen display, which makes the GPU instruction flow triggered in parallel by the front-end driver larger. The complex and diverse GPU instructions submitted by the front-end driver of the client system with different texture contexts will be parsed and processed one by one in the lower half of the back-end simulation program of the host system. As long as a task in the queue is processed slowly, it will cause subsequent texture processing delays, and then cause a series of problems such as unsmooth display. In addition, the back-end simulation program does not distinguish the priority of the texture context tasks submitted by the client system, which will cause some urgent texture processing task requirements to be ignored, while non-urgent tasks will be given priority, further causing unfairness in the texture processing of the virtual graphics card. Summary of the invention
[0005] In view of the shortcomings of the prior art described above, the purpose of the present application is to provide a texture parallel processing method, device, equipment and medium based on a virtual graphics card, so as to improve the performance and fairness issues of virtual graphics card texture processing in a Hypervisor virtualization environment in the prior art.
[0006] To achieve the above objectives and other related objectives, the present application provides a performance optimization method based on a virtual graphics card, which is applied to a host system in a Hypervisor environment. The method includes:
[0007] Obtaining first virtual GPU instructions for a plurality of applications or display services in a client system;
[0008] Creating a texture context according to the first virtual GPU instruction, wherein each process creates a texture context, and different texture contexts are distinguished by a unique texture identifier;
[0009] Creating a corresponding texture thread according to the texture priority of the texture corresponding to the texture context, and placing the thread into a texture thread pool;
[0010] Obtaining second virtual GPU instructions for a plurality of applications or display services in the client system;
[0011] Parsing the second virtual GPU instruction to obtain a target texture identifier included in the second virtual GPU instruction;
[0012] According to the target texture identifier, waking up a target texture thread corresponding to the target texture identifier from the texture thread pool;
[0013] The tasks of the second virtual CPU instructions are distributed to the awakened target texture threads for parallel processing.
[0014] In an optional embodiment of the present application, the method further includes:
[0015] Create texture scheduling queues corresponding to different texture priorities in the physical graphics card driver in advance;
[0016] Among them, tasks in a texture scheduling queue with a high texture priority can interrupt tasks in a texture scheduling queue with a low texture priority and submit them to the physical graphics card.
[0017] In an optional embodiment of the present application, the method further includes:
[0018] When the parallel processing of different target texture threads is completed, submitting the real GPU task corresponding to the second virtual GPU instruction to the physical graphics card driver;
[0019] According to the texture priority, the real GPU task corresponding to the second virtual GPU instruction is inserted into the texture scheduling queue of the corresponding priority for scheduling processing.
[0020] In an optional embodiment of the present application, a corresponding texture thread is created according to the texture priority of the texture corresponding to the texture context, and is placed into a texture thread pool, including:
[0021] Determine whether the texture corresponding to the texture context is a high priority texture:
[0022] If so, create a high-priority real-time texture thread using the backend simulation program;
[0023] If not, creating a low-priority normal texture thread using the backend simulation program;
[0024] High and low priority texture threads are placed into the texture thread pool through the backend simulation program.
[0025] In an optional embodiment of the present application, waking up a target texture thread corresponding to the target texture identifier from the texture thread pool according to the target texture identifier further includes:
[0026] According to the target texture identifier, determining whether the target texture thread corresponding to the target texture identifier is running;
[0027] If yes, putting the second virtual GPU instruction back into the message queue to wait until the simulation of the previous scheduled task corresponding to the target texture identifier is completed;
[0028] If not, waking up the target texture thread corresponding to the target texture identifier from the texture thread pool.
[0029] In an optional embodiment of the present application, the host system is an instrument system arranged on a vehicle computer chip, and the client system is a central control system arranged on a vehicle computer chip.
[0030] To achieve the above-mentioned purpose and other related purposes, the present application also provides a texture parallel processing device based on a virtual graphics card, which is applied to a host system in a Hypervisor environment. The texture parallel processing device based on a virtual graphics card includes:
[0031] A first instruction acquisition module, used to acquire first virtual GPU instructions for multiple applications or display services in the client system;
[0032] A context creation module, configured to create a texture context according to the first virtual GPU instruction, wherein each process creates a texture context, and different texture contexts are distinguished by a unique texture identifier;
[0033] A thread creation module, used for creating a corresponding texture thread according to the texture priority of the texture corresponding to the texture context, and putting the thread into a texture thread pool;
[0034] A second instruction acquisition module, used to acquire second virtual GPU instructions for multiple applications or display services in the client system;
[0035] an instruction parsing module, configured to parse the second virtual GPU instruction to obtain a target texture identifier included in the second virtual GPU instruction;
[0036] A thread awakening module, used for awakening a target texture thread corresponding to the target texture identifier from the texture thread pool according to the target texture identifier;
[0037] The task distribution processing module is used to distribute the task of the second virtual CPU instruction to the awakened target texture thread for parallel processing.
[0038] In an optional embodiment of the present application, the device further includes:
[0039] A scheduling queue creation module is used to pre-create texture scheduling queues corresponding to different texture priorities in the physical graphics card driver; wherein tasks of a texture scheduling queue with a high texture priority can be queued with tasks of a texture scheduling queue with a low texture priority and submitted to the physical graphics card;
[0040] A real task submission module, configured to submit the real GPU task corresponding to the second virtual GPU instruction to the physical graphics card driver after the parallel processing of different target texture threads is completed;
[0041] The scheduling processing module is used to insert the real GPU task corresponding to the second virtual GPU instruction into the texture scheduling queue of the corresponding priority for scheduling processing according to the texture priority.
[0042] To achieve the above-mentioned purpose and other related purposes, the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of any of the above-mentioned methods when executing the computer program.
[0043] To achieve the above-mentioned purpose and other related purposes, the present application provides a computer-readable storage medium on which a computer program is stored, characterized in that when the computer program is executed by a processor, the steps of any of the above-mentioned methods are implemented.
[0044] The texture parallel processing method based on a virtual graphics card of the present application is as follows: obtaining a first virtual GPU instruction of multiple applications or display services in a client system; creating a texture context according to the first virtual GPU instruction, wherein each process creates a texture context, and different texture contexts are distinguished by a unique texture identifier; creating a corresponding texture thread according to the texture priority corresponding to the texture context to form a texture thread pool; obtaining a second virtual GPU instruction of multiple applications or display services in the client system; parsing the second virtual GPU instruction to obtain a target texture identifier contained in the second virtual GPU instruction; waking up a target texture thread corresponding to the target texture identifier from the texture thread pool according to the target texture identifier; distributing the task of the second virtual CPU instruction to the awakened target texture thread for parallel processing; after the parallel processing of different target texture threads is completed, submitting the real GPU task corresponding to the second virtual GPU instruction to the physical graphics card driver; inserting the real GPU task corresponding to the second virtual GPU instruction into the texture scheduling queue of the corresponding priority for scheduling processing according to the texture priority, realizing the texture parallel processing of the client system, and at the same time fully considering the urgency of different texture processing, making full use of the limited texture pipeline resources of the virtual graphics card, and improving the display fluency and display performance of the Hypervisor virtualization solution. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 A flowchart of a texture parallel processing method based on a virtual graphics card in an exemplary embodiment of the present application is shown;
[0046] Figure 2 A sub-flow chart of steps S20 and S30 is shown;
[0047] Figure 3 A structural block diagram of a texture parallel processing device based on a virtual graphics card according to an exemplary embodiment of the present application is shown;
[0048] Figure 4 A structural block diagram of an electronic device according to an exemplary embodiment of the present application is shown. DETAILED DESCRIPTION
[0049] The following describes the implementation of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific implementations, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application.
[0050] It should be noted that the illustrations provided in this embodiment only illustrate the basic concept of the present application in a schematic manner, and therefore the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0051] The present application provides a texture parallel processing method based on a virtual graphics card. In this solution, multiple applications and display services of the client system create a texture context through a virtual GPU instruction (also known as a VIRTIO GPU instruction), and the back-end simulation program maps the texture thread through the texture context unique identifier and puts it into the texture thread pool of the back-end simulation program. When multiple services of the client system trigger texture-related GPU instructions in parallel, the back-end driver will wake up the texture thread corresponding to the texture unique identifier from the texture thread pool to process the GPU task of the texture separately. This solution is also applicable to the multi-screen design scenario of the client system. In addition, the texture thread corresponding to the high-priority texture has a higher priority CPU scheduling level, and the CPU scheduling level corresponding to the texture threads with the same texture priority is the same. In addition, the graphics card physical driver of the host system designs multiple scheduling queues corresponding to texture priorities by differentiating texture priorities, each scheduling queue corresponds to a texture priority, and the texture queue with a higher texture priority can jump the queue to submit texture tasks with low texture priority, ensuring that high-priority tasks are processed first. Thereby realizing the texture parallel processing process of the client system, while ensuring the relative fairness of the texture processing of the virtual graphics card.
[0052] Figure 1 A flowchart of a texture parallel processing method based on a virtual graphics card in an exemplary embodiment of the present application is shown, including steps S10 to S70, which can be executed by a host system in a Hypervisor environment.
[0053] First, execute steps S10 and S20 to obtain a first virtual GPU instruction for multiple applications or display services in the client system; create a texture context according to the first virtual GPU instruction, wherein each process creates a texture context, and different texture contexts are distinguished by a unique texture identifier.
[0054] This application is applicable to all automotive multi-system and multi-screen solutions based on Hypervisor technology. This scenario is currently common in the field of vehicle system integration, where the host refers to the physical computer running the virtual machine, and the host system as the client refers to the virtual machine running in the virtualized environment provided by the host. Taking the instrument system (as the host system) and the central control system (as the client system) running on the vehicle chip as an example, the performance optimization method based on the virtual graphics card is explained.
[0055] After the car system is powered on, the car chip SOC (System on Chip) boot program reads the Grub configuration table and loads the Hypervisor image, the host system kernel image and the root file system image. The host system has two main functions: one is to serve as a VMM (Virtual Machine Manager) and the other is to output the instrument interface content.
[0056] The host system acts as a VMM, initializes the backend simulation program, and starts each of the client systems. Specifically, the host system initializes each module of the device simulation process of the client system, mainly creating a virtual CPU, reserving memory space, and initializing each simulation device, etc., to ensure that the client system can operate normally in a virtualized environment. Instrument-related services are not within the scope of this application and are not described in detail.
[0057] The host system physical graphics card driver will pre-create and manage multiple texture scheduling queues through differentiated texture priorities, and set different texture priorities for these texture scheduling queues. That is, the host system will pre-create texture scheduling queues corresponding to different texture priorities in the physical graphics card driver. Among them, the tasks of the texture scheduling queue with high texture priority can queue up the tasks of the texture scheduling queue with low texture priority and submit them to the physical graphics card, ensuring that key graphics resources can be rendered first, improving user experience and application responsiveness.
[0058] Multiple applications or display services in the client system will create different texture contexts through the front-end driver. Specifically, when multiple applications or display services in the client system create different texture contexts through the front-end driver, the VIRTIO GPU instruction will be sent to the host system through the front-end driver, which is defined as the first virtual GPU instruction. After the host system obtains the first virtual GPU instruction of multiple applications or display services in the client system, it can create a texture context according to the first virtual GPU instruction. It should be noted that each process creates a texture context to manage texture resources within the process. Different texture contexts are distinguished by a unique texture identifier (texture ID for short), where the texture identifier is generated and managed by the physical graphics card driver of the host system to ensure its uniqueness and life cycle.
[0059] Next, step S30 is executed to create a corresponding texture thread according to the texture priority of the texture corresponding to the texture context, and put it into the texture thread pool. After the host system creates the texture context according to the first virtual GPU instruction, it will create a corresponding texture thread according to the texture priority corresponding to the texture context, and uniformly put the created texture threads into the texture thread pool, and will schedule the corresponding texture threads when the front-end driver texture processing task of the client system is triggered. The texture threads corresponding to the high-priority textures have a higher priority CPU scheduling level, and the CPU scheduling levels corresponding to the texture threads with the same texture priority are the same.
[0060] Specifically, Figure 2 As shown, creating a corresponding texture thread according to the texture priority of the texture corresponding to the texture context and placing it into the texture thread pool may further include steps S31 to S34:
[0061] Step S31: the host system determines whether the texture corresponding to the texture context is a high priority texture:
[0062] If yes, jump to step S32, use the backend simulation program to create a high-priority real-time texture thread (RT thread for short) to map the high-priority texture, ensure that the high-priority texture is simulated first and submitted to the physical graphics driver, and ensure that the high-priority graphics resources can be rendered in time, thereby improving the rendering performance of the application and the user experience;
[0063] If not, jump to step S33, use the backend simulation program to create a low-priority ordinary texture thread (step S33) to map the low-priority texture;
[0064] In step S34, the host system puts high and low priority texture threads into the thread pool through the backend simulation program to obtain the texture thread pool, and schedules the corresponding texture thread when the front-end driver texture processing task of the client system is triggered.
[0065] Next, steps S40 and S50 are executed to obtain second virtual GPU instructions for multiple applications or display services in the client system; and the second virtual GPU instructions are parsed to obtain a target texture identifier included in the second virtual GPU instructions.
[0066] In order to achieve image updates on different screens, multiple applications or display services of the client system will trigger multiple VIRTIO GPU instructions related to texture processing tasks through the front-end driver, which are defined as second virtual GPU instructions. The host system will obtain the second virtual GPU instructions and parse the second virtual GPU instructions to obtain the target texture identifier contained in the second virtual GPU instructions.
[0067] Next, step S60 is executed to wake up the target texture thread corresponding to the target texture identifier from the texture thread pool according to the target texture identifier.
[0068] Specifically, after obtaining the target texture identifier, the backend simulation program of the host system determines whether the target texture thread corresponding to the target texture identifier is running according to the target texture identifier:
[0069] If yes, it means that the target texture thread associated with the current target texture identifier is running, and the back-end simulation program of the host system puts the second virtual GPU instruction back into the message queue to wait until the simulation of the previous scheduled task corresponding to the target texture identifier is completed;
[0070] If not, it means that the target texture thread associated with the current target texture identifier is not running, and the backend simulation program of the host system will wake up the target texture thread corresponding to the target texture identifier from the texture thread pool according to the target texture identifier.
[0071] Next, step S70 is executed to distribute the tasks of the second virtual CPU instructions to the awakened target texture threads for parallel processing.
[0072] Specifically, after the back-end simulation program of the host system wakes up the target texture thread corresponding to the target texture identifier, it will distribute the task of the second virtual CPU instruction to the awakened target texture thread for parallel processing. After the parallel processing of different target texture threads is completed, the back-end simulation program of the host system will submit the real GPU task corresponding to the second virtual GPU instruction to the physical graphics card driver; the physical graphics card driver of the host system will insert the real GPU task corresponding to the second virtual GPU instruction into the texture scheduling queue of the corresponding priority for scheduling processing according to the texture priority.
[0073] In summary, the texture parallel processing method based on the virtual graphics card of the present application obtains the first virtual GPU instruction of multiple applications or display services in the client system; creates a texture context according to the first virtual GPU instruction, wherein each process creates a texture context, and different texture contexts are distinguished by a unique texture identifier; creates a corresponding texture thread according to the texture priority corresponding to the texture context to form a texture thread pool; obtains the second virtual GPU instruction of multiple applications or display services in the client system; parses the second virtual GPU instruction to obtain the target texture identifier contained in the second virtual GPU instruction; wakes up the target texture thread corresponding to the target texture identifier from the texture thread pool according to the target texture identifier; distributes the task of the second virtual CPU instruction to the awakened target texture thread for parallel processing; when the parallel processing of different target texture threads is completed, submits the real GPU task corresponding to the second virtual GPU instruction to the physical graphics card driver; inserts the real GPU task corresponding to the second virtual GPU instruction into the texture scheduling queue of the corresponding priority for scheduling processing according to the texture priority, realizes the texture parallel processing of the client system, and at the same time fully considers the urgency of different texture processing, makes full use of the limited texture pipeline resources of the virtual graphics card, and improves the display fluency and display performance of the Hypervisor virtualization solution.
[0074] like Figure 3 As shown, Figure 3 The functional module diagram of a preferred embodiment of the texture parallel processing device 11 based on a virtual graphics card of the present application is shown. The texture parallel processing device 11 based on a virtual graphics card is applied to a host system in a hypervisor environment, and includes a first instruction acquisition module 111, a cross-context creation module 112, a thread creation module 113, a second instruction acquisition module 114, an instruction parsing module 115, a thread wake-up module 116 and a task distribution processing module 117.
[0075] Among them, the first instruction acquisition module 111 is used to obtain the first virtual GPU instructions of multiple applications or display services in the client system; the context creation module 112 is used to create a texture context according to the first virtual GPU instruction, wherein each process creates a texture context, and different texture contexts are distinguished by a unique texture identifier; the thread creation module 113 is used to create a corresponding texture thread according to the texture priority corresponding to the texture context to form a texture thread pool; the second instruction acquisition module 114 is used to obtain the second virtual GPU instructions of multiple applications or display services in the client system; the instruction parsing module 115 is used to parse the second virtual GPU instruction to obtain the target texture identifier contained in the second virtual GPU instruction; the thread awakening module 116 is used to wake up the target texture thread corresponding to the target texture identifier from the texture thread pool according to the target texture identifier; the task distribution processing module 117 is used to distribute the task of the second virtual CPU instruction to the awakened target texture thread for parallel processing.
[0076] In this embodiment, the texture parallel processing device 11 based on the virtual graphics card also includes a scheduling queue creation module, which is used to pre-create texture scheduling queues corresponding to different texture priorities in the physical graphics card driver, wherein the tasks of the texture scheduling queue with high texture priority can be queued with the tasks of the texture scheduling queue with low texture priority and submitted to the physical graphics card; a real task submission module, which is used to submit the real GPU task corresponding to the second virtual GPU instruction to the physical graphics card driver after the parallel processing of different target texture threads is completed; and a scheduling processing module, which is used to insert the real GPU task corresponding to the second virtual GPU instruction into the texture scheduling queue of the corresponding priority for scheduling processing according to the texture priority.
[0077] It should be noted that the texture parallel processing device 11 based on a virtual graphics card of the present application is a system corresponding to the above-mentioned texture parallel processing method based on a virtual graphics card, and the functional modules in the texture parallel processing device 11 based on a virtual graphics card respectively correspond to the corresponding steps in the texture parallel processing method based on a virtual graphics card. The texture parallel processing device 11 based on a virtual graphics card of the present application can be implemented in coordination with the texture parallel processing method based on a virtual graphics card. The relevant technical details mentioned in the texture parallel processing method based on a virtual graphics card of the present application are still valid in the texture parallel processing device 11 based on a virtual graphics card, and in order to reduce repetition, they will not be repeated here. Accordingly, the relevant technical details mentioned in the texture parallel processing device 11 based on a virtual graphics card of the present application can also be applied to the above-mentioned texture parallel processing method based on a virtual graphics card.
[0078] like Figure 4The figure is a schematic diagram of the structure of an electronic device for implementing a texture parallel processing method based on a virtual graphics card in the present application.
[0079] The electronic device 1 may include a memory 12, a processor 13 and a bus, and may also include a computer program stored in the memory 12 and executable on the processor 13, such as a texture parallel processing program based on a virtual graphics card.
[0080] Among them, the memory 12 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 12 can be an internal storage unit of the electronic device 1, such as a mobile hard disk of the electronic device 1. In other embodiments, the memory 12 can also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 12 can also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 12 can not only be used to store application software and various types of data installed in the electronic device 1, such as the code for texture parallel processing based on a virtual graphics card, but can also be used to temporarily store data that has been output or is to be output.
[0081] In some embodiments, the processor 13 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and a combination of various control chips. The processor 13 is the control core (Control Unit) of the electronic device 1, and uses various interfaces and lines to connect various components of the entire electronic device 1, and executes or executes programs or modules stored in the memory 12 (such as a texture parallel processing program based on a virtual graphics card, etc.), and calls data stored in the memory 12 to execute various functions of the electronic device 1 and process data.
[0082] The processor 13 executes the operating system and various installed application programs of the electronic device 1. The processor 13 executes the application programs to implement the steps in the above-mentioned texture parallel processing method based on a virtual graphics card.
[0083] Exemplarily, the computer program may be divided into one or more modules, and the one or more modules are stored in the memory 12 and executed by the processor 13 to complete the texture parallel processing program based on the virtual graphics card of the present application. The one or more modules may be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device 1. For example, the computer program may be divided into a first instruction acquisition module 111, a cross-context creation module 112, a thread creation module 113, a second instruction acquisition module 114, an instruction parsing module 115, a thread wake-up module 116, a task distribution processing module 117, a scheduling queue creation module, a real task submission module, and a scheduling processing module.
[0084] It should be noted that the above-mentioned functional modules can be fully or partially integrated into one physical entity during actual implementation, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, some or all of the steps of the above method, or the above functional modules can be completed by hardware integrated logic circuits in the processor element or instructions in software form.
[0085] In the description herein, many specific details are provided, such as examples of parts and / or methods, to provide a complete understanding of the embodiments of the present application. However, those skilled in the art will recognize that the embodiments of the present application can be practiced without one or more specific details or by other devices, systems, components, methods, parts, materials, parts, etc. In other cases, known structures, materials or operations are not specifically shown or described in detail to avoid blurring the content of the embodiments of the present application.
[0086] The above description of the embodiment shown in the application (including the content described in the abstract of the specification) is not intended to be exhaustive or to limit the application to the precise form disclosed herein. Although the specific embodiment of the application and the example of the application are described herein for the purpose of illustration only, as those skilled in the art will recognize and understand, various equivalent modifications can be within the spirit and scope of the present invention. As pointed out, these modifications can be made to the application according to the above description of the embodiment described in the application, and these modifications will be within the spirit and scope of the application.
Claims
1. A texture parallel processing method based on a virtual graphics card, characterized in that: Applied to a host system in a Hypervisor environment, the method comprises: Obtaining first virtual GPU instructions for a plurality of applications or display services in a client system; Creating a texture context according to the first virtual GPU instruction, wherein each process creates a texture context, and different texture contexts are distinguished by a unique texture identifier; Creating a corresponding texture thread according to the texture priority of the texture corresponding to the texture context, and placing the thread into a texture thread pool; Obtaining second virtual GPU instructions for a plurality of applications or display services in the client system; Parsing the second virtual GPU instruction to obtain a target texture identifier included in the second virtual GPU instruction; According to the target texture identifier, waking up a target texture thread corresponding to the target texture identifier from the texture thread pool; The tasks of the second virtual CPU instructions are distributed to the awakened target texture threads for parallel processing.
2. The texture parallel processing method based on a virtual graphics card according to claim 1, characterized in that: The method further comprises: Create texture scheduling queues corresponding to different texture priorities in the physical graphics card driver in advance; Among them, tasks in a texture scheduling queue with a high texture priority can interrupt tasks in a texture scheduling queue with a low texture priority and submit them to the physical graphics card.
3. The texture parallel processing method based on a virtual graphics card according to claim 2, characterized in that: The method further comprises: When the parallel processing of different target texture threads is completed, submitting the real GPU task corresponding to the second virtual GPU instruction to the physical graphics card driver; According to the texture priority, the real GPU task corresponding to the second virtual GPU instruction is inserted into the texture scheduling queue of the corresponding priority for scheduling processing.
4. The texture parallel processing method based on a virtual graphics card according to claim 1, characterized in that: Creating a corresponding texture thread according to the texture priority of the texture corresponding to the texture context and placing it into a texture thread pool, including: Determine whether the texture corresponding to the texture context is a high priority texture: If so, create a high-priority real-time texture thread using the backend simulation program; If not, creating a low-priority normal texture thread using the backend simulation program; High and low priority texture threads are placed into the texture thread pool through the backend simulation program.
5. The texture parallel processing method based on a virtual graphics card according to claim 1, characterized in that: According to the target texture identifier, waking up a target texture thread corresponding to the target texture identifier from the texture thread pool, further comprising: According to the target texture identifier, determining whether the target texture thread corresponding to the target texture identifier is running: If yes, putting the second virtual GPU instruction back into the message queue to wait until the simulation of the previous scheduled task corresponding to the target texture identifier is completed; If not, waking up the target texture thread corresponding to the target texture identifier from the texture thread pool.
6. The texture parallel processing method based on a virtual graphics card according to claim 1, characterized in that: The host system is an instrument system arranged on the vehicle chip, and the client system is a central control system arranged on the vehicle chip.
7. A texture parallel processing device based on a virtual graphics card, characterized in that: Applied to a host system in a Hypervisor environment, the texture parallel processing device based on a virtual graphics card includes: A first instruction acquisition module, used to acquire first virtual GPU instructions for multiple applications or display services in the client system; A context creation module, configured to create a texture context according to the first virtual GPU instruction, wherein each process creates a texture context, and different texture contexts are distinguished by a unique texture identifier; A thread creation module, used for creating a corresponding texture thread according to the texture priority of the texture corresponding to the texture context, and putting the thread into a texture thread pool; A second instruction acquisition module, used to acquire second virtual GPU instructions for multiple applications or display services in the client system; an instruction parsing module, configured to parse the second virtual GPU instruction to obtain a target texture identifier included in the second virtual GPU instruction; A thread awakening module, used for awakening a target texture thread corresponding to the target texture identifier from the texture thread pool according to the target texture identifier; The task distribution processing module is used to distribute the task of the second virtual CPU instruction to the awakened target texture thread for parallel processing.
8. The texture parallel processing device based on a virtual graphics card according to claim 7, characterized in that: The device also includes: A scheduling queue creation module is used to pre-create texture scheduling queues corresponding to different texture priorities in the physical graphics card driver; wherein tasks of a texture scheduling queue with a high texture priority can be queued with tasks of a texture scheduling queue with a low texture priority and submitted to the physical graphics card; A real task submission module, configured to submit the real GPU task corresponding to the second virtual GPU instruction to the physical graphics card driver after the parallel processing of different target texture threads is completed; The scheduling processing module is used to insert the real GPU task corresponding to the second virtual GPU instruction into the texture scheduling queue of the corresponding priority for scheduling processing according to the texture priority.
9. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.