Analyzing method and analyzing system for graphics process of graphic application program

09953393 ยท 2018-04-24

Assignee

Inventors

Cpc classification

International classification

Abstract

An analyzing method and an analyzing system for graphics process are provided. The analyzing method includes the following steps. A graphics application program is provided and a plurality of graphics parameters of the graphics application program are obtained. The graphics application program is classified to be at least one of a plurality of groups according to the graphics parameters. A plurality weighting coefficients are obtained. A total loading of a graphics processing unit for performing the graphics application program is calculated according to the weighting coefficients and the graphics parameters.

Claims

1. An analyzing method for graphics process, comprising: providing a plurality of reference graphics application programs and a plurality of reference graphics parameters of each of the reference graphics application programs; grouping the reference graphics application programs based on the reference graphics parameters into a plurality of groups; training a classifying relationship between the reference application graphics application programs and the groups according to the reference graphics parameters; and analyzing a relative relationship between a plurality of loadings of a plurality of hardware components of a graphic processing unit and the reference graphics parameters by calculating weighting coefficients of each of the groups and the plurality of hardware components; wherein the reference graphics parameters include general parameters, geometry parameters, and fragment parameters, the general parameters being different than the geometry parameters and the fragment parameters.

2. The analyzing method for graphics process according to claim 1, wherein in the step of grouping the reference graphics application programs into the groups, the reference graphics application programs are grouped according to a K-means algorithm, an Expectation-maximization algorithm, a Highly Connected Subgraphs clustering algorithm, a Connectivity based clustering algorithm, or a hierarchical clustering algorithm.

3. The analyzing method for graphics process according to claim 1, wherein in the step of training the classifying relationship between the reference graphics application programs and the groups, the classifying relationship is trained according to an artificial neural network algorithm, or a Support Vector Machine algorithm.

4. An analyzing method for graphics process, comprising: providing a current graphics application program and obtaining a plurality of current graphics parameters of the current graphics application program; classifying the current graphics application program to be at least one of a plurality of groups according to the current graphics parameters of the current graphics application program and obtaining a plurality of weighting coefficients according to the at least one of the plurality of groups and a plurality of hardware components of a graphic processing unit; and calculating a total loading of the graphic processing unit for performing the current graphics application program according to the weighting coefficients and the current graphics parameters of the current graphics application program; wherein the current graphics parameters include general parameters, geometry parameters and fragment parameters, the general parameters being different than the geometry parameters and the fragment parameters.

5. The analyzing method for graphics process according to claim 4, further comprising: providing a plurality of reference graphics application programs and a plurality of reference graphics parameters of each of the reference graphics application programs; grouping the reference graphics application programs into the groups; and training a classifying relationship between the reference graphics application programs and the groups according to the reference graphics parameters.

6. The analyzing method for graphics process according to claim 5, wherein in the step of grouping the reference graphics application programs into the groups, the reference graphics application programs are grouped according to a K-means algorithm, an Expectation-maximization algorithm, a Highly Connected Subgraphs clustering algorithm, a Connectivity based clustering algorithm, or a hierarchical clustering algorithm.

7. The analyzing method for graphics process according to claim 5, wherein in the step of training the classifying relationship between the reference graphics application programs and the groups, the classifying relationship is trained according to an artificial neural network algorithm, or a Support Vector Machine algorithm.

8. The analyzing method for graphics process according to claim 4, wherein each of the hardware components of the graphics processing unit processes the current graphics application program by a loading, and the total loading is obtained by summing up the loadings of the hardware components according to the weighting coefficients.

9. The analyzing method for graphics process according to claim 8, wherein there is a relative relationship between each of the loadings and the weighting coefficients, and the relative relationship is a linear relationship, a Polynomial regression relationship, a Logarithmic regression relationship, or an Exponential regression relationship.

10. The analyzing method for graphics process according to claim 4, wherein the total loading is a power consumption or a time consumption.

