@@ -1767,6 +1767,7 @@ def hide_tooltip(event):
1767
1767
CLDevicesNames = ["" ,"" ,"" ,"" ]
1768
1768
CUDevicesNames = ["" ,"" ,"" ,"" ,"" ]
1769
1769
VKDevicesNames = ["" ,"" ,"" ,"" ]
1770
+ VKIsDGPU = [0 ,0 ,0 ,0 ]
1770
1771
MaxMemory = [0 ]
1771
1772
1772
1773
tabcontent = {}
@@ -2005,11 +2006,18 @@ def auto_gpu_heuristics():
2005
2006
try : # Get Vulkan names
2006
2007
output = subprocess .run (['vulkaninfo' ,'--summary' ], capture_output = True , text = True , check = True , encoding = 'utf-8' ).stdout
2007
2008
devicelist = [line .split ("=" )[1 ].strip () for line in output .splitlines () if "deviceName" in line ]
2009
+ devicetypes = [line .split ("=" )[1 ].strip () for line in output .splitlines () if "deviceType" in line ]
2008
2010
idx = 0
2009
2011
for dname in devicelist :
2010
2012
if idx < len (VKDevicesNames ):
2011
2013
VKDevicesNames [idx ] = dname
2012
2014
idx += 1
2015
+ if len (devicetypes ) == len (devicelist ):
2016
+ idx = 0
2017
+ for dvtype in devicetypes :
2018
+ if idx < len (VKIsDGPU ):
2019
+ VKIsDGPU [idx ] = (1 if dvtype == "PHYSICAL_DEVICE_TYPE_DISCRETE_GPU" else 0 )
2020
+ idx += 1
2013
2021
except Exception as e :
2014
2022
pass
2015
2023
@@ -2029,6 +2037,12 @@ def auto_gpu_heuristics():
2029
2037
runopts_var .set ("Use CuBLAS" )
2030
2038
elif "Use hipBLAS (ROCm)" in runopts :
2031
2039
runopts_var .set ("Use hipBLAS (ROCm)" )
2040
+ elif exitcounter < 100 and (1 in VKIsDGPU ) and runmode_untouched and "Use Vulkan" in runopts :
2041
+ for i in range (0 ,len (VKIsDGPU )):
2042
+ if VKIsDGPU [i ]== 1 :
2043
+ runopts_var .set ("Use Vulkan" )
2044
+ gpu_choice_var .set (str (i + 1 ))
2045
+ break
2032
2046
2033
2047
changed_gpu_choice_var ()
2034
2048
return
0 commit comments