Skip to content

Commit 87d852b

Browse files
committed
get gpu names with vulkaninfo
1 parent c9ecd0f commit 87d852b

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

koboldcpp.py

+14-2
Original file line numberDiff line numberDiff line change
@@ -1146,6 +1146,7 @@ def show_new_gui():
11461146
CUDevices = ["1","2","3","4","All"]
11471147
CLDevicesNames = ["","","",""]
11481148
CUDevicesNames = ["","","","",""]
1149+
VKDevicesNames = ["","","",""]
11491150
MaxMemory = [0]
11501151

11511152
tabcontent = {}
@@ -1360,6 +1361,17 @@ def auto_gpu_heuristics():
13601361
except Exception as e:
13611362
pass
13621363

1364+
try: # Get Vulkan names
1365+
output = run(['vulkaninfo','--summary'], capture_output=True, text=True, check=True, encoding='utf-8').stdout
1366+
devicelist = [line.split("=")[1].strip() for line in output.splitlines() if "deviceName" in line]
1367+
idx = 0
1368+
for dname in devicelist:
1369+
if idx<len(VKDevicesNames):
1370+
VKDevicesNames[idx] = dname
1371+
idx += 1
1372+
except Exception as e:
1373+
pass
1374+
13631375
for idx in range(0,4):
13641376
if(len(FetchedCUdevices)>idx):
13651377
CUDevicesNames[idx] = FetchedCUdevices[idx]
@@ -1461,8 +1473,8 @@ def changed_gpu_choice_var(*args):
14611473
s = int(gpu_choice_var.get())-1
14621474
v = runopts_var.get()
14631475
if v == "Use Vulkan":
1464-
quick_gpuname_label.configure(text="")
1465-
gpuname_label.configure(text="")
1476+
quick_gpuname_label.configure(text=VKDevicesNames[s])
1477+
gpuname_label.configure(text=VKDevicesNames[s])
14661478
elif v == "Use CLBlast" or v == "CLBlast NoAVX2 (Old CPU)":
14671479
quick_gpuname_label.configure(text=CLDevicesNames[s])
14681480
gpuname_label.configure(text=CLDevicesNames[s])

0 commit comments

Comments
 (0)