11. An analyzing system for graphics process, comprising: a parameter capturing unit, configured to capture a plurality of reference graphics parameters of each of a plurality of reference graphics application programs; a grouping unit, configured to group the reference graphics application programs into a plurality of groups based on the reference graphics parameters; a classifier, configured to train a classifying relationship between the reference graphics application programs and the groups according to the reference graphics parameters; and a relative information unit, configured to analyze a relative relationship between a plurality of loadings of a plurality of hardware components of a graphic processing unit and the reference graphics parameters by calculating weighting coefficients of each of the groups and the plurality of hardware components; wherein the reference graphics parameters include general parameters, geometry parameters and fragment parameters, the general parameters being different than the geometry parameters and the fragment parameters.

12. The analyzing system for graphics process according to claim 11, wherein the grouping unit groups the reference graphics application programs according to a K-means algorithm, an Expectation-maximization algorithm, a Highly Connected Subgraphs clustering algorithm, a Connectivity based clustering algorithm, or a hierarchical clustering algorithm.

13. The analyzing system for graphics process according to claim 11, wherein the classifier trains the classifying relationship according to an artificial neural network algorithm, or a Support Vector Machine algorithm.

14. An analyzing system for graphics process, comprising: a parameter capturing unit, configured to obtain a plurality of current graphics parameters of a current graphics application program; a classifier, configured to classify the current graphics application program to be at least one of a plurality of groups according to the current graphics parameters of the current graphics application program and obtain a plurality of weighting coefficients according to the at least one of the plurality of groups and a plurality of hardware components of a graphic processing unit; and a calculating unit, configured to calculate a total loading of the graphics processing unit for performing the current graphics application program according to the weighting coefficients and the current graphics parameters of the current graphics application program; wherein the current graphics parameters include general parameters, geometry parameters and fragment parameters, the general parameters being different than the geometry parameters and the fragment parameters.

15. The analyzing system for graphics process according to claim 14, wherein the parameter capturing unit obtains a plurality of reference graphics parameters of each of a plurality of reference graphics application programs, the system further comprises: a grouping unit, configured to group the reference graphics application programs into the groups, wherein the classifier trains a classifying relationship between the reference graphics application programs and the groups according to the reference graphics parameters.

16. The analyzing system for graphics process according to claim 15, wherein the grouping unit groups the reference graphics application programs according to a K-means algorithm, an Expectation-maximization algorithm, a Highly Connected Subgraphs clustering algorithm, a Connectivity based clustering algorithm, or a hierarchical clustering algorithm.

17. The analyzing system for graphics process according to claim 15, wherein the classifier trains the classifying relationship according to an artificial neural network algorithm, or a Support Vector Machine algorithm.

18. The analyzing system for graphics process according to claim 14, wherein each of the hardware components of the graphics processing unit processes the current graphics application program by a loading, and the total loading is obtained by summing up the loadings of the hardware components according to the weighting coefficients.

19. The analyzing system for graphics process according to claim 18, further comprising: a relative information unit, configured to analyze a relative relationship between each of the loadings and the weighting coefficients, and the relative relationship is a linear relationship, a Polynomial regression relationship, a Logarithmic regression relationship, or an Exponential regression relationship.

20. The analyzing system for graphics process according to claim 14, wherein the total loading is a power consumption or a time consumption.

Description

BRIEF DESCRIPTION OF THE DRAWINGS

(1) FIG. 1 shows an analyzing system for graphics process according to one embodiment.

(2) FIG. 2A shows an analyzing system for graphics process according another embodiment.

(3) FIG. 2B shows an analyzing system for graphics process according to another embodiment.

(4) FIG. 3 shows the estimating model for the total loading.

(5) FIG. 4 shows a flowchart of the analyzing method performed in the offline mode according to one embodiment.

(6) FIG. 5 shows the steps in FIG. 4.

(7) FIG. 6 shows a flowchart of the analyzing method performed in the online mode according to one embodiment.

(8) FIG. 7 shows the steps in FIG. 6.

(9) In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the disclosed embodiments. It will be apparent, however, that one or more embodiments may be practiced without these specific details. In other instances, well-known structures and devices are schematically shown in order to simplify the drawing.

DETAILED DESCRIPTION

(10) Please refer to FIG. 1. FIG. 1 shows an analyzing system 100 for graphics process according to one embodiment. The analyzing system 100 is used for analyzing varied graphics application programs to estimate a total loading of the graphics processing unit performing the graphics application programs. For example, the graphics processing unit may be an OpenGL ES 2.0 API Embedded GPU. This graphics processing unit is commonly used in Tile-Based Deferred Rendering (TBDR). Or, the graphics processing unit may be a DirectX GPU. The total loading of the graphic processing unit is the power consumption or the time consumption. In this embodiment, the program developer can improve the high loading graphics application program after analysis.

(11) The analyzing system 100 includes a parameter capturing unit 110, a grouping unit 120, a classifier 130, a relative information unit 140 and a calculating unit 150. If the analyzing system 100 is performed at an offline mode, the parameter capturing unit 110, the grouping unit 120, the classifier 130 and the relative information unit 140 create an estimating model according to a plurality of reference graphics application programs. If the analyzing system 100 is performed at an online mode, the parameter capturing unit 110, the classifier 130, the relative information unit 140 and the calculating unit 150 analyze the current graphics application program to obtain the total loading of the graphics processing unit for performing the current graphics application program according to the estimating model.

(12) Please refer to FIG. 2A. FIG. 2A shows an analyzing system 100A for graphics process according another embodiment. In one embodiment, the analyzing system 100A is specifically used in the offline mode, and includes the parameter capturing unit 110, the grouping unit 120, the classifier 130 and the relative information unit 140. Please refer to FIG. 2B. FIG. 2B shows an analyzing system 100B for graphics process according to another embodiment. In another embodiment, the analyzing system 100B is specifically used in the online mode, and includes the parameter capturing unit 110, the classifier 130, the relative information unit 140 and the calculating unit 150.

(13) One or all of the parameter capturing unit 110, the grouping unit 120, the classifier 130, the relative information unit 140 and the calculating unit 150 can be a chip, a circuit, a circuit board, or a storage device storing a plurality of program codes.

(14) Please refer to FIG. 3. FIG. 3 shows the estimating model for a total loading PT. The total loading PT may be the power consumption or the time consumption. For example, in TBDR, the graphics processing unit includes J hardware components, such as Vertex Data Master (VDM), Pixel Data Master (PDM), Unified Scalable Shader Engine (USSE), tiling coprocessor, pixel coprocessor, texturing coprocessor, texture cache, and main memory.

(15) According to the following equation (1), the total loading PT is the sum of the product of a plurality of weighting coefficients W.sub.k,j (1?j?J) and a plurality of loadings of the hardware components. The subscript k indicates the k-th group, the subscript j indicates the j-th hardware component. Each group corresponds J weighting coefficients W.sub.k,j (1?j?J).

(16) PT = .Math. ? j W k , j .Math. P j ( 1 )

(17) Please refer to table 1. Table 1 shows the relationship between a plurality of reference graphics parameters of each reference graphics application program and the hardware components of the graphics processing unit. The reference graphics parameters can include the general parameter, the geometry parameter, the fragment parameter, and the texture parameter.

(18) The general parameter may include the frame rate. The geometry parameter may include the number of triangles, the number of vertices, the number of batches, the lighting mode, the level-of-detail, the primitive assembly type, the interleaving attributes, the instancing. The fragment parameter may include the resolution, the scissor test/stencil buffer, the alpha test, the anti-aliasing. The texture parameter may include the number of texels, the texture mapping, the texture filtering, the texture compression, and the POT/NPOT.

(19) TABLE-US-00001 TABLE 1 VDM PDM . . . main memory frame rate X X . . . X number of . . . triangles number of X X . . . X batches lighting mode . . . level-of-detail X X . . . X primitive X . . . X assembly type interleaving . . . X attributes Instancing X . . . X . . . . . . . . . . . . texture . . . X compression POT/NPOT . . .

