Merge branch 'main' into horizontalUI

This commit is contained in:
Crystian
2024-07-31 22:47:36 +02:00
8 changed files with 49 additions and 46 deletions
+4 -1
View File
@@ -36,7 +36,7 @@ You can configure the refresh rate which resources to show:
![Monitors](./docs/monitor-settings.png)
> **Notes:**
> - The GPU data is only available when you use CUDA (only NVIDIA cards, partial support of AMD users on linux).
> - The GPU data is only available when you use CUDA (only NVIDIA cards, sorry AMD users).
> - This extension needs ComfyUI 1915 (or higher).
> - The cost of the monitor is low (0.1 to 0.5% of utilization), you can disable it from settings (`Refres rate` to `0`).
> - Data comes from these libraries:
@@ -512,6 +512,9 @@ You have predefined switches (string, latent, image, conditioning) but you can u
### Crystools
### 1.16.0 (31/07/2024)
- Rollback of AMD support by manager does not support other repository parameter (https://test.pypi.org/simple by pyrsmi)
### 1.15.0 (21/07/2024)
- AMD Branch merged to the main branch, should work for AMD users on **Linux**
+1 -1
View File
@@ -2,7 +2,7 @@
@author: Crystian
@title: Crystools
@nickname: Crystools
@version: 1.15.1
@version: 1.16.2
@project: "https://github.com/crystian/ComfyUI-Crystools",
@description: Plugins for multiples uses, mainly for debugging, you need them! IG: https://www.instagram.com/crystian.ia
"""
+1 -1
View File
@@ -1 +1 @@
version = "1.15.1"
version = "1.16.2"
+34 -33
View File
@@ -2,8 +2,8 @@ import torch
import pynvml
import comfy.model_management
from ..core import logger
from ctypes import *
from pyrsmi import rocml
# from ctypes import *
# from pyrsmi import rocml
class CGPUInfo:
"""
@@ -11,8 +11,8 @@ class CGPUInfo:
"""
cuda = False
pynvmlLoaded = False
pyamdLoaded = False
anygpuLoaded = False
# pyamdLoaded = False
# anygpuLoaded = False
cudaAvailable = False
torchDevice = 'cpu'
cudaDevice = 'cpu'
@@ -33,15 +33,16 @@ class CGPUInfo:
except Exception as e:
logger.error('Could not init pynvml (Nvidia).' + str(e))
if not self.pynvmlLoaded:
try:
rocml.smi_initialize()
self.pyamdLoaded = True
logger.info('Pyrsmi (AMD) initialized.')
except Exception as e:
logger.error('Could not init pyrsmi (AMD).' + str(e))
# if not self.pynvmlLoaded:
# try:
# rocml.smi_initialize()
# self.pyamdLoaded = True
# logger.info('Pyrsmi (AMD) initialized.')
# except Exception as e:
# logger.error('Could not init pyrsmi (AMD).' + str(e))
self.anygpuLoaded = self.pynvmlLoaded or self.pyamdLoaded
# self.anygpuLoaded = self.pynvmlLoaded or self.pyamdLoaded
self.anygpuLoaded = self.pynvmlLoaded
try:
self.torchDevice = comfy.model_management.get_torch_device_name(comfy.model_management.get_torch_device())
@@ -52,7 +53,7 @@ class CGPUInfo:
if 'zluda' in self.torchDevice or 'ZLUDA' in self.torchDevice or 'Zluda' in self.torchDevice:
logger.warn('ZLUDA detected. GPU monitoring will be disabled.')
self.anygpuLoaded = False
self.pyamdLoaded = False
# self.pyamdLoaded = False
self.pynvmlLoaded = False
if self.anygpuLoaded and self.deviceGetCount() > 0:
@@ -183,16 +184,16 @@ class CGPUInfo:
def deviceGetCount(self):
if self.pynvmlLoaded:
return pynvml.nvmlDeviceGetCount()
elif self.pyamdLoaded:
return rocml.smi_get_device_count()
# elif self.pyamdLoaded:
# return rocml.smi_get_device_count()
else:
return 0
def deviceGetHandleByIndex(self, index):
if self.pynvmlLoaded:
return pynvml.nvmlDeviceGetHandleByIndex(index)
elif self.pyamdLoaded:
return index
# elif self.pyamdLoaded:
# return index
else:
return 0
@@ -212,26 +213,26 @@ class CGPUInfo:
print(f"UnicodeDecodeError: {e}")
return gpuName
elif self.pyamdLoaded:
return rocml.smi_get_device_name(deviceIndex)
# elif self.pyamdLoaded:
# return rocml.smi_get_device_name(deviceIndex)
else:
return ''
def systemGetDriverVersion(self):
if self.pynvmlLoaded:
return f'NVIDIA Driver: {pynvml.nvmlSystemGetDriverVersion()}'
elif self.pyamdLoaded:
ver_str = create_string_buffer(256)
rocml.rocm_lib.rsmi_version_str_get(0, ver_str, 256)
return f'AMD Driver: {ver_str.value.decode()}'
# elif self.pyamdLoaded:
# ver_str = create_string_buffer(256)
# rocml.rocm_lib.rsmi_version_str_get(0, ver_str, 256)
# return f'AMD Driver: {ver_str.value.decode()}'
else:
return 'Driver unknown'
def deviceGetUtilizationRates(self, deviceHandle):
if self.pynvmlLoaded:
return pynvml.nvmlDeviceGetUtilizationRates(deviceHandle).gpu
elif self.pyamdLoaded:
return rocml.smi_get_device_utilization(deviceHandle)
# elif self.pyamdLoaded:
# return rocml.smi_get_device_utilization(deviceHandle)
else:
return 0
@@ -239,19 +240,19 @@ class CGPUInfo:
if self.pynvmlLoaded:
mem = pynvml.nvmlDeviceGetMemoryInfo(deviceHandle)
return {'total': mem.total, 'used': mem.used}
elif self.pyamdLoaded:
mem_used = rocml.smi_get_device_memory_used(deviceHandle)
mem_total = rocml.smi_get_device_memory_total(deviceHandle)
return {'total': mem_total, 'used': mem_used}
# elif self.pyamdLoaded:
# mem_used = rocml.smi_get_device_memory_used(deviceHandle)
# mem_total = rocml.smi_get_device_memory_total(deviceHandle)
# return {'total': mem_total, 'used': mem_used}
else:
return {'total': 1, 'used': 1}
def deviceGetTemperature(self, deviceHandle):
if self.pynvmlLoaded:
return pynvml.nvmlDeviceGetTemperature(deviceHandle, pynvml.NVML_TEMPERATURE_GPU)
elif self.pyamdLoaded:
temp = c_int64(0)
rocml.rocm_lib.rsmi_dev_temp_metric_get(deviceHandle, 1, 0, byref(temp))
return temp.value / 1000
# elif self.pyamdLoaded:
# temp = c_int64(0)
# rocml.rocm_lib.rsmi_dev_temp_metric_get(deviceHandle, 1, 0, byref(temp))
# return temp.value / 1000
else:
return 0
+3 -2
View File
@@ -36,8 +36,9 @@ class CHardwareInfo:
self.switchHDD = switchHDD
self.switchRAM = switchRAM
specName = 'CPU: ' + cpuinfo.get_cpu_info().get('brand_raw', "Unknown")
specArch = 'Arch: ' + cpuinfo.get_cpu_info().get('arch_string_raw', "Unknown")
get_cpu_info = cpuinfo.get_cpu_info()
specName = 'CPU: ' + get_cpu_info.get('brand_raw', "Unknown")
specArch = 'Arch: ' + get_cpu_info.get('arch_string_raw', "Unknown")
specOs = 'OS: ' + str(platform.system()) + ' ' + str(platform.release())
logger.info(f"{specName} - {specArch} - {specOs}")
+3 -3
View File
@@ -1,9 +1,9 @@
[project]
name = "comfyui-crystools"
description = "With this suit, you can see the resources monitor, progress bar & time elapsed, metadata and compare between two images, compare between two JSONs, show any value to console/display, pipes, and more!\nThis provides better nodes to load/save images, previews, etc, and see \"hidden\" data without loading a new workflow."
version = "1.15.1"
license = "LICENSE"
dependencies = ["deepdiff", "torch", "numpy", "Pillow>=9.5.0", "pynvml", "py-cpuinfo>=9.0.0", "pyrsmi"]
version = "1.16.2"
license = { file = "LICENSE" }
dependencies = ["deepdiff", "torch", "numpy", "Pillow>=9.5.0", "pynvml", "py-cpuinfo>=9.0.0"]
[project.urls]
Repository = "https://github.com/crystian/ComfyUI-Crystools"
+2 -4
View File
@@ -1,9 +1,7 @@
deepdiff
torch
numpy
Pillow>=9.5.0
Pillow
pynvml
py-cpuinfo>=9.0.0
py-cpuinfo
piexif
--extra-index-url https://test.pypi.org/simple
pyrsmi==0.0.6
+1 -1
View File
@@ -1 +1 @@
1.15.1
1.16.2