File tree Expand file tree Collapse file tree
bindings/sysman/python/source Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,8 +70,6 @@ def _LoadZeLibrary():
7070 libName = "/usr/lib/x86_64-linux-gnu/lib" + libName + ".so.1"
7171 else :
7272 # Try multiple common locations for Windows Intel GPU drivers
73- import os
74-
7573 possible_paths = [
7674 # Try system PATH first
7775 libName + "64.dll" ,
@@ -84,34 +82,29 @@ def _LoadZeLibrary():
8482
8583 library_loaded = False
8684 for path in possible_paths :
87- try :
88- if "*" in path :
89- # Handle wildcard paths for driver store
90- import glob
91-
92- matching_paths = glob .glob (path )
93- for match_path in matching_paths :
94- try :
95- gpuLib = CDLL (match_path )
96- library_loaded = True
97- break
98- except Exception :
99- continue
100- else :
101- if os .path .exists (path ):
102- gpuLib = CDLL (path )
103- library_loaded = True
104- break
105- else :
106- gpuLib = CDLL (path )
107- library_loaded = True
108- break
109- except Exception :
110- continue
111-
11285 if library_loaded :
11386 break
11487
88+ if "*" in path :
89+ # Handle wildcard paths for driver store
90+ import glob
91+
92+ matching_paths = glob .glob (path )
93+ for match_path in matching_paths :
94+ try :
95+ gpuLib = CDLL (match_path )
96+ library_loaded = True
97+ break
98+ except OSError :
99+ pass # Try next path
100+ else :
101+ # Try loading the library directly
102+ try :
103+ gpuLib = CDLL (path )
104+ library_loaded = True
105+ except OSError :
106+ pass # Try next path
107+
115108 if not library_loaded :
116109 raise Exception (
117110 f"Failed to load Intel GPU library. Tried paths: { possible_paths } "
You can’t perform that action at this time.
0 commit comments