Skip to content

Commit c80b4ef

Browse files
committed
Updated20241206201553
1 parent a516cc2 commit c80b4ef

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

VGPUTool.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,14 @@ def components(self):
115115
self.main.pack(padx=10, pady=10, fill=tk.BOTH, expand=True)
116116

117117
def getGPUCard(self):
118-
# command = 'Start-Process powershell -Verb RunAs -ArgumentList "-file",".\PreCheck.ps1"'
119-
# command = ('powershell "$Devices = (Get-WmiObject -Class "Msvm_PartitionableGpu" -ComputerName $env:COMPUTERNAME -Namespace "ROOT\\virtualization\\v2").name\n'
120-
# 'Foreach ($GPU in $Devices) {\n'
121-
# '$GPUParse = $GPU.Split(\'#\')[1]\n'
122-
# 'Get-WmiObject Win32_PNPSignedDriver | where {($_.HardwareID -eq "PCI\\$GPUParse")} | select DeviceName -ExpandProperty DeviceName\n'
123-
# '}\n\n"')
124118
command = 'powershell .\\PreCheck.ps1'
125119
print(command)
126120
process = subprocess.run(command, shell=True, text=True, capture_output=True)
127-
outputs = process.stdout
121+
outputs = process.stdout.split("\n")
128122
print(outputs)
123+
self.view['gpu_name']['entry']['values'] = outputs
124+
self.view['gpu_name']['entry'].current(0)
125+
return outputs
129126

130127

131128
if __name__ == "__main__":

0 commit comments

Comments
 (0)