Intel® Graphics Performance Analyzers (Intel® GPA)
Improve your game's performance by quickly specifying problem areas

Can I get GPU load via an API call in my application?

Abdellatif_Khindouf
2,991 Views
Hi,

I'm looking for get the GPU load (MFX and EU loads) inside my C++ application.
So is here any way to use the "DirectTraceSample" or anay other DLL to have access to such measure.

Best regards.
Abdellatif
0 Kudos
25 Replies
Neal_Pierman
Valued Contributor I
2,347 Views
Hello,

At this time there is no way for you to get the metrics values via an API call from within your application.

Can you help me understand what you are trying to do and why you need this? There may be a way for Intel GPA to provide the info you need.

Regards,

Neal
0 Kudos
Abdellatif_Khindouf
2,347 Views
Hi,

I'm runing several applications that use the Intel MFX "encoder" and I want to monitor remotely the GPU usage (by sending values via ethernet) to check the hardware "GPU" limitation.

Best regards.
0 Kudos
Neal_Pierman
Valued Contributor I
2,347 Views
Hello,
With Intel GPA you can monitor GPU usage in a client/server mode -- take a look at the System Analyzer tool (see this link), and also take a look at the tool's support for media.
Does this give you the capabilities that you need?
Regards,
Neal
0 Kudos
Abdellatif_Khindouf
2,347 Views
Hello,

In my company we use our own secure connection between the client and the server, so what I need is a C++ like method to get the GPU usage/MFX.

Regards,
Abdellatif
0 Kudos
Neal_Pierman
Valued Contributor I
2,347 Views
Hello,

Now I understand why an API is necessary -- the secure connection between client and server.

Unfortunately, since there's no way to get this data from within your app/game, the only option I can think of is to write out data via a user-defined trigger (such as every seconds, or every frames, or another trigger you define), then read that file from your client process. Also, take a look at the "capture.exe" and "playback.exe" utilities in the Intel GPA install area as well (they are command-line tools).

Whether this method works depends upon your specific use model, but at this time there is no API read access from within the Intel GPA product.

Regards,

Neal

ps-> You're not the only person to request this feature, and I've submitted this as a feature request to see if we can add this capability in a future release.
0 Kudos
Abdellatif_Khindouf
2,347 Views
Hello,

My inderstanding of "capture.exe" and "playback.exe" is that they are useful to play and capture frames and can not be used to get the GPU load if for example I'm runnig an application such "sample_encode.exe" from the "Intel Media SDK" samples.

Regards,

Abdellatif
0 Kudos
Neal_Pierman
Valued Contributor I
2,347 Views
Hello,
I'll retry some of my sample apps to be sure that these utilities work as expected.
Regards,
Neal
0 Kudos
Abdellatif_Khindouf
2,347 Views
Hi, Any news regarding my question. Regards, Abdellatif
0 Kudos
Neal_Pierman
Valued Contributor I
2,347 Views
Hello, Nothing new... we don't currently support what you are trying to do. I've submitted this as an enhancement request to the development team. Regards, Neal
0 Kudos
XiuYang_W_
Beginner
2,347 Views

请问现在支持gpu load调用了么?

0 Kudos
XiuYang_W_
Beginner
2,347 Views

Can I get GPU load via an API call in my application?

0 Kudos
Neal_Pierman
Valued Contributor I
2,347 Views

Hello,

Thanks for suggesting this again, but unfortunately Intel GPA does not have an API for this information.

Regards,

Neal

0 Kudos
Artur_M_
Beginner
2,347 Views

Hi,

This topic has been active for more than 4 years now. 

Has this functionality been added or is there a plan to add this as there is a real need to be able to check this.

just to add one more user that needs this functionality.

Artur.

0 Kudos
Seth_S_Intel
Employee
2,347 Views

Hello,

Yes we do support MFX and EU metrics in our System Analyzer version of our product.  

Here is a good resource to get you started: https://software.intel.com/en-us/articles/how-to-analyze-intel-media-sdk-applications-with-intel-graphics-performance-analyzers 

Let me know if you have any other questions!

Best,

Seth

0 Kudos
Artur_M_
Beginner
2,347 Views

Hello Seth,

The GPA is a product that needs to be installed, i think this question was regarding the possibility to get the performance (in my case i need Total GPU load and memory usage) programmatically through an API. 

So the GPA can read the gpu load and memory and what would be nice is an API so i can call the same functions the analyser is using for the GPA application.

Is there such and API/SDK/Functionality in MediaSDK maybe? so the GPA tool is not usable for programmatic access.

 

BR

Artur.

0 Kudos
Ryan_G_Intel
Employee
2,347 Views

Hi Artur,

I think what you are looking for can be found here:

Intel® Metrics Framework - https://software.intel.com/en-us/node/659423

Intel® Platform Analysis Library - https://software.intel.com/en-us/intel-platform-analysis-library

0 Kudos
Artur_M_
Beginner
2,347 Views

Hi Ryan, 

Thank you very much, i will look into this and get back to you if there are issues :)

Best regards,

Artur.

0 Kudos
Artur_M_
Beginner
2,347 Views

Hi Ryan,

I have been trying to use the API, and have some questions:

1 - do i have to have the GM_Server component running on the system to be able to read the counters? 
2 - I have found the "com.intel.gpu.gpu_busy" property that gives the GPU usage, however i must run in Admin context before the numbers are correct. is this a must?
3 - I can not find any property that can give me the GPU memory usage number, is it possible to have this metric as well?

Thank you,

BR,

Artur.

 

0 Kudos
Ryan_G_Intel
Employee
2,347 Views

Hi Artur,

I am glad we are making some progress.

For questions about using the API (Platform Analysis Library) I will need to point you to a much more knowledgable group which can be found here: https://software.intel.com/en-us/forums/software-tuning-performance-optimization-platform-monitoring

 

 

0 Kudos
Artur_M_
Beginner
1,869 Views

Thank you Ryan, i will post there instead.

Artur

0 Kudos
Reply