Results 1 to 1 of 1

Thread: [c#]Getting Memory Info from a AMD/ATI based GPU

  1. #1
    Join Date
    Jun 2000

    Default [c#]Getting Memory Info from a AMD/ATI based GPU

    first we need to get the ADL SDK it can be found here:Click

    since the Samples are very limited we need to add manual all the functions we need
    however all structs can be found inside include/adl_structures.h

    the memory struct can be found on line 110 .

    using the Sample-Managed.

    the import name is ( ADL.cs )

                internal static extern int ADL_Adapter_MemoryInfo_Get(int adapterIndex, ref ADLMemoryInfo lpMemoryInfo);
    the Function is

      #region ADL_Adapter_Memoryinfo_Get
            /// <summary> ADL_Adapter_MemoryInfo_Get Delegates</summary>
            internal static ADL_Adapter_MemoryInfo_GetDelegate ADL_Adapter_Memoryinfo_Get
                    if (!ADL_Adapter_Memoryinfo_Check && null == ADL_Adapter_Memoryinfo_GetDelegate_)
                        ADL_Adapter_Memoryinfo_Check = true;
                        if (ADLCheckLibrary.IsFunctionValid("ADL_Adapter_MemoryInfo_Get"))
                            ADL_Adapter_Memoryinfo_GetDelegate_ = ADLImport.ADL_Adapter_MemoryInfo_Get;
                    return ADL_Adapter_Memoryinfo_GetDelegate_;
            /// <summary> Private Delegate</summary>
            private static ADL_Adapter_MemoryInfo_GetDelegate ADL_Adapter_Memoryinfo_GetDelegate_ = null;
            /// <summary> check flag to indicate the delegate has been checked</summary>
            private static bool ADL_Adapter_Memoryinfo_Check = false;
            #endregion ADL_Adapter_Memoryinfo_Get
    now go inside Programm.cs

     for (int i = 0; i < NumberOfAdapters; i++)

    ADLMemoryInfo ADL_Memory = new ADLMemoryInfo();
    if (null != ADL.ADL_Adapter_Memoryinfo_Get)
                                            ADL.ADL_Adapter_Memoryinfo_Get(OSAdapterInfoData.ADLAdapterInfo[i].AdapterIndex, ref ADL_Memory);
                                            double MemorySize = Convert.ToDouble(ADL_Memory.iMemorySize.ToString());
                                            MemorySize /= 1048576;//Mebibyte (MiB)     220 Byte = 1.048.576 Byte ( taken from wiki )
                                            Console.WriteLine("Memory Size    : " + MemorySize.ToString() + " MB");

    the same way can be done will all other structures
    i don't take any credits for that i only have read *What is ADL and how to use it.doc* and found it out
    already added temps/clocks etc.

    you really should try it out its very interesting
    Attached Images Attached Images

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts