Graphic processor performance test method and device, electronic equipment and storage medium

By obtaining the graphics processor model and determining the sampling interface, obtaining performance data and generating performance change curves or performing offline analysis, the problems of low compatibility and difficulty in reproducing graphics processor performance testing tools in the prior art are solved, and high efficiency is achieved. Reliable graphics processor performance testing and optimization.

CN119201568APending Publication Date: 2024-12-27ZHUHAI KINGSOFT ONLINE GAME TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411264784.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

In the prior art, the graphics processor performance testing tool has low compatibility and cannot meet diverse test scenarios. Testers need to physically connect to terminal devices, which is high learning cost and difficult to accurately reproduce performance bottleneck scenarios, which affects testing efficiency and reliability. .

Method used

By obtaining the graphics processor model of the target device, determining the corresponding sampling interface, obtaining performance data, and generating performance change curves online or performing offline analysis, performance testing of different models of graphics processors is realized, reducing labor costs and improving testing Efficiency and reliability.

Benefits of technology

The graphics processor performance test of real-time running programs is realized, without additional physical connections, high compatibility, can intuitively lock performance bottleneck scenarios, automatically locate performance problems, reduce labor costs, and improve the efficiency of graphics processor performance optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201568A_ABST
    Figure CN119201568A_ABST
Patent Text Reader

Abstract

The invention provides a graphics processor performance testing method and device, electronic equipment and a storage medium, and the graphics processor performance testing method comprises the steps: obtaining a graphics processor model of target equipment, determining a corresponding target sampling interface according to the graphics processor model, obtaining graphics processor performance data of the target equipment through the target sampling interface; and generating a graphics processor performance change curve on line according to the graphics processor performance data, or performing offline analysis on the graphics processor performance data to obtain a graphics processor performance analysis result. The method improves the performance test efficiency and reliability of the graphics processor, thereby improving the performance optimization efficiency of the graphics processor, and can be widely applied to the technical field of graphics processors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of graphics processor technology, and in particular to a graphics processor performance testing method, device, electronic equipment and storage medium. Background Art

[0002] In the performance optimization of terminal applications, the analysis and optimization of graphics processing unit (GPU) performance often relies on the collection of relevant performance data of the graphics processor. Since the graphics processors of different terminals are from different manufacturers and models, the test tools and version numbers used by different terminals are often different. However, each graphics processor manufacturer only provides test tools that are compatible with the graphics processors they produce, which have low compatibility and cannot meet the diverse graphics processor performance test scenarios. In addition, the test tools provided by each graphics processor manufacturer need to be physically connected to the terminal to be tested, and the performance bottleneck scenario must be reproduced on the terminal to be tested in order to collect useful test data. For testers, the learning cost of the test tools is high, the operation is inconvenient, and there is a risk of not being able to accurately reproduce the performance bottleneck scenario, which affects the efficiency and reliability of the graphics processor performance test, thereby affecting the efficiency of the graphics processor performance optimization. Summary of the invention

[0003] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention provides a method, device, electronic device and storage medium for testing performance of a graphics processor, which improves the efficiency and reliability of the performance test of the graphics processor, thereby improving the efficiency of optimizing the performance of the graphics processor.

[0004] In a first aspect, an embodiment of the present invention provides a method for testing performance of a graphics processor, comprising:

[0005] Obtaining a graphics processor model of a target device, determining a corresponding target sampling interface according to the graphics processor model, and then obtaining graphics processor performance data of the target device through the target sampling interface;

[0006] A graphics processor performance change curve is generated online according to the graphics processor performance data, or the graphics processor performance data is analyzed offline to obtain a graphics processor performance analysis result.

[0007] According to some embodiments of the present invention, acquiring a graphics processor model of a target device and determining a corresponding target sampling interface according to the graphics processor model includes:

[0008] Obtain the graphics processor model through a device control interface function;

[0009] Determining whether the target graphics processor of the target device opens a bottom-level data acquisition interface according to the graphics processor model;

[0010] When the target graphics processor opens the underlying data acquisition interface, a data acquisition encapsulation interface is determined as the target sampling interface, wherein the data acquisition encapsulation interface is an interface obtained by encapsulating the graphics processor counter acquisition interface provided by the hardware manufacturer as an open source;

[0011] When the target graphics processor does not open the underlying data collection interface, a function call interface is determined as the target sampling interface, wherein the function call interface is used to perform performance counter data sampling on the graphics processor through a data collection function.

[0012] According to some embodiments of the present invention, when the target sampling interface is the data acquisition encapsulation interface, acquiring the graphics processor performance data of the target device through the target sampling interface includes:

[0013] Calling the data acquisition encapsulation interface and the preset data clearing encapsulation interface according to a pre-configured sampling interval, so that the sampling thread obtains the performance counter periodic sampling data of the target graphics processor through the underlying data acquisition interface;

[0014] The performance counter periodic sampling data is matched according to a pre-configured target performance counter type to obtain performance counter sampling value increment data corresponding to the target performance counter type in the current sampling period, and then the performance counter sampling value increment data is determined as the graphics processor performance data.

[0015] According to some embodiments of the present invention, when the target sampling interface is the function calling interface, obtaining the graphics processor performance data of the target device through the target sampling interface includes:

[0016] Calling the function call interface according to a preconfigured sampling interval and target performance counter type, so that the sampling thread obtains the performance counter sampling value corresponding to the target performance counter type through the data acquisition function;

[0017] According to the performance counter sampling values ​​at the current sampling moment and the previous sampling moment, the performance counter sampling value increment data corresponding to the target performance counter type in the current sampling period is determined, and then the performance counter sampling value increment data is determined as the graphics processor performance data.

[0018] According to some embodiments of the present invention, before acquiring the graphics processor performance data of the target device through the target sampling interface, the graphics processor performance testing method further includes:

[0019] Determine the target performance counter type, the sampling interval and the test mode according to the configuration table;

[0020] Among them, the test mode is an online test mode or an offline test mode, the online test mode is configured to generate a graphics processor performance change curve online according to the graphics processor performance data, and the offline test mode is configured to perform offline analysis on the graphics processor performance data to obtain a graphics processor performance analysis result.

[0021] According to some embodiments of the present invention, generating a graphics processor performance change curve online according to the graphics processor performance data includes:

[0022] Determine, according to the graphics processor performance data, performance counter sampling value increment data corresponding to a plurality of target performance counter types in different sampling periods;

[0023] Generate a performance counter sampling curve according to the performance counter sampling value increment data, and update the performance counter sampling curve in real time according to the performance counter sampling value increment data of the current sampling period;

[0024] The performance counter sampling curves corresponding to each target performance counter type are rendered and time-axis aligned to obtain the graphics processor performance change curve.

[0025] According to some embodiments of the present invention, after generating the graphics processor performance change curve online according to the graphics processor performance data, the graphics processor performance testing method further includes:

[0026] When the incremental data of the performance counter sampling value is greater than or equal to a preset abnormal threshold, the corresponding performance counter sampling curve is rendered as a preset warning color.

[0027] According to some embodiments of the present invention, the step of performing offline analysis on the graphics processor performance data to obtain a graphics processor performance analysis result includes:

[0028] Determine, according to the graphics processor performance data, performance counter sampling value increment data corresponding to a plurality of target performance counter types in different sampling periods;

[0029] Traversing the performance counter sampling value increment data according to a preset offline analysis script to determine whether the performance counter sampling value increment data is less than a preset abnormal threshold;

[0030] When the performance counter sampling value increment data is less than the abnormal threshold, it is determined that the performance of the graphics processor in the corresponding sampling period is normal;

[0031] When the performance counter sampling value increment data is greater than or equal to the abnormal threshold, it is determined that the performance of the graphics processor in the corresponding sampling period is abnormal.

[0032] According to some embodiments of the present invention, when the performance counter sampling value increment data is greater than or equal to the abnormal threshold, the graphics processor performance testing method further includes:

[0033] The target device is subjected to graphics processor performance anomaly location according to the target performance counter type corresponding to the performance counter sampling value increment data, and then the graphics processor performance anomaly root cause analysis is performed on the target device according to the preset anomaly determination rule to obtain an anomaly root cause analysis result.

[0034] In a second aspect, an embodiment of the present invention provides a graphics processor performance testing device, comprising:

[0035] A data acquisition module is configured to obtain a graphics processor model of a target device, determine a corresponding target sampling interface according to the graphics processor model, and then obtain the graphics processor performance data of the target device through the target sampling interface;

[0036] The data analysis module is configured to generate a graphics processor performance change curve online according to the graphics processor performance data, or to perform offline analysis on the graphics processor performance data to obtain a graphics processor performance analysis result.

[0037] In a third aspect, an embodiment of the present invention provides an electronic device, comprising at least one control processor and a memory for communicating with the at least one control processor, the memory storing instructions executable by the at least one control processor, the instructions being executed by the at least one control processor so that the at least one control processor can execute the graphics processor performance testing method as described in the first aspect above.

[0038] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the graphics processor performance testing method as described in the first aspect above.

[0039] The advantages and beneficial effects of the present invention will be partly given in the following description, partly become apparent from the following description, or be understood through the practice of the present invention:

[0040] The embodiment of the present invention obtains the graphics processor model of the target device, determines the corresponding target sampling interface according to the graphics processor model, and then obtains the graphics processor performance data of the target device through the target sampling interface, and then generates a graphics processor performance change curve online according to the graphics processor performance data, or performs offline analysis on the graphics processor performance data to obtain the graphics processor performance analysis result. The embodiment of the present invention determines the corresponding target sampling interface according to the graphics processor model of the target device, and then obtains the graphics processor performance data of the target device through the target sampling interface. The graphics processor performance test can be directly performed on the target device running the program in real time without the need to establish an additional physical connection, and can meet the performance test of different models of graphics processors, with high compatibility; by generating the graphics processor performance change curve online, the tester can intuitively lock the performance bottleneck scenario, obtain the graphics processor performance analysis result through offline analysis, and can also automatically locate the performance bottleneck scenario without having to reproduce the performance bottleneck scenario on the target device multiple times, thereby reducing labor costs, improving the efficiency and reliability of the graphics processor performance test, and thus improving the efficiency of the graphics processor performance optimization. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solution in the embodiments of the present invention, the following introduction is made to the drawings required for use in the embodiments of the present invention. It should be understood that the drawings introduced below are only for the convenience of clearly describing some embodiments of the technical solution of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0042] Figure 1 is a flow chart of a method for testing performance of a graphics processor provided by an embodiment of the present invention;

[0043] Figure 2 is a flow chart of step S101 provided in an embodiment of the present invention;

[0044] Figure 3 is another flow chart of step S101 provided in an embodiment of the present invention;

[0045] Figure 4 is another flow chart of step S101 provided in an embodiment of the present invention;

[0046] Figure 5 is another flow chart of a method for testing performance of a graphics processor provided by an embodiment of the present invention;

[0047] Figure 6 is a flow chart of step S102 provided in an embodiment of the present invention;

[0048] Figure 7is another flow chart of a method for testing performance of a graphics processor provided by an embodiment of the present invention;

[0049] Figure 8 is another flow chart of step S102 provided in an embodiment of the present invention;

[0050] Fig. 9 is another flow chart of a method for testing performance of a graphics processor provided by an embodiment of the present invention;

[0051] Fig.10 is a schematic diagram of the structure of a graphics processor performance testing device provided by an embodiment of the present invention;

