CN111930593B - GPU occupancy rate determination method, device, processing system and storage medium - Google Patents

GPU occupancy rate determination method, device, processing system and storage medium Download PDF

Info

Publication number
CN111930593B
CN111930593B CN202010731065.9A CN202010731065A CN111930593B CN 111930593 B CN111930593 B CN 111930593B CN 202010731065 A CN202010731065 A CN 202010731065A CN 111930593 B CN111930593 B CN 111930593B
Authority
CN
China
Prior art keywords
gpu
module
occupancy rate
working state
state
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010731065.9A
Other languages
Chinese (zh)
Other versions
CN111930593A (en
Inventor
周敏龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Changsha Jingmei Integrated Circuit Design Co ltd
Changsha Jingjia Microelectronics Co ltd
Original Assignee
Changsha Jingmei Integrated Circuit Design Co ltd
Changsha Jingjia Microelectronics Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Changsha Jingmei Integrated Circuit Design Co ltd, Changsha Jingjia Microelectronics Co ltd filed Critical Changsha Jingmei Integrated Circuit Design Co ltd
Priority to CN202010731065.9A priority Critical patent/CN111930593B/en
Publication of CN111930593A publication Critical patent/CN111930593A/en
Application granted granted Critical
Publication of CN111930593B publication Critical patent/CN111930593B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3024Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a central processing unit [CPU]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the application provides a GPU occupancy rate determination method, a GPU occupancy rate determination device, a processing system and a storage medium, wherein the method comprises the following steps: acquiring the total times of the GPU in a busy state in a preset period; and determining the occupancy rate of the GPU according to the total times. The GPU occupancy rate determining method, the GPU occupancy rate determining device, the processing system and the storage medium can determine the occupancy rate of a GPU.

Description

GPU occupancy rate determination method, device, processing system and storage medium
Technical Field
The present application relates to processor technologies, and in particular, to a method, an apparatus, a processing system, and a storage medium for determining GPU occupancy.
Background
A Graphics Processing Unit (GPU) is a processor specially used for Processing images or Graphics, and is applied to a display system of an electronic terminal, so as to reduce the pressure of a Central Processing Unit (CPU) in the aspect of Processing images or Graphics and improve the overall Processing efficiency of the display system.
The working modules in the GPU mainly comprise a 2D module, a 3D module and the like. Wherein, the 2D module is mainly responsible for desktop display, include: block copy, rectangle fill, monochrome extension, bit mask, pixel logic processing, etc. The 3D module is mainly responsible for generating three-dimensional graphics. In the traditional scheme, the 2D module and the 3D module respectively execute tasks independently, resources such as a buffer memory and the like are shared, and the working state of each module and the occupation condition of the resources are not monitored.
Disclosure of Invention
The embodiment of the application provides a GPU occupancy rate determination method, a GPU occupancy rate determination device, a processing system and a storage medium, which are used for determining the occupancy rate of a GPU.
An embodiment of the first aspect of the present application provides a method for determining an occupancy rate of a GPU in a graphics processor, including:
acquiring the total times of the GPU in a busy state in a preset period;
and determining the occupancy rate of the GPU according to the total times.
An embodiment of a second aspect of the present application provides a GPU occupancy determining apparatus, including:
the total number obtaining module is used for obtaining the total number of times that the GPU is in a busy state in a preset period;
and the occupancy rate determining module is used for determining the occupancy rate of the GPU according to the total times.
An embodiment of a third aspect of the present application provides a processing system, including: a graphics processor GPU and a graphics processor GPU occupancy determination apparatus as described above.
A fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon; the computer program is executed by a processor to implement the method as described above.
According to the technical scheme provided by the embodiment of the application, the busy condition of the GPU can be known by acquiring the total times of the GPU in the busy state in the preset period and then determining the occupancy rate of the GPU according to the total times.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a flowchart of a GPU occupancy determination method according to an embodiment of the present application;
fig. 2 is a flowchart of a GPU occupancy determination method according to a second embodiment of the present application;
fig. 3 is a flowchart of a GPU occupancy determination method provided in the third embodiment of the present application;
fig. 4 is a flowchart of a GPU occupancy determination method according to the fourth embodiment of the present application;
fig. 5 is a schematic structural diagram of a GPU occupancy determining apparatus according to the fifth embodiment of the present application;
fig. 6 is a schematic structural diagram of a processing system according to a sixth embodiment of the present application.
Detailed Description
In order to make the technical solutions and advantages of the embodiments of the present application more apparent, the following further detailed description of the exemplary embodiments of the present application with reference to the accompanying drawings makes it clear that the described embodiments are only a part of the embodiments of the present application, and are not exhaustive of all embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
Example one
The present embodiment provides a method for determining an occupancy rate of a GPU of a graphics processor, which can determine an occupancy rate of the GPU, can determine an occupancy rate of the GPU in a processing system, and can also determine an occupancy rate of a work module in the GPU, for example: and determining the occupancy rates of working modules such as a 2D module and a 3D module.
In practical applications, the method for determining GPU occupancy of a graphics processor may be implemented by a computer program, for example, application software; alternatively, the method may also be implemented as a medium storing a related computer program, for example, a usb disk, a cloud disk, or the like; still alternatively, the method may be implemented by a physical device, such as a chip, a removable smart device, etc., into which the associated computer program is integrated or installed.
Fig. 1 is a flowchart of a GPU occupancy determination method according to an embodiment of the present application. As shown in fig. 1, the method for determining GPU occupancy provided in this embodiment includes:
step 101, acquiring the total times of the GPU in a busy state in a preset period.
One implementation is as follows: and sending inquiry requests to the GPU at regular time, directly responding to the inquiry requests when the GPU is idle, and not responding to the inquiry requests when the GPU is busy. Determining whether the GPU is in a busy state according to whether the GPU sends a response inquiry request or not, and recording the total times of the GPU in the busy state in a preset period.
The other realization mode is as follows: while the GPU is in a busy state, the flag bit in some register may be modified. The flag bit is periodically read to determine whether the GPU is in a busy state, and the number of times the GPU is in the busy state within a preset period is recorded.
And 102, determining the occupancy rate of the GPU according to the total times.
One implementation is as follows: the obtained total number of times is compared with an empirical number, and the occupancy rate of the GPU can be determined according to a difference or ratio between the total number of times and the empirical number of times. The empirical times may be an average value obtained by performing statistics on the total times obtained by performing step 101 multiple times as a sample. Alternatively, other means may be employed.
According to the technical scheme provided by the embodiment, the busy condition of the GPU and the occupation condition of resources can be known by acquiring the total times of the GPU in the busy state in the preset period and then determining the occupancy rate of the GPU according to the total times.
When the occupancy rate of the GPU is high, the working condition of the GPU can be coordinated so as to regulate and control the occupation of the GPU on resources.
When the occupancy rate of the working module in the GPU is determined by adopting the method, the current non-important working module can be executed in a delayed mode or resources are distributed in a small quantity, so that a large quantity of resources are developed to be used by the working module with higher occupancy rate, and the working efficiency of the working module is improved. And after the occupancy rate is reduced, controlling other non-important work modules to execute tasks and reasonably allocating resources. And according to the occupancy rate of the GPU, the working progress of each working module is facilitated, and the matching mechanism among the working modules is optimized, so that the processing efficiency of the GPU is improved. And the basis for checking and processing the working process of each working module can be provided.
The purpose of the embodiment is to determine the occupancy rate of the GPU, and provide basis for the regulation and control of the GPU. The embodiment does not limit the specific means of regulation.
One implementation is as follows: the GPU comprises a 2D module, the step of acquiring the total number of times that the GPU is in the busy state in the preset period is specifically to acquire the total number of times that the 2D module is in the busy state in the preset period, and then the occupancy rate of the 2D module is determined according to the total number of times.
The other realization mode is as follows: the GPU comprises a 3D module, the step of acquiring the total times that the GPU is in the busy state in the preset period is specifically to acquire the total times that the 3D module is in the busy state in the preset period, and then the occupancy rate of the 3D module is determined according to the total times.
In yet another implementation: the GPU comprises a 2D module and a 3D module, wherein the total times of the GPU in the busy state in the preset period are obtained, specifically, the total times of the 2D module in the busy state in the preset period are obtained, and the occupancy rate of the 2D module is determined; and acquiring the total times of the 3D module in a busy state in a preset period, and determining the occupancy rate of the 3D module.
After the occupancy rates of the 2D module and the 3D module are determined, the processor resources of the 2D module and the 3D module may also be allocated according to the occupancy rates of the 2D module and the 3D module. Alternatively, after the occupancy rate of the 2D module and the occupancy rate of the 3D module are determined, the occupancy rates may be used to evaluate the performance of the application software.
Example two
On the basis of the above embodiments, the present embodiment optimizes the GPU occupancy rate determination method, and provides a specific implementation manner.
Fig. 2 is a flowchart of a GPU occupancy determination method according to a second embodiment of the present application. As shown in fig. 2, the method for determining GPU occupancy provided in this embodiment includes:
step 201, in a preset period, obtaining a working state of the GPU according to a preset sampling frequency, and adding 1 to a sampling counter after obtaining the working state once.
The operating states of the GPU include a busy state and an idle state. And in a preset period, obtaining the working state of the GPU for multiple times according to a preset sampling frequency. And setting a sampling counter, resetting the sampling counter when a preset period begins, adding 1 to the sampling counter after a working state is acquired, and counting the times of acquiring the working state. And when the preset period is finished, the count value of the sampling counter is the total times of the working state.
This embodiment provides a simple example: the preset period is 1s, and the preset sampling frequency is 10ms. And resetting the sampling counter at the beginning of a preset period. The operating state of the GPU is then obtained every 10ms and the sample counter is incremented by 1. At the end of the preset period, the count value of the sampling counter should be 100, which corresponds to 100 times of obtaining the working state.
One implementation is as follows: a status register is used to store the operating status of the GPU, and the status register can be a register inside the GPU or a register outside the GPU. Specifically, the method comprises the following steps: a status register is used whose value is a 32-bit integer. And a certain flag bit in the status register is used for identifying the working state of the GPU, and when the flag bit is a preset value, the working state is a busy state. For example: when the flag bit is '1', the GPU is indicated to be in a busy state; when the flag bit is "0", it indicates that the GPU is in an idle state.
The modification mode of the flag bit can be as follows: when the GPU starts to execute a work task and enters a busy state, the flag bit in the state register is modified and is set to be 1; and when the GPU finishes the execution of the work task and enters an idle state, modifying the zone bit of the state register to be 0.
And step 202, when the working state is a busy state, adding 1 to the working state counter.
After the operating state of the GPU is acquired through step 201, it is determined whether the operating state is a busy state or an idle state.
And when the working state is the busy state, adding 1 to the working state counter. And when a preset period begins, resetting the working state counter. And at the end of a preset period, taking the count value of the working state counter as the total number of times that the GPU is in a busy state.
Step 201 and step 202 are specific implementations of step 101 in the foregoing embodiment, but certainly, the solution provided in this embodiment is not the only implementation, and those skilled in the art may also make an adaptive modification on the basis of the foregoing solution.
After step 202 ends, step 203 is executed:
and step 203, determining the occupancy rate of the GPU according to the count values of the sampling counter and the working state counter.
After step 201 and step 202 respectively obtain the count values of the sampling counter and the working state counter after a preset period is finished, the occupancy rate of the GPU may be determined according to the count values of the sampling counter and the working state counter.
For example, it can be calculated by the following formula:
Figure BDA0002603159800000061
wherein S is the occupancy rate of the GPU, R is the count value of the working state counter, and Y is the count value of the sampling counter.
The present embodiment provides an example: within a preset period of 1s, it is assumed that R is 100 and Y is 80. Indicating that 100 operating states are obtained within 1s, wherein 80 operating states are busy states. The occupancy of the GPU is 80%.
Based on the technical solutions provided by the above embodiments, after step 202 is finished, the total number of times of the busy state may be stored in a Random Access Memory (RAM). And then when a state acquisition request is received, reading the total times of the busy states from the RAM, and determining the occupancy rate of the GPU according to the total times of the busy states.
The other realization mode is as follows: and when the preset period is finished, immediately calculating the occupancy rate of the GPU after the total times that the working state is the busy state are acquired, and then storing the occupancy rate into the RAM for other equipment to read.
EXAMPLE III
On the basis of the foregoing embodiments, the present embodiment optimizes a GPU occupancy rate determination method, and particularly provides a specific implementation manner:
fig. 3 is a flowchart of a GPU occupancy determination method provided in the third embodiment of the present application. As shown in fig. 3, the determination method includes:
step 301, starting a working state acquisition timer.
The timer is set to a preset period, and the following steps are executed after the timer is started. The execution of the following steps is stopped after the timer is stopped.
Step 302, initializing a sampling counter and a working state counter.
Specifically, the sampling counter and the working state counter are cleared.
Step 303, add 1 to the sampling counter.
And step 304, reading a flag bit corresponding to the GPU in the status register.
The value of the flag is used to identify whether the GPU is in a busy state or an idle state. Such as: a flag of "1" indicates that the GPU is in a busy state, and a flag of "0" indicates that the GPU is in an idle state.
And 305, judging whether the GPU is in a busy state.
The method comprises the following specific steps: and judging whether the value of the flag bit is 1 or not. If yes, go to step 306; if the determination result is no, the process returns to step 303, and the subsequent steps of step 303 are sequentially executed.
Step 306, add 1 to the working state counter.
And 307, judging whether the preset period is finished or not.
If yes, go to step 308; if the determination result is no, the process returns to step 303.
And 308, calculating the occupancy rate of the GPU according to the values of the sampling counter and the working state counter.
The present embodiment provides a specific example: assuming that the preset period is 1s, the preset sampling frequency is 10ms. And when the preset period begins, resetting the sampling counter and the working state counter. The operating state of the GPU is then obtained every 10ms and the sample counter is incremented by 1. And when the acquired working state is the busy state, adding 1 to the working state counter. At the end of the preset period, the count value of the sampling counter is 100, and the count value of the working state counter is 80. The occupancy rate of the GPU was 80%.
Example four
The present embodiment is to optimize the method for determining the GPU occupancy, and particularly provides an implementation manner for determining the occupancy of a work module in the GPU, on the basis of the above embodiments:
fig. 4 is a flowchart of a GPU occupancy determination method according to the fourth embodiment of the present application. As shown in fig. 3, the determining method includes:
step 401, starting a working state acquisition timer.
The timer is set to a preset period, and the following steps are executed after the timer is started. The execution of the following steps is stopped after the timer is stopped.
Step 402, initializing a sampling counter and a working state counter.
Specifically, the sampling counter and the working state counter are cleared.
Step 403, add 1 to the sampling counter.
Step 404, reading a flag bit corresponding to the work module in the GPU in the status register.
The value of the flag bit is used to identify whether the work module is in a busy state or an idle state. Such as: the flag bit is "1" to indicate that the working module is in a busy state, and the flag bit is "0" to indicate that the working module is in an idle state.
Step 405, judging whether the work module is in a busy state.
The method specifically comprises the following steps: and judging whether the value of the flag bit is 1 or not. If yes, go to step 406; if the determination result is negative, the process returns to step 403, and the steps subsequent to step 403 are sequentially executed.
Step 406, increment the working state counter by 1.
Step 407, determining whether the preset period is over.
If yes, go to step 408; if the determination result is negative, the process returns to step 403.
And step 408, calculating the occupancy rate of the working module according to the values of the sampling counter and the working state counter.
The present embodiment provides a specific example: assuming that the preset period is 1s, the preset sampling frequency is 10ms. And when the preset period begins, resetting the sampling counter and the working state counter. The operating state of the operating module is then acquired every 10ms and the sampling counter is incremented by 1. And when the acquired working state is the busy state, adding 1 to the working state counter. At the end of the preset period, the count value of the sampling counter is 100, and the count value of the working state counter is 80. The occupancy rate of the working module is 80%.
EXAMPLE five
Fig. 5 is a schematic structural diagram of a GPU occupancy determining apparatus according to the fifth embodiment of the present application. As shown in fig. 5, the present embodiment provides a GPU occupancy determining apparatus, including: a total number acquisition module 51 and an occupancy determination module 52.
The total number obtaining module 51 is configured to obtain a total number of times that the GPU is in a busy state in a preset period. The occupancy determining module 52 is configured to determine the occupancy of the GPU according to the total number of times.
According to the technical scheme provided by the embodiment, the busy condition of the GPU and the occupation condition of resources can be known by acquiring the total times of the GPU in the busy state in the preset period and then determining the occupancy rate of the GPU according to the total times.
On the basis of the technical scheme, the total number obtaining module comprises: the device comprises a working state acquisition unit, a sampling counter control unit and a working state counter control unit. The working state obtaining unit is used for obtaining the working state of the GPU in a preset period according to a preset sampling frequency. And the sampling counter control unit is used for adding 1 to the sampling counter after the working state acquisition unit acquires the working state for one time. The working state counter control unit is used for adding 1 to the working state counter when the working state is a busy state; and after a preset period is finished, taking the count value of the working state counter as the total times of the GPU in the busy state.
The occupancy rate determining module is specifically configured to determine the occupancy rate of the GPU according to the count value of the working state counter and the count value of the sampling counter, and specifically may calculate the occupancy rate of the GPU by using the following formula:
Figure BDA0002603159800000091
wherein S is the occupancy rate of the GPU, R is the count value of the working state counter, and Y is the count value of the sampling counter.
The working state acquiring unit is specifically configured to acquire a value of a corresponding flag bit in a state register in the GPU, where the value of the flag bit is used to identify a working state of the GPU; when the flag bit is a preset value, the working state is a busy state.
Further, the GPU occupancy determining apparatus further includes: a memory write module. The memory write module is to write the total number of times the busy state is to the random access memory RAM. The occupancy rate determining module is specifically configured to, when a state acquisition request is received, read the total number of times of busy states from the random access memory RAM, and determine the occupancy rate of the GPU according to the total number of times of busy states.
If the GPU includes a 2D module and/or a 3D module, the total number obtaining module is specifically configured to obtain the total number of times that the 2D module or the 3D module is in a busy state within a preset period.
When the GPU comprises a 2D module and a 3D module, a resource allocation module is adopted to allocate processor resources of the 2D module and the 3D module according to the occupancy rate of the 2D module and the occupancy rate of the 3D module.
EXAMPLE six
Fig. 6 is a schematic structural diagram of a processing system according to a sixth embodiment of the present application. As shown in fig. 6, the present embodiment further provides a processing system, including: a graphics processor GPU 61 and a GPU occupancy determination means 62 as above.
The present embodiments also provide a computer readable storage medium having stored thereon a computer program for execution by a processor to implement a method as provided in any of the above.
The processing system and the storage medium provided by the embodiment have the same technical effects as the method.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In the description of the present application, it is to be understood that, furthermore, the terms "first", "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or as implying a number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
In this application, unless expressly stated or limited otherwise, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can include, for example, fixed connections, removable connections, or integral parts; can be mechanically connected, electrically connected or can communicate with each other; either directly or indirectly through intervening media, either internally or in any other relationship. The specific meaning of the above terms in the present application can be understood by those of ordinary skill in the art as appropriate.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all changes and modifications that fall within the scope of the present application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A method for determining GPU occupancy of a graphics processor, comprising:
acquiring the total times of the GPU in a busy state in a preset period;
determining the occupancy rate of the GPU according to the total times;
the GPU comprises: a 2D module and/or a 3D module;
acquiring the total times of the GPU in a busy state in a preset period, wherein the acquiring comprises the following steps: acquiring the total times of the 2D module or the 3D module in a busy state in a preset period;
when the GPU comprises a 2D module and a 3D module, allocating processor resources of the 2D module and the 3D module according to the occupancy rate of the 2D module and the occupancy rate of the 3D module;
acquiring the total times of the GPU in a busy state in a preset period, wherein the acquiring comprises the following steps:
in a preset period, acquiring the working state of the GPU according to a preset sampling frequency, and adding 1 to a sampling counter after acquiring the working state once;
when the working state is a busy state, adding 1 to a working state counter; after a preset period is finished, the count value of the working state counter is used as the total times of the GPU in a busy state;
determining the occupancy rate of the GPU according to the total times, comprising:
and determining the occupancy rate of the GPU according to the count value of the working state counter and the count value of the sampling counter.
2. The method according to claim 1, wherein the occupancy rate of the GPU is determined according to the count value of the operating state counter and the count value of the sampling counter, and is calculated by using the following formula:
Figure FDA0003863471240000011
wherein S is the occupancy rate of the GPU, R is the count value of the working state counter, and Y is the count value of the sampling counter.
3. The method according to claim 1, wherein the obtaining of the working state of the GPU specifically comprises:
acquiring a value of a corresponding flag bit in a state register in the GPU, wherein the value of the flag bit is used for identifying the working state of the GPU; and when the flag bit is a preset value, the working state is a busy state.
4. The method of claim 1, further comprising, after obtaining the total number of times the GPU is in a busy state within a preset period: writing the total number of busy states into a Random Access Memory (RAM);
determining the occupancy rate of the GPU according to the total times, comprising: and when a state acquisition request is received, reading the total times of busy states from the RAM, and determining the occupancy rate of the GPU according to the total times of the busy states.
5. A graphics processor GPU occupancy determination apparatus, comprising:
the total number obtaining module is used for obtaining the total number of times that the GPU is in a busy state in a preset period;
the occupancy rate determining module is used for determining the occupancy rate of the GPU according to the total times;
the GPU comprises: a 2D module and/or a 3D module;
the total number obtaining module is specifically used for obtaining the total number of times that the 2D module or the 3D module is in a busy state in a preset period;
the resource allocation module is used for allocating processor resources of the 2D module and the 3D module according to the occupancy rate of the 2D module and the occupancy rate of the 3D module when the GPU comprises the 2D module and the 3D module;
the total number of times acquisition module includes:
the working state acquisition unit is used for acquiring the working state of the GPU in a preset period according to a preset sampling frequency;
the sampling counter control unit is used for adding 1 to the sampling counter after the working state acquisition unit acquires the primary working state;
the working state counter control unit is used for adding 1 to the working state counter when the working state is a busy state; after a preset period is finished, the count value of the working state counter is used as the total times of the GPU in a busy state;
the occupancy rate determining module is specifically configured to determine the occupancy rate of the GPU according to the count value of the working state counter and the count value of the sampling counter.
6. The apparatus of claim 5, wherein the occupancy determination module calculates the occupancy of the GPU specifically using the following formula:
Figure FDA0003863471240000031
wherein S is the occupancy rate of the GPU, R is the count value of the working state counter, and Y is the count value of the sampling counter.
7. The apparatus according to claim 5, wherein the working status obtaining unit is specifically configured to obtain a value of a corresponding flag bit in a status register in the GPU, where the value of the flag bit is used to identify the working status of the GPU; and when the flag bit is a preset value, the working state is a busy state.
8. The apparatus of claim 5, further comprising:
a memory write module for writing the total number of busy states into a random access memory RAM;
the occupancy rate determining module is specifically configured to, when a state acquisition request is received, read the total number of times of busy states from the random access memory RAM, and determine the occupancy rate of the GPU according to the total number of times of busy states.
9. A processing system, comprising: graphics processor GPU and graphics processor GPU occupancy determination apparatus as claimed in any of claims 5-8.
10. A computer-readable storage medium, having stored thereon a computer program; the computer program is executed by a processor to implement the method of any one of claims 1-4.
CN202010731065.9A 2020-07-27 2020-07-27 GPU occupancy rate determination method, device, processing system and storage medium Active CN111930593B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010731065.9A CN111930593B (en) 2020-07-27 2020-07-27 GPU occupancy rate determination method, device, processing system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010731065.9A CN111930593B (en) 2020-07-27 2020-07-27 GPU occupancy rate determination method, device, processing system and storage medium

Publications (2)

Publication Number Publication Date
CN111930593A CN111930593A (en) 2020-11-13
CN111930593B true CN111930593B (en) 2023-03-28

Family

ID=73315765

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010731065.9A Active CN111930593B (en) 2020-07-27 2020-07-27 GPU occupancy rate determination method, device, processing system and storage medium

Country Status (1)

Country Link
CN (1) CN111930593B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107368400A (en) * 2017-08-01 2017-11-21 广东欧珀移动通信有限公司 CPU monitoring methods, device, computer-readable recording medium and mobile terminal
CN111104289A (en) * 2019-12-25 2020-05-05 创新奇智(上海)科技有限公司 System and method for checking efficiency of GPU (graphics processing Unit) cluster

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7474991B2 (en) * 2006-01-19 2009-01-06 International Business Machines Corporation Method and apparatus for analyzing idle states in a data processing system
CN101901042B (en) * 2010-08-27 2011-07-27 上海交通大学 Method for reducing power consumption based on dynamic task migrating technology in multi-GPU (Graphic Processing Unit) system
US8928678B2 (en) * 2012-08-02 2015-01-06 Intel Corporation Media workload scheduler
CN110362460A (en) * 2019-07-12 2019-10-22 腾讯科技(深圳)有限公司 A kind of application program capacity data processing method, device and storage medium
CN110377257B (en) * 2019-07-17 2022-04-19 Oppo广东移动通信有限公司 Layer composition method and device, electronic equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107368400A (en) * 2017-08-01 2017-11-21 广东欧珀移动通信有限公司 CPU monitoring methods, device, computer-readable recording medium and mobile terminal
CN111104289A (en) * 2019-12-25 2020-05-05 创新奇智(上海)科技有限公司 System and method for checking efficiency of GPU (graphics processing Unit) cluster

Also Published As

Publication number Publication date
CN111930593A (en) 2020-11-13

Similar Documents

Publication Publication Date Title
WO2019183861A1 (en) Method, device, and machine readable storage medium for task processing
CN114880259B (en) Data processing method, device, system, electronic equipment and storage medium
CN114155026A (en) Resource allocation method, device, server and storage medium
CN110297743B (en) Load testing method and device and storage medium
CN111913659A (en) Block data processing method, device and system and storage medium
CN108241535B (en) Resource management method and device and server equipment
CN115562843A (en) Container cluster computational power scheduling method and related device
CN115334082A (en) Load balancing method, device, computer equipment, storage medium and product
CN110489356B (en) Information processing method, information processing device, electronic equipment and storage medium
CN111930593B (en) GPU occupancy rate determination method, device, processing system and storage medium
CN117058288A (en) Graphics processor, multi-core graphics processing system, electronic device, and apparatus
CN107544845B (en) GPU resource scheduling method and device
US9122800B1 (en) System and method of non-intrusive measurement of memory access profiles of threads in a multi-core processor
CN116188244B (en) Method, device, equipment and storage medium for distributing image blocks
US11194619B2 (en) Information processing system and non-transitory computer readable medium storing program for multitenant service
WO2020076400A1 (en) Resource allocation using distributed segment processing credits
CN115129432A (en) Transaction processing method and device, electronic equipment and medium
CN110046040B (en) Distributed task processing method and system and storage medium
CN110502343B (en) Resource allocation method, system, device and computer readable storage medium
CN110874268B (en) Data processing method, device and equipment
CN111459879A (en) Data processing method and system on chip
CN111882482A (en) Method, device and equipment for reading and writing graph block data and storage medium
CN116468597B (en) Image rendering method and device based on multiple GPUs and readable storage medium
CN116302573B (en) Core allocation method and device in parallel computing
CN115391042B (en) Resource allocation method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant