forked from tutulino/Megaminer
-
Notifications
You must be signed in to change notification settings - Fork 1
/
GPUList.ps1
69 lines (41 loc) · 1.52 KB
/
GPUList.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Add-Type -Path .\OpenCL\*.cs
$OCLPlatforms = @()
$counter=0
[OpenCl.Platform]::GetPlatformIDs() | ForEach-Object {
$OCLPlatforms+=[pscustomobject]@{
PlatformId=$counter
Name=$_.Name
Vendor=$_.vendor
}
$counter++
}
$OCLPlatforms | out-host
<#
#Get GPUPlatforms
$GpuPlatforms=@()
$counter=0
(Get-WmiObject -class CIM_VideoController | Select-Object -ExpandProperty AdapterCompatibility) | ForEach-Object {
$GpuPlatforms +=[pscustomObject]@{
PlatformId = $counter
Type = $_
}
$counter+=1
}
"-------------------GPU PLATFORMS------------------------ "
$GpuPlatforms | Out-Host
#Get SMI info for nvidia cards
$NvidiaCards=@()
$counter=0
$env:CUDA_DEVICE_ORDER = 'PCI_BUS_ID' #This align cuda id with nvidia-smi order
invoke-expression "./nvidia-smi.exe --query-gpu=gpu_name --format=csv,noheader" | ForEach-Object {
$SMIresultSplit = $_ -split (",")
$NvidiaCards +=[pscustomObject]@{
GpuId = $counter
gpu_name = $SMIresultSplit[0]
}
$counter+=1
}
#Show nvidia cards list
"-------------------NVIDIA GPUS------------------------ "
$NvidiaCards | Out-Host
#>