[0052] Fig.11 It is a structural block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solutions 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 intended to limit the present invention. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present invention. They are only examples of devices and methods consistent with some aspects of the embodiments of the present invention as detailed in the attached claims.

[0054] It is understood that the terms "first", "second", etc. used in the present invention may be used herein to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of the present invention, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0055] The terms "at least one", "multiple", "each", "any", etc. used in the present invention, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.

[0056] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein are only for the purpose of describing the embodiments of the present invention and are not intended to limit the present invention.

[0057] Before describing the embodiments of the present invention in detail, some nouns and terms involved in the embodiments of the present invention are first described. The nouns and terms involved in the embodiments of the present invention are subject to the following explanations.

[0058] Central Processing Unit (CPU): As the computing and control core of a computer system, it is the final execution unit for information processing and program execution. Since its creation, the CPU has made great progress in logical structure, operating efficiency, and functional extension.

[0059] Graphics processing unit (GPU): also known as display core, visual processor, display chip, is a microprocessor that specializes in image and graphics related computing on personal computers, workstations, game consoles and some mobile devices (such as tablets, smart phones, etc.). GPU reduces the graphics card's dependence on the CPU and performs some of the original CPU's work, especially in 3D graphics processing. The core technologies used by GPU include hardware T&L (geometry transformation and lighting processing), cubic environment material mapping and vertex blending, texture compression and bump mapping, dual texture four-pixel 256-bit rendering engine, etc., and hardware T&L technology can be said to be the hallmark of GPU. The main manufacturers of GPU are NVIDIA and AMD.

[0060] Performance counter: refers to a set of hardware units that monitor the behavior of modules such as the GPU core and video memory when running a specific program on the GPU. The existence of performance counters is a requirement of software APIs such as DirectX, OpenGL, and Vulkan, and GPU manufacturers need to support them. In addition, when writing and optimizing game programs, game developers need to see how the program runs on specific GPU hardware, analyze its bottlenecks, and then improve the program, which also requires the use of performance counters. A single performance counter can only reflect one aspect of system performance, and the analysis of performance test results must be based on multiple different types of counters.

[0061] In the performance optimization of terminal applications, the analysis and optimization of graphics processor performance often depends on the collection of relevant performance data of graphics processors. Since graphics processors of different terminals are produced by different manufacturers and models, the test tools and version numbers used by different terminals are often different. However, each graphics processor manufacturer only provides test tools that are compatible with the graphics processors produced by itself, which have low compatibility and cannot meet the diverse graphics processor performance test scenarios. In addition, the test tools provided by each graphics processor manufacturer need to be physically connected to the terminal to be tested, and the performance bottleneck scenario must be reproduced on the terminal to be tested in order to collect useful test data. For testers, the learning cost of the test tools is high, the operation is inconvenient, and there is a risk of not being able to accurately reproduce the performance bottleneck scenario, which affects the efficiency and reliability of graphics processor performance testing, thereby affecting the efficiency of graphics processor performance optimization.

[0062] In view of this, the embodiment of the present invention provides a method, device, electronic device and storage medium for testing the performance of a graphics processor, which obtains the graphics processor model of a target device, determines the corresponding target sampling interface according to the graphics processor model, and then obtains the graphics processor performance data of the target device through the target sampling interface, and then generates a graphics processor performance change curve online according to the graphics processor performance data, or performs offline analysis on the graphics processor performance data to obtain the graphics processor performance analysis result. The embodiment of the present invention determines the corresponding target sampling interface according to the graphics processor model of the target device, and then obtains the graphics processor performance data of the target device through the target sampling interface, which can directly perform a graphics processor performance test on the target device running the program in real time without the need to establish an additional physical connection, and can meet the performance test of graphics processors of different models, with high compatibility; by generating the graphics processor performance change curve online, the tester can intuitively lock the performance bottleneck scenario, obtain the graphics processor performance analysis result through offline analysis, and can also automatically locate the performance bottleneck scenario, without the need to reproduce the performance bottleneck scenario multiple times on the target device, reducing the labor cost, improving the efficiency and reliability of the graphics processor performance test, and thus improving the efficiency of the graphics processor performance optimization.

[0063] The graphics processor performance test method provided in the embodiment of the present invention can be applied to the terminal, can also be applied to the server side, and can also be software running in the terminal or the server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a set-top box, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the graphics processor performance test method, etc., but is not limited to the above forms.

[0064] The present invention can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like. The present invention can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. The present invention can also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0065] like Figure 1 FIG. 1 is a flow chart of a method for testing the performance of a graphics processor according to an embodiment of the present invention. Figure 1 , an embodiment of the present invention provides a method for testing performance of a graphics processor, including but not limited to steps S101 to S102:

[0066] S101, obtaining a graphics processor model of a target device, determining a corresponding target sampling interface according to the graphics processor model, and then obtaining graphics processor performance data of the target device through the target sampling interface;

[0067] S102: Generate a graphics processor performance change curve online according to the graphics processor performance data, or perform offline analysis on the graphics processor performance data to obtain a graphics processor performance analysis result.

[0068] Specifically, the embodiment of the present invention first obtains the graphics processor model of the target device, determines the corresponding target sampling interface according to the graphics processor model, and then obtains the graphics processor performance data of the target device through the target sampling interface. Then, the graphics processor performance data is subsequently processed according to the current test mode. Specifically, if the current test mode is online, a graphics processor performance change curve is generated online according to the graphics processor performance data. The graphics processor performance change curve can intuitively display the performance status of the graphics processor of the target device, and can be refreshed in real time, which is convenient for testers to lock the performance bottleneck scene in real time; if the current test mode is offline, the graphics processor performance data is offline analyzed to obtain the graphics processor performance analysis result. The graphics processor performance analysis result can automatically locate and record the performance bottleneck scene, and form a graphics processor performance test report, which is convenient for testers to check later.

[0069] It can be recognized that the embodiment of the present invention determines the corresponding target sampling interface according to the graphics processor model of the target device, and then obtains the graphics processor performance data of the target device through the target sampling interface, so that the graphics processor performance test can be directly performed on the target device running the program in real time, without the need to establish an additional physical connection, and can meet the performance test of graphics processors of different models, with high compatibility; by generating the graphics processor performance change curve online, the tester can intuitively lock the performance bottleneck scenario, obtain the graphics processor performance analysis result through offline analysis, and automatically locate the performance bottleneck scenario, without the need to reproduce the performance bottleneck scenario on the target device multiple times, thereby reducing labor costs, improving the efficiency and reliability of graphics processor performance testing, and thus improving the efficiency of graphics processor performance optimization.

[0070] like Figure 2 FIG. 1 is a flow chart of step S101 provided in an embodiment of the present invention, referring to FIG. Figure 2 In some embodiments of the present invention, obtaining a graphics processor model of a target device and determining a corresponding target sampling interface according to the graphics processor model include but are not limited to steps S1011 to S1014:

[0071] S1011, obtaining the model of the graphics processor through the device control interface function;

[0072] S1012, judging whether the target graphics processor of the target device has an open underlying data acquisition interface according to the graphics processor model;

[0073] S1013, when the target graphics processor opens the underlying data acquisition interface, determine the data acquisition encapsulation interface as the target sampling interface, wherein the data acquisition encapsulation interface is an interface obtained by encapsulating the graphics processor counter acquisition interface provided by the hardware manufacturer as an open source;

[0074] S1014: When the target graphics processor does not open the underlying data collection interface, determine the function call interface as the target sampling interface, wherein the function call interface is used to perform performance counter data sampling on the graphics processor through the data collection function.

[0075] Specifically, the embodiment of the present invention obtains the GPU model of the currently running device through kernel calls, mainly through the _IOWR macro defined by the Linux kernel to assist in generating an IOCTL (device control interface function) command code, and obtains the GPU model of the target device based on the IOCTL command code. The obtained GPU model can be used as a basis for subsequently determining the sampling interface that needs to be called.

[0076] It should be noted that IOCTL is a function in the device driver that manages the I / O channel of the device. When the device is running, it may require that data be written continuously. If the WRITE function is still used to write instructions at this time, data discontinuity may occur, causing the sound card to play music stuck, the movie to play unsmoothly, etc. The embodiment of the present invention uses the IOCTL function to specifically send or receive instructions to the driver layer to avoid this situation, so that the normal operation of the application of the target device can be not affected when the graphics processor performance test is performed on the target device.

[0077] In addition, in order to decouple the game engine, the embodiment of the present invention does not use the interface for obtaining the GPU model provided by the game engine, but obtains the GPU model of the target device through a kernel system call. This does not rely on a specific game engine and has a low degree of coupling with the engine code, thereby improving the maintainability and reusability of the graphics processor performance testing method of the embodiment of the present invention.

[0078] Before obtaining the performance data of the graphics processor of the target device, the embodiment of the present invention determines whether the target graphics processor of the target device opens the underlying data collection interface according to the GPU model of the target device, thereby calling different sampling interfaces to perform performance counter data sampling. When the GPU model of the target device is a GPU model for which the hardware manufacturer opens the underlying data collection interface, such as the Arm Mali GPU series, the embodiment of the present invention pre-encapsulates the GPU counter collection interface provided by the hardware manufacturer as open source, and determines the encapsulated data collection encapsulation interface as the target sampling interface; when the GPU model of the target device is a GPU model for which the hardware manufacturer does not open the underlying data collection interface, such as the Adreno GPU series, the embodiment of the present invention calls the command code of the data collection function through the function call interface of the IOCTL system at the kernel layer to sample the GPU performance counter.

[0079] It should be recognized that the embodiments of the present invention can switch different sampling interfaces to perform performance counter data sampling according to the GPU model of the target device, and can be compatible with different models of GPUs produced by different manufacturers, thereby avoiding frequent replacement of test tools due to compatibility issues during the test process, and improving the efficiency and reliability of graphics processor performance testing.

[0080] like Figure 3 FIG. 1 is another flow chart of step S101 provided in an embodiment of the present invention, referring to FIG. Figure 3 In some embodiments of the present invention, when the target sampling interface is a data acquisition encapsulation interface, obtaining the graphics processor performance data of the target device through the target sampling interface includes but is not limited to steps S1015 to S1016:

[0081] S1015, calling a data collection encapsulation interface and a preset data clearing encapsulation interface according to a pre-configured sampling interval, so that the sampling thread obtains the performance counter periodic sampling data of the target graphics processor through the underlying data collection interface;

[0082] S1016: Match the performance counter period sampling data according to the pre-configured target performance counter type to obtain the performance counter sampling value increment data corresponding to the target performance counter type in the current sampling period, and then determine the performance counter sampling value increment data as the graphics processor performance data.

[0083] Specifically, the sampling interval is the time interval between each sampling and the previous sampling, and the target performance counter type is the performance counter type concerned by this graphics processor performance test. Both the sampling interval and the performance counter type can be configured in advance.

[0084] In some embodiments of the present invention, each time a pre-configured sampling interval is reached, the sampling thread will call the data acquisition encapsulation interface and the data clearing encapsulation interface in sequence. The data acquisition encapsulation interface obtains the performance counter sampling value of the target graphics processor by connecting to the underlying data acquisition interface of the target device. The data clearing encapsulation interface is used to clear the performance counter sampling value to zero, thereby ensuring that the performance counter periodic sampling data collected each time is the incremental data generated within the time interval between the current sampling and the previous sampling; then, the performance counter periodic sampling data is matched according to the pre-configured target performance counter type to obtain the performance counter sampling value incremental data corresponding to the target performance counter type within the time interval between the current sampling and the previous sampling, and the performance counter sampling value incremental data is the graphics processor performance data.

