A pixel splitting method based on multi-GPU application
By adopting a pixel splitting method combining software and hardware in a multi-GPU environment, using the host processor for data transmission and processing, the problems of high complexity and low cost performance in the entire hardware mode are solved, and efficient pixel splitting is achieved.
Patent Information
- Application Number
- CN202211002003.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-20
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-08-20
AI Technical Summary
In a multi-GPU environment, the full hardware method is used to achieve pixel splitting function with high complexity and low cost performance, and there is a risk that some platforms cannot achieve.
Using a combination of software and hardware, a pixel splitting method based on multi-GPU applications is designed through the host processor as a bridge, including glReadPixels, glCopy* class and glGetHistogram/glGetMinmax pixel splitting method, and data transmission and processing are used by host drivers.
It realizes efficient and correct pixel splitting in multi-GPU environment, reducing implementation complexity and improving cost-effectiveness.
Smart Images

Figure CN115393168B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer graphics and relates to a host driver software design method based on multi-GPU pixel splitting, and in particular to a pixel splitting method based on multi-GPU application. Background Art
[0002] In the OpenGL API for multi-GPU parallel processing, there is a class of functions that are the most complex to design and implement, namely pixel splitting functions, which involve data transfer between multiple GPUs. If the pixel splitting function is performed in a multi-GPU environment using a full hardware approach, the implementation complexity is high and the cost-effectiveness is low. There is also a risk that some splitting functions may not be implemented due to reasons such as the PCIE modules of some domestic platforms not meeting the standards. This patent uses a combination of software and hardware, with the host processor as a bridge, to design a host pixel splitting method based on multi-GPU applications, to implement the functions of pixel splitting functions in a multi-GPU environment, and to solve the problems of high complexity and low cost-effectiveness of implementing pixel splitting functions in a multi-GPU environment using a full hardware approach. Summary of the Invention
[0003] Based on the problems existing in the background technology, the present invention provides a pixel splitting method based on multi-GPU applications. The pixel splitting design method based on multi-GPU applications of the present invention solves the problems of multi-GPU pixel splitting, including glReadPixels pixel splitting, glCopy* class pixel splitting, and glGetHistogram / glGetMinmax pixel splitting.
[0004] The technical solution of the present invention is: a pixel splitting method based on multi-GPU application, which is special in that it includes: a glReadPixels pixel splitting method, a glCopy* class pixel splitting method for realizing host-based software and hardware combined multi-GPU data transmission, and a glGetHistogram / glGetMinmax pixel splitting method.
[0005] The above glReadPixels pixel splitting method includes the following steps:
[0006] Step 1.1: The host driver is responsible for splitting the command;
[0007] Step 1.2: When splitting the glReadPixels command, the host driver calculates the host-side address, starting coordinates, width and height of each GPU without the influence of glPixelstore;
[0008] Step 1.3: The host marks the ownership of the split command;
[0009] The above glCopy* class pixel splitting method includes the following steps:
[0010] Step 2.1: When the host calculates, the distribution of the copy frame buffer data in each GPU frame buffer is calculated and the address is calculated;
[0011] Step 2.2: The host obtains the global frame buffer data that needs to be copied from multiple GPUs in sequence;
[0012] Step 2.3: Calculate the distribution of the acquired frame buffer data in the final target area, and calculate the address of each GPU frame buffer respectively;
[0013] Step 2.4: Write the obtained frame buffer data into the final area of each GPU frame buffer respectively.
[0014] The above glGetHistogram / glGetMinmax pixel splitting method includes the following steps:
[0015] Step 3.1: The host driver uses the glGetHistogram interface to traverse all grids in the current task and split them by GPU. After each GPU issues a get histogram command, the host driver calculates the sum of all GPU histogram statistics in the current task and returns it to the application.
[0016] Step 3.2: The host driver uses the glGetMinmax interface to traverse all grids in the current task and split them according to the GPU. After each GPU issues a get-minimum-maximum command, the host driver calculates and compares the maximum and minimum values of all GPUs in the current task and returns the compared maximum and minimum values to the application.
[0017] The above-mentioned glCopy* class pixel splitting method includes two data transfer operations, namely, the host obtains the multi-GPU frame buffer data in the global scope and the host writes the obtained frame buffer data into the final target address area of the frame buffer of each of the multiple GPUs; in order to enable the host to obtain the original data in the frame buffers of multiple GPUs, glCopyPixel sets the function glMGreadpixel for realizing the host frame buffer data reading function without IPU processing.
[0018] glReadPixel cannot be used to obtain frame data in the above glCopy* class pixel splitting method.
[0019] The advantages of the present invention are:
[0020] This invention provides a pixel splitting method based on multi-GPU applications. This invention correctly and efficiently implements this method. This patent uses a combination of hardware and software, using the host processor as a bridge, to address the high complexity and low cost-performance of implementing pixel splitting in a multi-GPU environment using a full hardware approach. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 A schematic structural diagram of the method of the present invention. DETAILED DESCRIPTION
[0022] The technical solutions of the present invention are clearly and completely described below in conjunction with the accompanying drawings and specific embodiments. The described embodiments are only a part of the embodiments of the present invention, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without making any creative efforts are within the scope of protection of the present invention.
[0023] See also Figure 1 A pixel splitting method based on multi-GPU applications includes the glReadPixels pixel splitting method, the glCopy* class pixel splitting method for realizing host-based software and hardware combined multi-GPU data transmission, and the glGetHistogram / glGetMinmax pixel splitting method.
[0024] The above glReadPixels pixel splitting method includes the following steps:
[0025] Step 1.1: The host driver is responsible for splitting the command;
[0026] Step 1.2: When splitting the glReadPixels command, the host driver calculates the host-side address, starting coordinates, width and height of each GPU without the influence of glPixelstore;
[0027] Step 1.3: The host marks the ownership of the split command;
[0028] The above glCopy* class pixel splitting method includes the following steps:
[0029] Step 2.1: When the host calculates, the distribution of the copy frame buffer data in each GPU frame buffer is calculated and the address is calculated;
[0030] Step 2.2: The host obtains the global frame buffer data that needs to be copied from multiple GPUs in sequence;
[0031] Step 2.3: Calculate the distribution of the acquired frame buffer data in the final target area, and calculate the address of each GPU frame buffer respectively;
[0032] Step 2.4: Write the obtained frame buffer data into the final area of each GPU frame buffer respectively.
[0033] The above glGetHistogram / glGetMinmax pixel splitting method includes the following steps:
[0034] Step 3.1: The host driver uses the glGetHistogram interface to traverse all grids in the current task and split them by GPU. After each GPU issues a get histogram command, the host driver calculates the sum of all GPU histogram statistics in the current task and returns it to the application.
[0035] Step 3.2: The host driver uses the glGetMinmax interface to traverse all grids in the current task and split them according to the GPU. After each GPU issues a get-minimum-maximum command, the host driver calculates and compares the maximum and minimum values of all GPUs in the current task and returns the compared maximum and minimum values to the application.
[0036] The glCopy* class pixel splitting method includes two data transfer operations, namely, the host obtains the multi-GPU frame buffer data in the global scope and the host writes the obtained frame buffer data into the final target address area of the frame buffer of each of the multiple GPUs; in order to enable the host to obtain the original data in the frame buffers of multiple GPUs, glCopyPixel sets the function glMGreadpixel for realizing the host frame buffer data reading function without IPU processing.
[0037] glReadPixel cannot be used to obtain frame data in the glCopy* class pixel splitting method.
[0038] It should be further explained that a pixel splitting method based on multi-GPU application is designed to solve the problems of high complexity and low cost performance of implementing pixel splitting function in a multi-GPU environment using a full hardware approach.
[0039] The solution of the present invention is:
[0040] A pixel splitting design method based on multi-GPU application, characterized in that the method includes (1) glReadPixels pixel splitting, (2) glCopy* class pixel splitting, (3) glGetHistogram / glGetMinmax pixel splitting;
[0041] 1) glReadPixels pixel splitting: The host gl driver is responsible for splitting the command. When splitting the glReadPixels command, the host gl driver calculates the host address, starting coordinates, width and height of each GPU without the influence of glPixelstore, and marks which GPU the split command belongs to.
[0042] 2) glCopy* class pixel splitting: In order to realize the host-based hardware and software combined multi-GPU data transmission, the implementation of the glCopyPixel class function needs to be split into several processes: (1) The host calculates the distribution of the frame buffer data to be copied in each GPU frame buffer and calculates the address; (2) The host obtains the global range frame buffer data to be copied from multiple GPUs in turn; (3) According to the final target area, the distribution of the obtained frame buffer data in the final target area is calculated, and the address of each GPU frame buffer is calculated respectively; (4) The obtained frame buffer data is written into the final area of each GPU frame buffer respectively.
[0043] There are two data transmission operations in the above process, namely (1) the host obtains the multi-GPU frame buffer data in the global scope; (2) the host writes the obtained frame buffer data to the final target address area of the frame buffer of each of the multiple GPUs. In order to enable the host to obtain the original data in the frame buffer of multiple GPUs (which cannot be processed by the IPU), for glCopyPixel, it is necessary to redefine a function glMGreadpixel with a function similar to glreadpixel to realize the host frame buffer data reading function without IPU processing. Note that glreadpixel cannot be used directly to obtain frame data, because the function of the glreadpixel function includes the processing of the frame data by the IPU, so that the host no longer obtains the original frame buffer data. The processing flow of the split glMGglDrawpixels, glMGColorTable, glMGColorSubTable, glMGConvolutionFilter1D, glMGConvolutionFilter2D, glMGTexImage2D, glMGTexImage1D, glMGTexSubImage3D, glMGTexSubImage2D, and glMGTexSubImage1D commands in the CMD driver software is similar to that of standard OpenGL commands, except that the influence of glPixelstore is not considered when configuring DMA channel parameters. In multi-GPU systems, to support glCopy* commands across multiple GPUs, the glCopy* commands are split into the custom functions shown in Table 1 below.
[0044] Table 1 Original functions and decomposition functions of data transfer functions between multiple GPUs
[0045]
[0046] The specific process of glMGReadpixels split by glCopy* class functions is similar to the splitting of glReadpixels under multiple GPUs. The difference is that the GL driver software configures the GL_PACK_ROW_LENGTH parameter of glPixelstore to the width of the glCopy* function before splitting, and does not consider the influence of glPixelstore and image processing subset when starting DMA.
[0047] 3) glGetHistogram / glGetMinmax pixel splitting: The host driver uses the glGetHistogram interface to traverse all grids in the current task and split them by GPU. After each GPU issues a Get Histogram command, the host driver calculates the sum of the histogram information of all GPUs in the current task and returns it to the application. The host driver uses the glGetMinmax interface to traverse all grids in the current task and split them by GPU. After each GPU issues a Get Maximum and Minimum command, the host driver calculates and compares the maximum and minimum values of all GPUs in the current task and returns the compared maximum and minimum values to the application.
[0048] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A pixel splitting method based on multi-GPU application, characterized by: Including glReadPixels pixel splitting method, glCopy* class pixel splitting method for realizing host-based hardware and software combined multi-GPU data transmission, and glGetHistogram / glGetMinmax pixel splitting method; The glReadPixels pixel splitting method includes the following steps: Step 1.1: The host driver is responsible for splitting the command; Step 1.2: When splitting the glReadPixels command, the host driver calculates the host-side address, starting coordinates, width and height of each GPU without the influence of glPixelstore; Step 1.3: The host marks the ownership of the split command; The glCopy* class pixel splitting method includes the following steps: Step 2.1: When the host calculates, the distribution of the copy frame buffer data in each GPU frame buffer is calculated and the address is calculated; Step 2.2: The host obtains the global frame buffer data that needs to be copied from multiple GPUs in sequence; Step 2.3: Calculate the distribution of the acquired frame buffer data in the final target area, and calculate the address of each GPU frame buffer respectively; Step 2.4: Write the obtained frame buffer data into the final area of each GPU frame buffer respectively; The glGetHistogram / glGetMinmax pixel splitting method includes the following steps: Step 3.1: The host driver uses the glGetHistogram interface to traverse all grids in the current task and split them by GPU. After each GPU issues a get histogram command, the host driver calculates the sum of all GPU histogram statistics in the current task and returns it to the application. Step 3.2: The host driver uses the glGetMinmax interface to traverse all grids in the current task and split them according to the GPU. After each GPU issues a get-minimum-maximum command, the host driver calculates and compares the maximum and minimum values of all GPUs in the current task and returns the compared maximum and minimum values to the application.
2. The pixel splitting method based on multi-GPU application according to claim 1, characterized in that: The glCopy* class pixel splitting method includes two data transfer operations, namely, the host obtains multi-GPU frame buffer data in a global range and the host writes the obtained frame buffer data into the final target address area of the frame buffer of each of the multiple GPUs; in order to enable the host to obtain the original data in the frame buffers of multiple GPUs, glCopyPixel sets the function glMGreadpixel for realizing the host frame buffer data reading function without IPU processing.
3. The pixel splitting method based on multi-GPU application according to claim 2, characterized in that: glReadPixel cannot be used to obtain frame data in the glCopy* class pixel splitting method.
Citation Information
Patent Citations
SystemC-based multi-GPU transaction-level model device and operation method
CN112559139A
Multi-mode parallel graphics processing systems and methods
WO2008082641A2