forked from william-murray1204/stable-diffusion-cpp-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_system_info.py
More file actions
26 lines (20 loc) · 763 Bytes
/
test_system_info.py
File metadata and controls
26 lines (20 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import os
import traceback
import stable_diffusion_cpp.stable_diffusion_cpp as sd_cpp
try:
# Get system info
system_info = sd_cpp.sd_get_system_info()
num_physical_cores = sd_cpp.get_num_physical_cores()
# Print system info
print("System info: ", system_info)
print("Number of physical cores: ", num_physical_cores)
OUTPUT_DIR = "tests/outputs"
if not os.path.exists(OUTPUT_DIR):
os.makedirs(OUTPUT_DIR)
# Write system info to file txt
with open(f"{OUTPUT_DIR}/system_info.txt", "w") as f:
f.write(f"System info: {str(system_info)}\n")
f.write(f"Number of physical cores: {str(num_physical_cores)}")
except Exception as e:
traceback.print_exc()
print("Test - system_info failed: ", e)