File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 6
6
# -----------------------------------------------------------------------------
7
7
8
8
import math
9
+ import re
9
10
import subprocess
10
11
11
12
from QEfficient .utils .constants import Constants
12
13
from QEfficient .utils .logging_utils import logger
13
14
14
15
16
+ def is_networks_loaded (stdout ):
17
+ # Check is the networks are loaded on the device.
18
+ network_loaded = re .search (r"Networks Loaded:(\d+)" , stdout )
19
+ if network_loaded and int (network_loaded .group (1 )) > 0 :
20
+ return True
21
+ return False
22
+
23
+
15
24
def get_available_device_id ():
16
25
"""
17
26
API to check available device id.
@@ -33,7 +42,7 @@ def get_available_device_id():
33
42
logger .warning ("Not a Cloud AI 100 device, Command not found" , command )
34
43
return None
35
44
if result :
36
- if "Status:Error" in result .stdout :
45
+ if "Status:Error" in result .stdout or is_networks_loaded ( result . stdout ) :
37
46
device_id += 1
38
47
elif "Status:Ready" in result .stdout :
39
48
logger .info ("device is available." )
You can’t perform that action at this time.
0 commit comments