Method for rendering focus window priority
Patent Information
- Application Number
- CN202310453845.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-25
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2043-04-25
AI Technical Summary
[0006]在当前类unix操作系统中,应用程序提交的GPU任务按照先进先出的规则被GPU调度器调度到GPU执行,当多个GPU密集型应用向显卡提交GPU任务,且GPU资源成为应用的性能瓶颈时,GPU密集型应用可能都会卡顿,而在实际的使用过程中,用户可能更多的只关心当前焦点窗口应用的性能,而对于非焦点窗口,可能已经被最小化或者被其它焦点窗口遮住了,用户并不太关心其性能,若此时非焦点窗口和焦点窗口分别获取同等的GPU资源,并导致焦点窗口卡顿,无疑浪费了GPU资源
[0011] This invention fully utilizes the basic framework of the extension protocol under the X framework, as well as the submission method of rendering tasks in the underlying graphics rendering library and the characteristics of the GPU scheduler. It sets the rendering priority of different GPU tasks and submits them to the GPU scheduler. When multiple GPU-intensive applications are running simultaneously and the GPU is the bottleneck of application performance, increasing the rendering priority of the focus window can improve the rendering frame rate of the corresponding application, that is, the smoothness of the application.
Smart Images

Figure CN116680046B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of focus window rendering performance optimization technology, and specifically to a method for prioritizing focus window rendering. Background Technology
[0002] When critical processes in the system require more CPU resources, the CPU scheduler allocates more CPU resources to these higher-priority processes by increasing their process priority. For example, in interactive graphics applications, the system should respond quickly when a user clicks on a screen. When GPU resources are limited, allocating more GPU resources to high-rendering-priority processes through the GPU scheduler is more user-friendly. Simultaneously, based on this framework, the system can also allocate more I / O resources to high-priority processes to improve the I / O throughput of I / O-intensive applications.
[0003] The invention relates to a GPU scheduler that, when two or more GPU-intensive applications are running simultaneously, GPU tasks submitted by higher-priority applications will be rendered by the GPU first. When GPU resources are limited and exhausted by multiple GPU-intensive applications, prioritizing the rendering of the focus window can improve the user experience.
[0004] Chinese invention patent (application number CN202011223743.7, "A GPU Scheduling Method and System Based on Asynchronous Data Transmission") proposes a GPU scheduling method and system based on asynchronous data transmission. In deep learning inference, asynchronously transmitting data from the CPU to the GPU with GPU computation significantly reduces latency. Therefore, this invention proposes a quantitative model with concurrency as the independent variable and system throughput and latency as dependent variables. Based on this model, a scheduling algorithm that utilizes two processes to hide data transmission latency is implemented to improve system performance. This invention does not involve a method for increasing the rendering priority of the focus window based on the GPU scheduler.
[0005] Chinese invention patent (application number CN201910209567.2, A GPU resource scheduling system and scheduling method thereof) discloses a GPU resource scheduling system and scheduling method thereof, comprising a GPU aggregate including multiple GPU nodes; a GPU invocation unit communicatively connected to the GPU aggregate and invoking the GPU nodes to form a GPU subset; and a resource management unit communicatively connected to the GPU aggregate and the GPU invocation unit, and invoking the GPU nodes to form a GPU scheduling subset, wherein the GPU invocation unit monitors the invocation information of the GPU nodes, and the resource measurement unit measures the GPUs in an inactive state and forms the GPU scheduling subset according to the user's resource requests. This invention does not involve a method for improving the rendering priority of the focus window based on a GPU scheduler.
[0006] In current Unix-like operating systems, GPU tasks submitted by applications are scheduled to the GPU for execution according to the first-in-first-out (FIFO) rule. When multiple GPU-intensive applications submit GPU tasks to the graphics card, and GPU resources become the performance bottleneck of the applications, the GPU-intensive applications may all lag. In actual use, users may only care about the performance of the application in the currently focused window, while the performance of non-focused windows may have been minimized or obscured by other focused windows, and users do not care much about their performance. If non-focused windows and focused windows are given equal GPU resources at this time, causing the focused window to lag, it is undoubtedly a waste of GPU resources.
[0007] Currently, domestically produced graphics cards are widely used on domestic hardware platforms. However, domestically produced graphics cards still lag behind AMD and NVIDIA in terms of GPU performance. At present, a large number of applications are based on AMD and NVIDIA graphics cards. When the graphics card is replaced by a domestically produced graphics card, the problem of the GPU becoming the bottleneck of application performance will become more prominent. Summary of the Invention
[0008] To address the shortcomings of existing technologies, this invention provides a method for improving the rendering priority of the focused window, comprising the following steps: Step S1: In the X framework, the client sends a request to the server's X extension protocol to obtain the process ID of the focused window; Step S2: The server uses its X extension protocol to call the interface provided by the client to obtain the process ID, obtains the process ID of the focus window, and returns the obtained process ID of the focus window to the client. Step S3: The client sets the priority of the process ID corresponding to the focused window to high through its priority setting program to improve the rendering priority of the focused window.
[0009] This also includes the following steps: Step S4: The underlying rendering library determines the priority of the process currently sending rendering commands through the priority setting program, sets the priority of the rendering commands sent by the corresponding process according to the process priority, and sends the priority of the rendering commands to the GPU scheduler so that the GPU scheduler can schedule the relevant GPUs according to the priority of the rendering commands.
[0010] In step S4, if the priority of the process currently sending the rendering command is greater than 0, the underlying rendering library increases the rendering priority of the GPU task when submitting the CPU task to the GPU scheduler; if the priority of the process currently sending the rendering command is less than 0, the underlying rendering library decreases the rendering priority of the GPU task when submitting the CPU task to the GPU scheduler.
[0011] This invention fully utilizes the basic framework of the extension protocol under the X framework, as well as the submission method of rendering tasks in the underlying graphics rendering library and the characteristics of the GPU scheduler. It sets the rendering priority of different GPU tasks and submits them to the GPU scheduler. When multiple GPU-intensive applications are running simultaneously and the GPU is the bottleneck of application performance, increasing the rendering priority of the focus window can improve the rendering frame rate of the corresponding application, that is, the smoothness of the application. Attached Figure Description
[0012] Figure 1 : Logical framework diagram of the method for improving the rendering priority of the focus window according to the present invention Figure 2 : Flowchart of the method for improving the rendering priority of the focus window according to the present invention. Detailed Implementation
[0013] To gain a better understanding of the technical solution and beneficial effects of the present invention, the technical solution of the present invention and its beneficial effects are described in detail below with reference to the accompanying drawings.
[0014] The terms and conventions used in this invention are explained and defined as follows: X Window System: Also known as the Xorg graphics server, the X Window System originated in the early 1980s and is the most basic graphical interactive system on Unix / Linux systems. The Xorg graphics server adopts a client / server design, possessing excellent flexibility and powerful functionality, and has become the default mainstream graphical interactive environment in Unix / Linux.
[0015] X Extension Protocols: The X Server defines 119 interfaces, with all interfaces beyond 128 reserved for extensions (#define EXTENSION_BASE 128). However, each extension may implement multiple interfaces, while ProcVector only provides one entry point for each extension. Therefore, if an extension protocol has multiple interfaces, it needs to distribute them manually. Each implementation of an extension protocol needs to be processed uniformly from its corresponding extension protocol entry point.
[0016] The GPU scheduler evolved from parts of AMD's code around 2018, transforming from an AMD-specific module into a shared GPU scheduling module for the DRM subsystem. The GPU scheduler contains multiple scheduling queues. GPU tasks are placed into different priority queues according to their rendering priority, and the scheduler prioritizes scheduling GPU tasks from the highest priority queues to the GPU for execution. GPU tasks are the graphics rendering tasks submitted by the application to the GPU; these tasks include the application's rendering requests.
[0017] The method for improving the rendering priority of the focus window in this invention is implemented by adding and calling the X extension protocol in the X framework through a background program. Specifically, the X extension protocol is used to obtain the process to which the focus window belongs, and this process is marked as a high-rendering-priority process. Simultaneously, the underlying graphics rendering library sets the GPU tasks submitted by this process as high-priority rendering tasks and submits them to the GPU scheduler. The GPU scheduler prioritizes submitting high-priority rendering tasks to the GPU for rendering. The X extension protocol utilizes the C / S model communication mechanism of X11 for data transmission: the client provides an interface to obtain the process ID of the focus window and sets the process priority of the process to which the focus window belongs. The server queries the current focus window and its process ID, and returns the process ID of the focus window to the client. In this invention, the client sends a request to the X server to obtain the process ID of the focus window via the X extension protocol. The X server queries the current focus window and returns the process ID to the client. After obtaining the process ID, the client sets the process priority of the process (e.g., ...). Figure 1 (As shown).
[0018] Figure 2 The flowchart of the complete implementation method for improving the rendering priority of the focus window according to the present invention is as follows: Figure 2 As shown, the method for improving the rendering priority of the focused window in this invention is based on the X framework and the underlying rendering library. A complete implementation method includes the following steps: 1. In the X framework, the client sends a request to the server's X extension protocol to obtain the process ID of the focused window; 2. The server uses its X extension protocol to call the interface provided by the client to obtain the process ID (specifically provided by the client's focus window library), obtains the process ID of the focus window on the client, and returns the obtained process ID of the focus window to the client. 3. The client uses its internal priority setting program to set the priority of the process ID corresponding to the focused window to high, thereby increasing the process priority of the focused window.
[0019] 4. The underlying rendering library determines the priority of the process currently sending rendering commands through a priority setting program. Based on the process priority, it sets the priority of the rendering commands sent by that process and sends the priority of the rendering commands to the GPU scheduler. The GPU scheduler then schedules the relevant GPUs according to the priority of the rendering commands. If the priority of the process currently sending rendering commands is greater than 0, the underlying rendering library increases the rendering priority of the GPU task when submitting the CPU task to the GPU scheduler. If the priority of the process currently sending rendering commands is less than 0, the underlying rendering library decreases the rendering priority of the GPU task when submitting the CPU task to the GPU scheduler.
[0020] This invention fully utilizes the basic framework of the extension protocol under the X framework, as well as the submission method of rendering tasks in the underlying graphics rendering library and the characteristics of the GPU scheduler. It sets the rendering priority of different GPU tasks and submits them to the GPU scheduler. When multiple GPU-intensive applications are running simultaneously and the GPU is the bottleneck of application performance, increasing the rendering priority of the focus window can improve the rendering frame rate of the corresponding application, that is, the smoothness of the application.
[0021] Although the present invention has been described using the above preferred embodiments, it is not intended to limit the scope of protection of the present invention. Any changes and modifications made by those skilled in the art to the above embodiments without departing from the spirit and scope of the present invention shall still fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be defined by the claims.
Claims
1. A method for increasing the rendering priority of the focus window, characterized in that... Includes the following steps: Step S1: In the X framework, the client sends a request to the server's X extension protocol to obtain the process ID of the focused window; Step S2: The server uses its X extension protocol to call the interface provided by the client to obtain the process ID, obtains the process ID of the focus window, and returns the obtained process ID of the focus window to the client. Step S3: The client sets the priority of the process ID corresponding to the focused window to high through its priority setting program to improve the rendering priority of the focused window.
2. The method for increasing the rendering priority of the focus window as described in claim 1, characterized in that... It also includes the following steps: Step S4: The underlying rendering library determines the priority of the process currently sending rendering commands through the priority setting program, sets the priority of the rendering commands sent by the corresponding process according to the process priority, and sends the priority of the rendering commands to the GPU scheduler so that the GPU scheduler can schedule the relevant GPUs according to the priority of the rendering commands.
3. The method for increasing the rendering priority of the focus window as described in claim 1, characterized in that: In step S4, if the priority of the process currently sending the rendering command is greater than 0, the underlying rendering library increases the rendering priority of the GPU task when submitting the CPU task to the GPU scheduler; if the priority of the process currently sending the rendering command is less than 0, the underlying rendering library decreases the rendering priority of the GPU task when submitting the CPU task to the GPU scheduler.
Citation Information
Patent Citations
GPU resource scheduling system and scheduling method thereof
CN109933433A
A GPU scheduling method and system based on asynchronous data transmission
CN112346866B
Real-time image extraction method
CN109821236A
Multi-window display method based on interaction priority
CN115802092A