[0085] like Figure 4 FIG. 1 is another flow chart of step S101 provided in an embodiment of the present invention, referring to FIG. Figure 4In some embodiments of the present invention, when the target sampling interface is a function call interface, obtaining the graphics processor performance data of the target device through the target sampling interface includes but is not limited to steps S1017 to S1018:

[0086] S1017, calling a function call interface according to a pre-configured sampling interval and target performance counter type, so that the sampling thread obtains a performance counter sampling value corresponding to the target performance counter type through a data collection function;

[0087] S1018. Determine the incremental data of the performance counter sampling value corresponding to the target performance counter type in the current sampling period according to the performance counter sampling values ​​at the current sampling time and the previous sampling time, and then determine the incremental data of the performance counter sampling value as the graphics processor performance data.

[0088] Specifically, the kernel defines four macros, _IO(), _IOR(), IOW(), and _IOWR(), to assist in generating command codes for data collection functions. First, a counter sampling context structure gpu_context is created based on the pre-configured target performance counter type. The structure contains a list of counters to be sampled, the previous counter sampling value prev_values, the number of samplers, and the ID of the current GPU (i.e., GPU model). Based on this context structure, each time a pre-configured sampling interval is reached, the sampling thread executes a call to the data collection function through the function call interface, and inputs the obtained performance counter sampling value into the context structure gpu_context. Combined with the previous counter sampling value prev_values ​​in the context structure gpu_context, the incremental data of the performance counter sampling value within the sampling interval is calculated, and the previous counter sampling value prev_values ​​is updated. Then, the obtained incremental data of the performance counter sampling value is broadcasted back to the processing function for subsequent processing.

[0089] like Figure 5 FIG. 1 is another flow chart of a method for testing the performance of a graphics processor according to an embodiment of the present invention. Figure 5 In some embodiments of the present invention, before obtaining the graphics processor performance data of the target device through the target sampling interface, the graphics processor performance testing method further includes:

[0090] S100, determining the target performance counter type, sampling interval and test mode according to the configuration table;

[0091] Among them, the test mode is an online test mode or an offline test mode. The online test mode is configured to generate a graphics processor performance change curve online according to the graphics processor performance data, and the offline test mode is configured to perform offline analysis on the graphics processor performance data to obtain a graphics processor performance analysis result.

[0092] Specifically, the embodiment of the present invention can pre-set the target performance counter types that need to be sampled in the configuration table, support the simultaneous collection of multiple target performance counter types, and collect up to more than 300 counter types; this item can also be left unset, and the initialized performance counter type setting is used by default, including commonly used GPU performance counter types, such as GPU activity cycles, Non-fragment queue active, Fragment queue active, Memorybandwidth usage, Geometry usage, Geometry culling rate, etc.

[0093] In some optional embodiments, the embodiments of the present invention may also pre-set a sampling interval in the configuration table to control the frequency and period of performance counter sampling; this item may also not be set, and a default value of 100 milliseconds is used as the sampling interval.

[0094] In some optional embodiments, the configuration table of the embodiment of the present invention also supports setting a real-time curve control switch to start an online test mode. The online test mode is configured to generate a graphics processor performance change curve online based on the graphics processor performance data. The graphics processor performance change curve can intuitively display the graphics processor performance status of the target device and can be refreshed in real time, which is convenient for testers to lock in performance bottleneck scenarios in real time; the full data collection switch can also be set to start an offline test mode. The offline test mode is configured to perform offline analysis on the graphics processor performance data to obtain a graphics processor performance analysis result. The graphics processor performance analysis result can automatically locate and record the performance bottleneck scenario to form a graphics processor performance test report, which is convenient for testers to review later.

[0095] like Figure 6 FIG. 1 is a flow chart of step S102 provided in an embodiment of the present invention, referring to FIG. Figure 6 In some embodiments of the present invention, the graphics processor performance change curve is generated online according to the graphics processor performance data, including but not limited to steps S1021 to S1023:

[0096] S1021, determining, according to the graphics processor performance data, performance counter sampling value increment data corresponding to a plurality of target performance counter types in different sampling periods;

[0097] S1022, generating a performance counter sampling curve according to the performance counter sampling value increment data, and updating the performance counter sampling curve in real time according to the performance counter sampling value increment data of the current sampling period;

[0098] S1023: Render and time-axis align the performance counter sampling curves corresponding to each target performance counter type to obtain a graphics processor performance change curve.

[0099] Specifically, different target performance counter types have corresponding performance counter sampling curves, and the colors of the curves are different (and different from the pre-set warning colors). The rightmost side of the performance counter sampling curve is the incremental data of the performance counter sampling value of the current sampling period. The curve is refreshed in real time from right to left. Below the curve coordinate system, the counter description and the incremental data of the performance counter sampling value of the current sampling period are displayed. The text color is the same as the color of the corresponding curve. The performance counter sampling curve corresponding to each target performance counter type is rendered and aligned with the time axis to obtain the performance change curve of the graphics processor.

[0100] In some optional embodiments, when the real-time curve control switch in the configuration table is turned on, a graphics processor performance change curve drawing stage is added after the post-processing stage of the rendering pipeline. Its rendering level is located at the top and will not be blocked. The graphics processor performance change curve displays the incremental data of the performance counter sampling values ​​collected within the sampling interval in real time. The horizontal axis of the coordinate system of the graphics processor performance change curve represents time, and the vertical axis represents the incremental data of the performance counter sampling values.

[0101] like Figure 7 FIG. 1 is another flow chart of a method for testing the performance of a graphics processor according to an embodiment of the present invention. Figure 7 In some embodiments of the present invention, after generating the graphics processor performance change curve online according to the graphics processor performance data, the graphics processor performance testing method further includes:

