Forum Discussion

jonathan_2's avatar
jonathan_2
Occasional Contributor
13 years ago

Monitoring Video Memory

I am creating a library of performance testing scripts for the software that my company produces. I was wondering if there are any functions in test complete that would allow me to check the video card memory usage.
If not; is there a DLL that I can hook into? Or is there any way that I can connect my test complete script to the ATI Catalyst Control Center to bring data in from there?

5 Replies

  • AlexKaras's avatar
    AlexKaras
    Icon for Champion Level 1 rankChampion Level 1

    Hi Jonathan,




    Below is what was posted somewhere in time in the old good TestComplete newsgroup. :)

    Hope that it will inspire you with the ideas.




    //From: "How can I get Video Memory usage in the script?", Dec 16, 2008

    //1. Add the "Microsoft.DirectX.DirectDraw" assembly to the "Selected

    //  Components" list of the CLR Bridge option (see the "Project Properties -

    //  CLR Bridge Options" help topic for details).

    //2. Use the following script:



    function Test_VideoMemory();

      var ddDevice, ddCaps : OleVariant;

    begin

      ddDevice :=

      dotNET.Microsoft_DirectX_DirectDraw.Device.zctor(dotNET.Microsoft_DirectX_DirectDraw.CreateFlags.HardwareOnly);

      ddCaps := ddDevice.GetCaps();



      Log.Message('Free video memory: ' + ddCaps.HardwareCaps.VideoMemoryFree/1024/1024 + ' MB');

    end;



  • jonathan_2's avatar
    jonathan_2
    Occasional Contributor
    I found the solution it was to use the CUDA SDK to gather the needed information from NVIDIA video cards. It took 2 days of work to get my solution up and running. Now I am able to monitor the activity of the video card.

  • Hi Jonathan,


     


    TestComplete doesn't have a built-in method to identify it. However, I suppose that there should be a third-party utility or DLL that you can use to accomplish your task. As for calling DLL functions in TestComplete, read this article.


     

  • jonathan_2's avatar
    jonathan_2
    Occasional Contributor


    Thank you Alexei, that has given me an idea as to what direction to go. It will take me some time to modify the code that you gave me to work the way I need it to but it is a start.

    Thanks again.


  • jonathan_2's avatar
    jonathan_2
    Occasional Contributor
    Thanks again for the help. Unfortunately after a lot of experimentation I was not able to get the code to work. "dotNET" is still supported by TC but I could not find any way to hook into Microsoft's direct X. I tried the exact code that you gave and I tried several other “dotNET” functions but so far no luck.


    I tried a few other things including having TC read data from a third party GPU tool. This also did not work.

    I also tried having Test Complete read data from the ATI video memory monitoring tool but Test Complete could not actually read the data that the tool was displaying.

    In the past, another tester at my company tried to do this but he was never able to get consistent results.

    It would be nice if Test Complete had a built in feature that could do this. Unfortunately after a lot of discussion with developers I found that this is not a trivial problem.



    I am still open to suggestions. For now though I am going to try a few other things, but it looks like monitoring GPU performance is going to have to wait.