(20) In table 1, X indicates that the reference graphics parameter and the hardware component are highly correlated. As shown in equation (2), there is a relative relationship between each loading P.sub.j and I reference graphics parameters R.sub.i (1?i?I). In one example, the relative relationship is illustrated by a linear relationship. The subscript i indicates the i-th reference graphics parameter.

(21) P j = .Math. ? i ? j , i .Math. R i + ? j ( 2 )

(22) That is to say, the equation (1) can be substituted by the equation (3). The equation (3) is the estimating model for the total loading PT.

(23) PT = .Math. ? j W k , j .Math. P j = .Math. ? j W k , j .Math. ( .Math. ? i ? j , i .Math. R i + ? j ) ( 3 )

(24) As shown in FIG. 3, a total loading PT of a current graphics application program can be estimated according to the estimating model. Firstly, a plurality of current graphics parameters R.sub.i (1?i?I) can be obtained. Then, a plurality of loadings P.sub.j (1?j?J) can be calculated according to the slope coefficients ?.sub.j,i (1?j?J and 1?i?I) and the shift coefficients ?.sub.j (1?j?J) trained by the relative information unit 140. Afterwards, the current graphics application program is classified to be at least one particular group according to the current graphics application parameters R.sub.i (1?i?I), such as the k-th group, and the corresponding weighting coefficients W.sub.k,j (1?j?J) are obtained. Then, the total loading PT is calculated accordingly.

(25) Please refer to FIGS. 4 and 5. FIG. 4 shows a flowchart of the analyzing method performed in the offline mode according to one embodiment. FIG. 5 shows the steps in FIG. 4. In the offline mode, the analyzing method can group the reference graphics application programs into K groups, and create the estimating model for the total loading PT of the graphics processing unit. The analyzing method is illustrated through the analyzing system 100B for analyzing the power consumption. In step S110, the reference graphics application programs RP.sub.n (1?n?N) are provided. And, the parameter capturing unit 110 obtains the reference graphics parameters R.sub.n,i (1?n?N and 1?i?I) of each of the reference graphics application programs RP.sub.n (1?n?N). In this step, the reference graphics parameters R.sub.n,i (1?n?N and 1?i?I) are captured through the API Trace.

(26) In step S120, the grouping unit 120 groups the reference graphics application programs RP.sub.n (1?n?N) into a plurality of groups, such as K groups. In this step, the number of the groups can be predetermined. The total loadings PT.sub.n (1?n?N) of the reference graphics application programs RP.sub.n (1?n?N) are measured respectively. Then, the weighting coefficients W.sub.n,j (1?n?N and 1?j?J) of the hardware components are obtained respectively. Afterwards, a grouping algorithm, such as a K-means algorithm, is used to group the reference graphics application programs RP.sub.n (1?n?N). If some sets of the growth trends of the weighting coefficients W.sub.n,j of the reference graphics application programs RP.sub.n (1?n?N) are similar, then those reference graphics application programs RP.sub.n are grouped into the same group. In each of the groups, the weighting coefficients W.sub.k,j (1?k?K and 1?j?J) is calculated by linear interpolation. For example, in 30 reference graphics application programs RP.sub.n (1?n?30), the weighting coefficients W.sub.n,j (1?n?10 and 1?j?J) of the first to 10-th reference graphics application programs RP.sub.n (1?n?10) are similar. Therefore, the first to 10-th reference graphics application programs RP.sub.n (1?n?10) are grouped into a first group, and the weighting coefficients W.sub.1,j (1?j?J) (not shown) of the first group are calculated by linear interpolation. The weighting coefficients W.sub.n,j (11?n?30 and 1?j?J) of the 11-th to 30-th reference graphics application programs RP.sub.n (11?n?30) are similar. Therefore, the 11-th to 30-th reference graphics application programs RP.sub.n (11?n?30) are grouped into a second group, and the weighting coefficients W.sub.2,j (1?j?J) (not shown) of the second group are calculated by linear interpolation. In the other embodiments, the grouping algorithm can be an Expectation-maximization algorithm, a Highly Connected Subgraphs clustering algorithm, a Connectivity based clustering algorithm, or a hierarchical clustering algorithm.