[0102] S103: When the incremental data of the performance counter sampling value is greater than or equal to a preset abnormal threshold, the corresponding performance counter sampling curve is rendered in a preset warning color.

[0103] Specifically, if the incremental data of the performance counter sampling value in the current sampling period reaches a preset abnormal threshold, the color of the curve and the corresponding text below will change to a preset warning color (such as red) to remind the tester that there is a suspected performance bottleneck in the current scenario.

[0104] It can be seen that by setting abnormal thresholds and real-time dynamic rendering of the GPU performance change curve, performance bottleneck scenarios can be located quickly, accurately and intuitively, reducing labor costs, improving the efficiency and reliability of GPU performance testing, and thus improving the efficiency of GPU performance optimization.

[0105] like Figure 8 FIG. 1 is another flow chart of step S102 provided in an embodiment of the present invention, referring to FIG. Figure 8 In some embodiments of the present invention, offline analysis of the graphics processor performance data is performed to obtain a graphics processor performance analysis result, including but not limited to steps S1024 to S1027:

[0106] S1024, determining, according to the graphics processor performance data, performance counter sampling value increment data corresponding to a plurality of target performance counter types in different sampling periods;

[0107] S1025. Traverse the performance counter sampling value increment data according to the preset offline analysis script to determine whether the performance counter sampling value increment data is less than a preset abnormal threshold;

[0108] S1026: When the incremental data of the performance counter sampling value is less than the abnormal threshold, it is determined that the performance of the graphics processor in the corresponding sampling period is normal;

[0109] S1027: When the incremental data of the performance counter sampling value is greater than or equal to the abnormal threshold, it is determined that the performance of the graphics processor in the corresponding sampling period is abnormal.

[0110] Specifically, when the full data collection switch in the configuration table is turned on, the data will be recorded in the counter_data data structure during collection. Each target performance counter type corresponds to a counter_data data structure, which records the data type (number of cycles or percentage), as well as a long integer list and a double-precision floating-point number list used to record the counter values ​​collected during the sampling interval. These data will be automatically saved locally, and then traversed and analyzed using a pre-configured offline analysis script to generate a GPU performance analysis report.

[0111] It should be noted that the automatic analysis of the offline analysis script is a code judgment of common GPU performance problems in performance optimization. For example, when the value of the visible primitive rate counter in geometry culling is greater than or equal to the preset abnormal threshold (such as 50%), it can be determined that the graphics processor performance of the corresponding sampling period is abnormal. Therefore, the offline analysis script can replace the human eye to observe data fluctuations to obtain corresponding conclusions to a certain extent, reducing labor costs, improving the efficiency and reliability of graphics processor performance testing, and thus improving the efficiency of graphics processor performance optimization.

[0112] like Fig. 9 FIG. 1 is another flow chart of a method for testing the performance of a graphics processor according to an embodiment of the present invention. Figure 7 In some embodiments of the present invention, when the performance counter sampling value increment data is greater than or equal to the abnormal threshold, the graphics processor performance testing method further includes:

[0113] S104: locate the graphics processor performance anomaly of the target device according to the target performance counter type corresponding to the performance counter sampling value increment data, and then perform a graphics processor performance anomaly root cause analysis on the target device according to a preset anomaly determination rule to obtain an anomaly root cause analysis result.

[0114] Specifically, when the offline analysis script traverses to the performance counter sampling value increment data that is greater than or equal to the abnormal threshold, the graphics processor performance abnormality of the target device can be located according to the target performance counter type corresponding to the performance counter sampling value increment data, and the root cause analysis of the graphics processor performance abnormality of the target device can be performed according to the preset abnormality judgment rules. For example, when the value of the Visible primitive rate counter in geometry culling is greater than or equal to the preset abnormal threshold (such as 50%), it can be located that the geometry culling is the cause of the graphics processor performance abnormality. Further combined with the preset abnormality judgment rules, it can be determined that back face culling is turned off at this time, thereby giving the abnormal root cause of the back face culling setting abnormality.

[0115] It should be noted that the exception judgment rules are obtained in advance by collecting, analyzing and summarizing common GPU performance problems in GPU performance optimization, which will not be described in detail in the embodiments of the present invention; the exception judgment rules can be implemented through code, and can also be written into an offline analysis script to perform graphics processor performance exception location and root cause analysis.

[0116] In some optional embodiments, for problems that cannot be automatically identified by the current exception judgment rules, AI can generate rule judgment script code in the form of text descriptions and put it in the automatic analysis path in a unified naming format. During automatic analysis, these rule judgment code files will be traversed for data processing. The next time the same problem occurs, the root cause analysis of the graphics processor performance exception can be automatically performed.

[0117] The above is an explanation of the method steps of the embodiment of the present invention. It can be recognized that the embodiment of the present invention determines the corresponding target sampling interface according to the graphics processor model of the target device, and then obtains the graphics processor performance data of the target device through the target sampling interface, which can directly perform graphics processor performance testing on the target device running the program in real time without the need to establish an additional physical connection, and can meet the performance testing of different models of graphics processors, with high compatibility; by generating the graphics processor performance change curve online, the tester can intuitively lock the performance bottleneck scenario, obtain the graphics processor performance analysis result through offline analysis, and can also automatically locate the performance bottleneck scenario, without the need to reproduce the performance bottleneck scenario on the target device multiple times, reducing labor costs, improving the efficiency and reliability of graphics processor performance testing, and thus improving the efficiency of graphics processor performance optimization.

[0118] Compared with the prior art, the embodiments of the present invention also have the following advantages:

[0119] 1) In terms of performance, the optimization and analysis tools provided by various manufacturers often need to be physically connected to a computer and started through the tool itself. When a problem is found, it is necessary to manually connect to the computer and restart the program to obtain performance data and analyze it. The embodiment of the present invention can directly enable the test function for the real-time running program without the need for additional physical connection and other operations. When the real-time curve turns red, the problem scene can be intuitively locked without the need to reproduce the acquisition problem multiple times. It also supports offline automatic analysis to assist in locating bottlenecks, thereby improving performance;

[0120] 2) In terms of coupling with the engine, the acquisition part of the embodiment of the present invention is developed in C++, accessing the query counter related interface library provided by the hardware manufacturer in open source, and querying the GPU model and the query of the non-open source counter are both implemented through kernel system calls, which is independent of the specific game engine and has a low coupling with the engine code. The analysis part is developed in Python, which is independent of any function of the game engine and can be run only on a machine with Python environment installed;

[0121] 3) In terms of self-growth, the offline analysis function of the embodiment of the present invention is equipped with an initial automated analysis rule script, which can automatically analyze some common GPU performance problems corresponding to data fluctuations. For situations that cannot be automatically analyzed, the corresponding rule script can be generated by AI through manual description, that is, small sample corpus training. When the same problem is encountered later, it can automatically analyze and give a conclusion, so that the offline automatic analysis function of the embodiment of the present invention has a growth attribute;

[0122] 4) In terms of usability, the embodiment of the present invention only needs simple configuration operations to enable the collection of GPU performance counters and real-time curve feedback. Offline automated analysis only needs to copy the data files in the mobile device to a device that supports Python and run the analysis script, which is convenient for performance optimization and developers to get started with. The learning cost is extremely low, and there is no need to learn to use the complex GPU performance analysis tools provided by various manufacturers, no physical connection is required, and there is no need to frequently switch different performance analysis tools for different models of GPUs from different manufacturers during performance analysis;

[0123] 5) In terms of compatibility, for GPUs of different manufacturers and models, there is no need to worry about whether different versions of different tools are compatible with the GPU. Testers can focus more on the testing work itself without having to consider compatibility issues between manufacturers and models.

[0124] like Fig.10 FIG. 1 is a schematic diagram of a structure of a graphics processor performance test device provided by an embodiment of the present invention, referring to FIG. Fig.10 , an embodiment of the present invention provides a graphics processor performance testing device, comprising:

[0125] The data acquisition module is configured to obtain a graphics processor model of a target device, determine a corresponding target sampling interface according to the graphics processor model, and then obtain the graphics processor performance data of the target device through the target sampling interface;

[0126] The data analysis module is configured to generate a graphics processor performance change curve online according to the graphics processor performance data, or to perform offline analysis on the graphics processor performance data to obtain a graphics processor performance analysis result.

[0127] The above is a schematic scheme of a graphics processor performance test device of this embodiment. It should be noted that the technical scheme of the graphics processor performance test device and the technical scheme of the graphics processor performance test method described above belong to the same concept, and the details of the technical scheme of the graphics processor performance test device that are not described in detail can be found in the description of the technical scheme of the graphics processor performance test method described above, and the beneficial effects achieved are also the same as the beneficial effects achieved by the above method embodiment.

[0128] like Fig.11 FIG. 1 is a block diagram of an electronic device provided by an embodiment of the present invention, referring to FIG. Fig.11 , an embodiment of the present invention provides an electronic device 1100, including but not limited to a memory 1110 and a processor 1120, the processor 1120 and the memory 1110 are connected via a bus 1130, and a database 1150 is used to store data.

[0129] The processor 1110 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided by the embodiments of the present invention.

[0130] The memory 1120 may be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1120 may store an operating system and other application programs. When the technical solution provided in the embodiments of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1120, and is called by the processor 1110 to execute the graphics processor performance test method of the embodiment of the present invention.

[0131] The electronic device 1100 also includes an access device 1140 that enables the electronic device 1100 to communicate via one or more networks 1160. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 1140 may include one or more of any type of network interface (e.g., a network interface card (NIC)) that is wired or wireless, such as an IEEE 1102.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0132] In some embodiments of the present invention, the above components of the electronic device 1100 and Fig.11 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig.11 The electronic device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present invention. Those skilled in the art can add or replace other components as needed.

[0133] The electronic device 1100 may be any type of stationary or mobile electronic device, including a mobile computer or mobile electronic device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable electronic device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary electronic device such as a desktop computer or a PC. The electronic device 1100 may also be a mobile or stationary server.

[0134] The above is a schematic scheme of an electronic device of this embodiment. It should be noted that the technical scheme of the electronic device and the technical scheme of the above-mentioned graphics processor performance test method belong to the same concept, and the details not described in detail in the technical scheme of the electronic device can be found in the description of the technical scheme of the above-mentioned graphics processor performance test method, and the beneficial effects achieved are also the same as those achieved by the above-mentioned method embodiment.

[0135] An embodiment of the present invention further provides a storage medium, which is a computer-readable storage medium and stores a computer program. When the computer program is executed by a processor, the above-mentioned graphics processor performance testing method is implemented.

[0136] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0137] The embodiment of the present invention further provides a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes Figure 1 The method shown.

[0138] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the above-mentioned boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part for which is described as a larger operation is performed independently.

[0139] In addition, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise specified to the contrary, one or more of the above-mentioned functions and / or features can be integrated into a single physical device and / or software module, or one or more functions and / or features can be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present invention. More specifically, in view of the properties, functions and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional skills of the engineer. Therefore, those skilled in the art can implement the present invention set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.

[0140] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the above methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0141] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0142] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the above-mentioned program is printed, since the above-mentioned program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or processing in other suitable ways as necessary, and then stored in a computer memory.

[0143] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0144] In the above description of this specification, the description with reference to the terms "one embodiment / example", "another embodiment / example" or "certain embodiments / examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0145] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.

