Notifications
Clear all
[Closed] Get Graphics Card Name?
Apr 25, 2017 12:19 pm
Anyone know how to get the manufacturer name of the graphics card in the machine via maxscript?
I want to figure out if it’s NVidia for Cuda or AMD for openCL…
doesfileexist @“C:\Program Files\AMD”
doesfileexist @“C:\Program Files\NVidia Corporation”
Doesn’t seem the safest way to do it!
2 Replies
Apr 25, 2017 12:19 pm
OGSDiagnostics.hardwareReport
"//////////////////////////////////////////////////////////////////////////////
////////// Nitrous Hardware Report
//////////////////////////////////////////////////////////////////////////////
0: [X]AMD FirePro V7900 (FireGL V) \\.\DISPLAY2
1: AMD FirePro V7900 (FireGL V) \\.\DISPLAY1
"
Apr 25, 2017 12:19 pm
the solution found here
fn ManagementObjectSearcherAssembly =
(
source = ""
source += "using System;
"
source += "using System.Management;
"
source += "using System.Collections.Generic;
"
source += "namespace ManagementObjectSearcherOps
"
source += "{
"
source += " class Video
"
source += " {
"
source += " public Object[] GetVideoControllers()
"
source += " {
"
source += " List<Object> props = new List<Object>();
"
source += " ManagementObjectSearcher searcher = new ManagementObjectSearcher(\"SELECT * FROM Win32_VideoController\");
"
source += " foreach (ManagementObject obj in searcher.Get())
"
source += " {
"
source += " PropertyData currentBitsPerPixel = obj.Properties[\"CurrentBitsPerPixel\"]; //check for valid Graph Card Controller
"
source += " PropertyData description = obj.Properties[\"Description\"];
"
source += " if (currentBitsPerPixel != null && description != null)
"
source += " {
"
source += " if (currentBitsPerPixel.Value != null) props.Add(description.Value);
"
source += " }
"
source += " }
"
source += " return props.ToArray();
"
source += " }
"
source += " }
"
source += "}
"
csharpProvider = dotnetobject "Microsoft.CSharp.CSharpCodeProvider"
compilerParams = dotnetobject "System.CodeDom.Compiler.CompilerParameters"
compilerParams.ReferencedAssemblies.AddRange #("System.dll", "System.Management.dll")
compilerParams.GenerateInMemory = on
compilerResults = csharpProvider.CompileAssemblyFromSource compilerParams #(source)
assembly = compilerResults.CompiledAssembly
assembly.CreateInstance "ManagementObjectSearcherOps.Video"
)
global ManagementVideo = ManagementObjectSearcherAssembly()
vc = ManagementVideo.GetVideoControllers()
it can give you more info than just a Video Card name…