Skip to content

Commit

Permalink
fix sysinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
lshqqytiger committed Feb 16, 2024
1 parent 7ed2ff1 commit 601f7e3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions modules/sysinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import launch
from modules import paths_internal, timer, shared, extensions, errors, devices
from modules.dml.device_properties import DeviceProperties

checksum_token = "DontStealMyGamePlz__WINNERS_DONT_USE_DRUGS__DONT_COPY_THAT_FLOPPY"
environment_whitelist = {
Expand Down Expand Up @@ -72,7 +71,12 @@ def check(x):

def get_dict():
ram = psutil.virtual_memory()
gpu = DeviceProperties(devices.device)
gpu = None
try:
from modules.dml.device_properties import DeviceProperties
gpu = DeviceProperties(devices.device)
except Exception:
pass

res = {
"Platform": platform.platform(),
Expand All @@ -94,7 +98,7 @@ def get_dict():
"RAM": {
x: pretty_bytes(getattr(ram, x, 0)) for x in ["total", "used", "free", "active", "inactive", "buffers", "cached", "shared"] if getattr(ram, x, 0) != 0
},
"GPU": {
"GPU": "DirectML is not initialized" if gpu is None else {
"model": gpu.name,
"total_memory": gpu.total_memory,
},
Expand Down

0 comments on commit 601f7e3

Please sign in to comment.