[0146] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.

Claims

1. A method for testing performance of a graphics processor, characterized in that: include: Obtaining a graphics processor model of a target device, determining a corresponding target sampling interface according to the graphics processor model, and then obtaining graphics processor performance data of the target device through the target sampling interface; A graphics processor performance change curve is generated online according to the graphics processor performance data, or the graphics processor performance data is analyzed offline to obtain a graphics processor performance analysis result.

2. The method for testing the performance of a graphics processor according to claim 1, wherein: The step of obtaining a graphics processor model of a target device and determining a corresponding target sampling interface according to the graphics processor model includes: Obtain the graphics processor model through a device control interface function; Determining whether the target graphics processor of the target device opens a bottom-level data acquisition interface according to the graphics processor model; When the target graphics processor opens the underlying data acquisition interface, a data acquisition encapsulation interface is determined as the target sampling interface, wherein the data acquisition encapsulation interface is an interface obtained by encapsulating the graphics processor counter acquisition interface provided by the hardware manufacturer as an open source; When the target graphics processor does not open the underlying data collection interface, a function call interface is determined as the target sampling interface, wherein the function call interface is used to perform performance counter data sampling on the graphics processor through a data collection function.

3. The method for testing the performance of a graphics processor according to claim 2, wherein: When the target sampling interface is the data acquisition encapsulation interface, acquiring the graphics processor performance data of the target device through the target sampling interface includes: Calling the data acquisition encapsulation interface and the preset data clearing encapsulation interface according to a pre-configured sampling interval, so that the sampling thread obtains the performance counter periodic sampling data of the target graphics processor through the underlying data acquisition interface; The performance counter periodic sampling data is matched according to a pre-configured target performance counter type to obtain performance counter sampling value increment data corresponding to the target performance counter type in the current sampling period, and then the performance counter sampling value increment data is determined as the graphics processor performance data.

4. The method for testing the performance of a graphics processor according to claim 2, wherein: When the target sampling interface is the function calling interface, obtaining the graphics processor performance data of the target device through the target sampling interface includes: Calling the function call interface according to a preconfigured sampling interval and target performance counter type, so that the sampling thread obtains the performance counter sampling value corresponding to the target performance counter type through the data acquisition function; According to the performance counter sampling values ​​at the current sampling moment and the previous sampling moment, the performance counter sampling value increment data corresponding to the target performance counter type in the current sampling period is determined, and then the performance counter sampling value increment data is determined as the graphics processor performance data.

5. The method for testing the performance of a graphics processor according to claim 3 or 4, characterized in that: Before acquiring the graphics processor performance data of the target device through the target sampling interface, the graphics processor performance testing method further includes: Determine the target performance counter type, the sampling interval and the test mode according to the configuration table; Among them, the test mode is an online test mode or an offline test mode, the online test mode is configured to generate a graphics processor performance change curve online according to the graphics processor performance data, and the offline test mode is configured to perform offline analysis on the graphics processor performance data to obtain a graphics processor performance analysis result.

6. The method for testing the performance of a graphics processor according to claim 1, wherein: The step of generating a graphics processor performance change curve online according to the graphics processor performance data includes: Determine, according to the graphics processor performance data, performance counter sampling value increment data corresponding to a plurality of target performance counter types in different sampling periods; Generate a performance counter sampling curve according to the performance counter sampling value increment data, and update the performance counter sampling curve in real time according to the performance counter sampling value increment data of the current sampling period; The performance counter sampling curves corresponding to each target performance counter type are rendered and time-axis aligned to obtain the graphics processor performance change curve.

7. The method for testing the performance of a graphics processor according to claim 6, wherein: After generating the graphics processor performance change curve online according to the graphics processor performance data, the graphics processor performance testing method further includes: When the incremental data of the performance counter sampling value is greater than or equal to a preset abnormal threshold, the corresponding performance counter sampling curve is rendered as a preset warning color.

8. The method for testing the performance of a graphics processor according to claim 1, wherein: The offline analysis of the graphics processor performance data to obtain a graphics processor performance analysis result includes: Determine, according to the graphics processor performance data, performance counter sampling value increment data corresponding to a plurality of target performance counter types in different sampling periods; Traversing the performance counter sampling value increment data according to a preset offline analysis script to determine whether the performance counter sampling value increment data is less than a preset abnormal threshold; When the performance counter sampling value increment data is less than the abnormal threshold, it is determined that the performance of the graphics processor in the corresponding sampling period is normal; When the performance counter sampling value increment data is greater than or equal to the abnormal threshold, it is determined that the performance of the graphics processor in the corresponding sampling period is abnormal.

9. The method for testing the performance of a graphics processor according to claim 8, wherein: When the performance counter sampling value increment data is greater than or equal to the abnormal threshold, the graphics processor performance testing method further includes: The target device is subjected to graphics processor performance anomaly location according to the target performance counter type corresponding to the performance counter sampling value increment data, and then the graphics processor performance anomaly root cause analysis is performed on the target device according to the preset anomaly determination rule to obtain an anomaly root cause analysis result.

10. A graphics processor performance testing device, characterized in that: include: A data acquisition module is configured to obtain a graphics processor model of a target device, determine a corresponding target sampling interface according to the graphics processor model, and then obtain the graphics processor performance data of the target device through the target sampling interface; The data analysis module is configured to generate a graphics processor performance change curve online according to the graphics processor performance data, or to perform offline analysis on the graphics processor performance data to obtain a graphics processor performance analysis result.

11. An electronic device, characterized in that: It includes at least one control processor and a memory for communicating with the at least one control processor, the memory storing instructions executable by the at least one control processor, the instructions being executed by the at least one control processor so that the at least one control processor can execute the graphics processor performance testing method as described in any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the graphics processor performance testing method according to any one of claims 1 to 9.