2023-02-25 08:19:07 +00:00
|
|
|
def get_debug_info():
|
|
|
|
import os.path
|
|
|
|
import sys
|
2023-01-27 05:41:52 +00:00
|
|
|
|
2023-02-25 08:19:07 +00:00
|
|
|
import psutil
|
|
|
|
import torch
|
2023-01-27 05:41:52 +00:00
|
|
|
|
2023-02-25 08:19:07 +00:00
|
|
|
from imaginairy.utils import get_device, get_hardware_description
|
|
|
|
from imaginairy.version import get_version
|
2023-02-03 05:43:04 +00:00
|
|
|
|
2023-01-27 05:41:52 +00:00
|
|
|
data = {
|
2023-02-03 05:43:04 +00:00
|
|
|
"imaginairy_version": get_version(),
|
2023-01-27 05:41:52 +00:00
|
|
|
"imaginairy_path": os.path.dirname(__file__),
|
|
|
|
"python_version": f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}",
|
|
|
|
"python_installation_path": sys.executable,
|
|
|
|
"device": get_device(),
|
|
|
|
"torch_version": torch.__version__,
|
|
|
|
"platform": sys.platform,
|
|
|
|
"hardware_description": get_hardware_description(get_device()),
|
2023-02-25 08:19:07 +00:00
|
|
|
"ram_gb": round(psutil.virtual_memory().total / (1024**3), 2),
|
2023-01-27 05:41:52 +00:00
|
|
|
}
|
|
|
|
if torch.cuda.is_available():
|
|
|
|
device_props = torch.cuda.get_device_properties(0)
|
|
|
|
data.update(
|
|
|
|
{
|
|
|
|
"cuda_version": torch.version.cuda,
|
|
|
|
"graphics_card": device_props.name,
|
|
|
|
"graphics_card_memory": device_props.total_memory,
|
|
|
|
"graphics_card_processor_count": device_props.multi_processor_count,
|
|
|
|
"graphics_card_hw_version": f"{device_props.major}.{device_props.minor}",
|
|
|
|
}
|
|
|
|
)
|
2023-02-25 08:19:07 +00:00
|
|
|
elif "mps" in get_device():
|
|
|
|
data.update(
|
|
|
|
{
|
|
|
|
"graphics_card": "Apple MPS",
|
|
|
|
}
|
|
|
|
)
|
2023-01-27 05:41:52 +00:00
|
|
|
return data
|