Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How get GPU information in C#?

Tags:

c#

gpu

I'm trying to make a software that check some information about user's Video Graphic Cards (Like: GPU Clock Speed, Bus width and etc).

I've seen this information in TechPowerUp GPU-Z software and the names of some of the SDK that you can see in the following picture:

enter image description here

CUDA Toolkit 7 for Nvidia and APP SDK for AMD

Now I have two questions:

  1. How can I access to this information by using C# code?
  2. Does CUDA Toolkit 7 and APP SDK will help to solve my problem? if it does, How?
like image 692
Shahryar Avatar asked Apr 16 '15 07:04

Shahryar


People also ask

How do I find my GPU info?

Find Out What GPU You Have in WindowsIn your PC's Start menu, type "Device Manager," and press Enter to launch the Control Panel's Device Manager. Click the drop-down arrow next to Display adapters, and it should list your GPU right there.

How do I see what GPU is in use?

Right click on the desktop and select [NVIDIA Control Panel]. Select [View] or [Desktop] (the option varies by driver version) in the tool bar then check [Display GPU Activity Icon in Notification Area]. In Windows taskbar, mouse over the "GPU Activity" icon to check the list.

How do I find my GPU in CMD?

To open it, press Windows+R, type “dxdiag” into the Run dialog that appears, and press Enter. Click the “Display” tab and look at the “Name” field in the “Device” section. Other statistics, such as the amount of video memory (VRAM) built into your GPU, are also listed here.

How do I find my GPU cores?

Get To Know The GPU In your PC's Start menu, type “Device Manager” and click on “View Device Manager.” The Device Manager will be displayed in the Control Panel. Simply click on the drop-down arrow next to Display adapters, and your GPU will be listed there as well.


1 Answers

Maybe the Win32_VideoController CLASS or the GPUinformation Class can help you.

Example:

using System.Management;
 
public partial class Win_Win32_VideoController : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        using (var searcher = new ManagementObjectSearcher("select * from Win32_VideoController"))
        {
            foreach (ManagementObject obj in searcher.Get())
            {
                Response.Write("Name  -  " + obj["Name"] + "</br>");
                Response.Write("DeviceID  -  " + obj["DeviceID"] + "</br>");
                Response.Write("AdapterRAM  -  " + obj["AdapterRAM"] + "</br>");
                Response.Write("AdapterDACType  -  " + obj["AdapterDACType"] + "</br>");
                Response.Write("Monochrome  -  " + obj["Monochrome"] + "</br>");
                Response.Write("InstalledDisplayDrivers  -  " + obj["InstalledDisplayDrivers"] + "</br>");
                Response.Write("DriverVersion  -  " + obj["DriverVersion"] + "</br>");
                Response.Write("VideoProcessor  -  " + obj["VideoProcessor"] + "</br>");
                Response.Write("VideoArchitecture  -  " + obj["VideoArchitecture"] + "</br>");
                Response.Write("VideoMemoryType  -  " + obj["VideoMemoryType"] + "</br>");
            }
        }
    }
}

You can also consult the CUDAfy.net library.

like image 70
PCpractico Avatar answered Sep 21 '22 20:09

PCpractico