A GPU drawing function testing method based on BMP files

Through the BMP file-based test method, the test results and standard results of the GPU drawing function were compared, and the problem that the GPU drawing function could not be comprehensively evaluated in the existing technology was solved, and the accurate testing and problem identification of the GPU drawing function was realized, which helped improve the GPU driver.

CN114461522BActive Publication Date: 2025-01-17NO 709 RES INST OF CHINA SHIPBUILDING IND CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210073027.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-21
Publication Date
2025-01-17
Estimated Expiration
2042-01-21

Smart Images

  • Figure CN114461522B_ABST
    Figure CN114461522B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of computer technology, and in particular to a method for testing GPU drawing functions based on BMP files, the method comprising the following steps: according to the GPU drawing functions to be tested, a test function is designed for each GPU drawing function, a test function set is constructed, and a test program is written on a test host, wherein the test program can call all test functions in the test function set and save the test result output as a corresponding BMP file; a graphics card to be tested is connected to the test host, a corresponding GPU driver is loaded, the test program is compiled and run, and a BMP file corresponding to each GPU drawing function is obtained; the difference between each BMP file and a preset standard BMP file is compared to determine whether the GPU drawing function is perfect, and the imperfect GPU drawing functions are listed. The present invention conducts a comprehensive and accurate evaluation of the GPU drawing function; the problems and deficiencies in the GPU drawing function are determined and listed, and the driver developers are effectively helped to improve the GPU driver.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of computer graphics, and in particular to a GPU (Graphics Processing Unit, graphics processor) drawing function testing method based on BMP (Bitmap, bitmap) files. Background Art

[0002] With the development of technologies such as machine learning, the use of GPUs is increasing day by day, and GPU testing technology is becoming more and more important.

[0003] Most of the existing GPU testing processes simulate the performance limits of the GPU during actual operation by running written software and provide quantitative performance test evaluations. The test of GPU drawing function cannot accurately and specifically identify the problem, and the current conventional GPU performance test methods cannot comprehensively evaluate the GPU drawing function. Summary of the invention

[0004] In view of the defects of the prior art, the purpose of the present invention is to provide a GPU drawing function testing method based on BMP files, which is intended to efficiently and automatically complete the testing and sorting of graphics chips.

[0005] To solve the above problem, according to one aspect of the present invention, a method for testing a GPU drawing function based on a BMP file is provided, comprising the following steps:

[0006] S1: According to the GPU drawing function to be tested, a test function is designed for each GPU drawing function, a test function set is constructed, and a test program is written on the test host. The test program can call all the test functions in the test function set and save the test results as corresponding BMP files;

[0007] S2: Connect the graphics card to be tested to the test host, load the corresponding GPU driver, compile and run the test program, and obtain the BMP file corresponding to each GPU drawing function;

[0008] S3: Compare the differences between each BMP file and the preset standard BMP file to determine whether the GPU drawing function is complete, and list the incomplete drawing functions of the GPU.

[0009] Furthermore, the test functions in step S1 are all named after the functions being tested, and the BMP files corresponding to each GPU drawing function in step S2 are all named after the corresponding functions, for ease of maintenance.

[0010] Furthermore, in step S3, the method for comparing the differences between each BMP file and the preset standard BMP file is:

[0011] Read the BMP file obtained by the test program, and obtain its length, width and pixel values ​​of each point; read the corresponding preset standard BMP file, and obtain its length, width and pixel values ​​of each point; compare whether the length, width and pixel values ​​of the two read files are consistent.

[0012] Furthermore, the pixel value comparison method is to compare the difference between the pixel values ​​at the same position of the BMP file obtained by the test program and the preset standard BMP file with 0 to determine whether the pixel values ​​at the same position are equal.

[0013] Furthermore, the preset standard BMP file in step S3 is generated by a standard software drawing function, or is drawn and generated by a verified mature commercial graphics card.

[0014] Furthermore, in step S1, the test program uses a loop calling method to call all test functions in the test set in sequence.

[0015] Furthermore, in step S3, the method for comparing the differences between each BMP file and the preset standard BMP file is:

[0016] Check whether all BMP files have been read. If they have been read, the comparison ends. Otherwise, continue to read the BMP file generated by the next test function and repeatedly check whether all BMP files have been read until the comparison ends.

[0017] In general, the technical solution of the present invention is used to achieve the following beneficial effects compared with the prior art:

[0018] (1) A test function is designed for each drawing function to form a test function set, which comprehensively and accurately evaluates the GPU drawing function;

[0019] (2) By comparing the differences between the final GPU-drawn image and the standard image, the GPU drawing function can be quickly and accurately tested, and the problems and deficiencies can be identified and listed, which effectively helps driver developers improve the GPU driver. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 A flowchart of the GPU drawing function testing method provided by an embodiment of the present invention;

[0021] Figure 2 An overall flow chart of a GPU drawing function testing method provided by an embodiment of the present invention;

[0022] Figure 3 An architecture diagram of a graphics chip SLT system provided by an embodiment of the present invention;

