@@ -169,10 +169,16 @@ def _get_intel_gpus() -> str:
169169 ARC cards:
170170 We rely on the output of clinfo
171171 """
172+ # pyinstaller sets the LD_LIBRARY_PATH env variable value to a folder with unpacked dependencies
173+ # which contains the libstdc++.so.6 library - this library causes errors while executing clinfo/xpu-smi.
174+ # I remove then this variable from env passed to clinfo - to get rid of this error.
175+ env = os .environ .copy ()
176+ env .pop ("LD_LIBRARY_PATH" , None )
177+
172178 # Only valid for MAX cards
173179 try :
174180 logger .debug ("Getting the list of Intel GPU with `xpu-smi discovery`" )
175- xpu_output = subprocess .check_output (["xpu-smi" , "discovery" ], timeout = 5 ).decode ("utf-8" ) # noqa: S607
181+ xpu_output = subprocess .check_output (["xpu-smi" , "discovery" ], timeout = 5 , env = env ).decode ("utf-8" ) # noqa: S607
176182 logger .debug (xpu_output )
177183 if ResourcesChecksTexts .intel_gpu_no_devices in xpu_output :
178184 logger .debug ("No devices" )
@@ -187,11 +193,13 @@ def _get_intel_gpus() -> str:
187193 try :
188194 command = 'clinfo|grep "' + ResourcesChecksTexts .intel_gpu_arc_device_name + '"|grep Intel'
189195 logger .debug (f"Getting the list of Intel ARC with { command } " )
196+
190197 clinfo_output = subprocess .check_output ( # noqa: S602 # nosec: B602
191198 command ,
192199 stderr = subprocess .STDOUT ,
193200 shell = True ,
194201 timeout = 5 ,
202+ env = env ,
195203 ).decode ("utf-8" )
196204 logger .debug (clinfo_output )
197205 if ResourcesChecksTexts .intel_gpu_arc_device_name in clinfo_output :
0 commit comments