(27) After grouping, the grouped reference graphics application programs RP.sub.n (1?n?N) are used for training. In step S130, the classifier 130 trains a classifying relationship CR between the reference graphics application programs and the groups according to the reference graphics parameters R.sub.n,i (1?n?N and 1?i?I). In this step, the training procedure is performed according a Machine Learning Algorithm, such as an artificial neural network algorithm (ANN algorithm), or a Support Vector Machine algorithm (SVM algorithm). In this step, the classifying relationship CR is not trained according to the information detected from the hardware components. That is to say, when to determine which group the current graphics application program RP (shown in FIG. 7) belong to, there is no need to detect the hardware components. The current graphics application program RP can be classified according to the current graphics parameters R.sub.i (1?i?I) (shown in FIG. 7) of the current graphics application program RP.

(28) In step S140, the relative information unit 140 analyzes a relative relationship, such as a linear relationship LR, between the loadings P.sub.n,j (1?n?N and 1?j?J)) of the reference graphics parameters R.sub.n,i (1?n?N and 1?i?I) to obtain the slope coefficients ?.sub.j,i (1?j?J and 1?i?I) and the shift coefficients ?.sub.j (1?j?J). In other embodiments, the relative relationship can be a Polynomial regression relationship, a Logarithmic regression relationship, or an Exponential regression relationship.

(29) The step S140 can be performed before the steps S110 to S130; or, the step S140 and one of the steps S110 to S130 can be performed at the same time. The step S140 does not interfere with the steps S110 to S130.

(30) Please refer to FIGS. 6 to 7. FIG. 6 shows a flowchart of the analyzing method performed in the online mode according to one embodiment. FIG. 7 shows the steps in FIG. 6. In the online mode, the analyzing method can classify the current graphics application program RP to be at least one group and calculate the total loading PT of the graphics processing unit according to the estimating model. In step S210, the current graphics application program RP is provided, and the parameter capturing unit 110 obtains the current graphics parameters R.sub.i (1?i?I) of the current graphics application program RP.

(31) In S220, the classifier 130 classifies the current graphics application program to be at least one of the groups, such as the k-th group, according to the current graphics parameters R.sub.i (1?i?I), and obtains the weighting coefficients W.sub.k,j (1?j?J) accordingly. In this step, the input of the current graphics parameters R.sub.i (1?i?I) and the output is at least one group which the current graphics application program RP belongs to. If the output is only one group, then the weighting coefficients of this group are obtained. If the output is more than one groups, then, in one embodiment, interpolating the weighting coefficients of those groups.

(32) In step S230, the calculating unit 150 calculates the total loading PT of the graphics processing unit for performing the current graphics application program RP according to the weighting coefficients W.sub.k,j (1?j?J), the current graphics parameters R.sub.i (1?i?I), the slope coefficients ?.sub.j,i (1?j?J and 1?i?I) the shift coefficients ?.sub.j (1?j?J) via the equation (3).

(33) In one embodiment, the relative relationship can be trained at the offline mode.

(34) In one embodiment, the hardware components of the graphics processing unit performing the current graphics application program are corresponding to the loading individually.

(35) According to the embodiments described above, the graphics parameters are obtained by analyzing the source codes or the API Trace, and the total loading of the graphics processing unit can be calculated accordingly. This method is suitable for the program developer. As such, the program developer can find out the particular block of program codes which causes much power consumption, and improves the program codes accordingly. To obtain graphics parameters, it is no need to detect or simulate the hardware components. And, the obtained graphics parameters are not based on any particular hardware architecture. Therefore, the estimating model can be widely used for any hardware architecture of the graphics processing unit. The analyzing method and the analyzing system have much flexibility and extensibility.

(36) Moreover, in the estimating model, the weighting coefficients can be dynamically selected according to the current graphics application program to adapt to the load imbalance of the hardware components of the graphics processing unit. It will be apparent to those skilled in the art that various modifications and variations can be made to the disclosed embodiments. It is intended that the specification and examples be considered as exemplary only, with a true scope of the disclosure being indicated by the following claims and their equivalents.