[0023] Figure 4 This is a functional structure diagram of the core test board provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0025] like Figure 1 As shown, the GPU drawing function testing method based on BMP file provided by the embodiment of the present invention includes the following steps:

[0026] S1: Build a test program on the host. Design a test function for each GPU drawing function to form a test function set. The test functions are named after the tested functions. In the main program, a loop call is used to call all the test functions in the test set in sequence.

[0027] like Figure 2 As shown, step S1 includes the following sub-steps:

[0028] S11: Build the main program of the test program, run the main program, and perform preparations before testing;

[0029] S12: using the control variable method, a test function is designed for each GPU drawing function to form a GPU drawing function test function set, and the test functions are all named after the tested functions;

[0030] S13: calling all functions in the GPU drawing function test function set in sequence in the main program, and automatically saving the running result image of each function as a BMP file;

[0031] S2: Insert the graphics card to be tested into the host, load the GPU driver, compile and run the test program in S1, and after the test program is finished running, the running results of each test function in the test set are saved as a BMP file named after the function name.

[0032] like Figure 3 As shown, step S2 includes the following sub-steps:

[0033] S21: Insert the graphics card to be tested into the host and prepare the hardware environment;

[0034] S22: Load GPU driver;

[0035] S23: compile and run the test program in S1;

[0036] S24: Save the BMP file of all test result images;

[0037] S3: Compare the differences between the BMP files generated by each test function in S2 and the standard BMP files, determine whether the GPU drawing function is complete, and list the incomplete drawing functions of the GPU.

[0038] like Figure 4 As shown, step S3 includes the following sub-steps:

[0039] S31: The file comparison program starts to run, reads the BMP file generated by the first test program in S2, and obtains its length, width, pixel value of each point and other information;

[0040] S32: Read the standard comparison BMP file with the same name, and obtain information such as length, width, and pixel value of each point. The standard comparison BMP file can be generated by the drawing function of standard software, or by drawing and generating by a proven mature commercial graphics card;

[0041] S33: Compare the length, width, stored pixel values ​​and other information of the two read files to see if they are consistent. If they are consistent, it means that the GPU drawing function corresponding to the test function that generates the BMP file image has been perfected. If they are inconsistent, it means that the GPU drawing function needs to be improved. The comparison method is to compare the difference between the pixel values ​​at the same position of the two BMP files with 0 to determine whether the pixel values ​​at this position are equal. Compare the pixel values ​​at all positions in turn to see if they are equal, and determine whether the BMP file generated by the test program is consistent with the standard BMP file;

[0042] S34: Write the comparison result into a file for later review;

[0043] S35: Check whether all BMP files in S2 have been read. If they have been read, the comparison ends. Otherwise, continue to read the BMP file generated by the next test function in S2 and repeat steps S42 to S44;

[0044] S36: All BMP files in S2 have been read, and based on the comparison results in S41 to S45, the drawing functions that have passed and failed the GPU test are listed.

[0045] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A GPU drawing function testing method based on BMP files, characterized in that: The steps include: S1: According to the GPU drawing function to be tested, a test function is designed for each GPU drawing function, a test function set is constructed, and a test program is written on the test host. The test program can call all the test functions in the test function set and save the test results as corresponding BMP files; S2: Connect the graphics card to be tested to the test host, load the corresponding GPU driver, compile and run the test program, and obtain the BMP file corresponding to each GPU drawing function; S3: compare the differences between each BMP file and the preset standard BMP file, determine whether the GPU drawing function is complete, and list the incomplete drawing functions of the GPU; Wherein: the preset standard BMP file in step S3 is generated by a standard software drawing function, or is drawn and generated by a verified mature commercial graphics card.

2. The GPU drawing function testing method according to claim 1, wherein: In the step S1, the test functions are all named after the tested functions, and in the step S2, the BMP files corresponding to each GPU drawing function are all named after the corresponding function, which is convenient for maintenance.

3. The GPU drawing function testing method according to claim 1, wherein: The method for comparing the differences between each BMP file and the preset standard BMP file in step S3 is: Read the BMP file obtained by the test program, and obtain its length, width and pixel value of each point; Read the corresponding preset standard BMP file and obtain its length, width and pixel value of each point; Compare the length, width and pixel values ​​of the two read files to see if they are consistent.

4. The GPU drawing function testing method according to claim 3, characterized in that: The pixel value comparison method is to compare the difference between the pixel values ​​at the same position of the BMP file obtained by the test program and the preset standard BMP file with 0 to determine whether the pixel values ​​at the same position are equal.

5. The GPU drawing function testing method according to claim 1, wherein: In step S1, the test program uses a loop calling method to call all the test functions in the test set in sequence.

6. The GPU drawing function testing method according to claim 1, wherein: The method for comparing the differences between each BMP file and the preset standard BMP file in step S3 is: Check whether all BMP files have been read. If they have been read, the comparison ends. Otherwise, continue to read the BMP file generated by the next test function and repeatedly check whether all BMP files have been read until the comparison ends.

Citation Information

Patent Citations

  • Optimization method for rendering GUI in real time based on GPU characteristics

    CN110874856A

  • Target frame data acquisition method and device for GPU function verification and storage medium

    CN112686797A