From be151a2520c0723c44fa805886add5aaec7701aa Mon Sep 17 00:00:00 2001 From: snomiao Date: Wed, 31 Jul 2024 15:03:12 +0000 Subject: [PATCH 1/4] chore(licence-update): Update PyProject Toml - License --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 552e415..61314b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ 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" +license = { file = "LICENSE" } dependencies = ["deepdiff", "torch", "numpy", "Pillow>=9.5.0", "pynvml", "py-cpuinfo>=9.0.0", "pyrsmi"] [project.urls] From fc5709b2e3a2f0f32e1062047a89df1aad5d46f5 Mon Sep 17 00:00:00 2001 From: Crystian Date: Wed, 31 Jul 2024 22:01:42 +0200 Subject: [PATCH 2/4] AMD Rollback, sorry AMD users! --- README.md | 5 +++- __init__.py | 2 +- core/version.py | 2 +- general/gpu.py | 67 ++++++++++++++++++++++++------------------------ pyproject.toml | 4 +-- requirements.txt | 2 -- version | 2 +- 7 files changed, 43 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index 7ff5204..8a813a4 100644 --- a/README.md +++ b/README.md @@ -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** diff --git a/__init__.py b/__init__.py index ee4bbae..238903a 100644 --- a/__init__.py +++ b/__init__.py @@ -2,7 +2,7 @@ @author: Crystian @title: Crystools @nickname: Crystools -@version: 1.15.1 +@version: 1.16.0 @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 """ diff --git a/core/version.py b/core/version.py index 76483e0..0910b68 100644 --- a/core/version.py +++ b/core/version.py @@ -1 +1 @@ -version = "1.15.1" +version = "1.16.0" diff --git a/general/gpu.py b/general/gpu.py index b724787..f14d2c6 100644 --- a/general/gpu.py +++ b/general/gpu.py @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 61314b0..9d54681 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" +version = "1.16.0" license = { file = "LICENSE" } -dependencies = ["deepdiff", "torch", "numpy", "Pillow>=9.5.0", "pynvml", "py-cpuinfo>=9.0.0", "pyrsmi"] +dependencies = ["deepdiff", "torch", "numpy", "Pillow>=9.5.0", "pynvml", "py-cpuinfo>=9.0.0"] [project.urls] Repository = "https://github.com/crystian/ComfyUI-Crystools" diff --git a/requirements.txt b/requirements.txt index 297560e..f62c840 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,5 +5,3 @@ Pillow>=9.5.0 pynvml py-cpuinfo>=9.0.0 piexif ---extra-index-url https://test.pypi.org/simple -pyrsmi==0.0.6 \ No newline at end of file diff --git a/version b/version index ace4423..15b989e 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.15.1 +1.16.0 From 566eb05b125d3d9c5e74cf31880ccc0e140050dd Mon Sep 17 00:00:00 2001 From: Crystian Date: Wed, 31 Jul 2024 22:35:49 +0200 Subject: [PATCH 3/4] improve speed on startup --- __init__.py | 2 +- core/version.py | 2 +- general/hardware.py | 5 +++-- pyproject.toml | 2 +- version | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/__init__.py b/__init__.py index 238903a..a731888 100644 --- a/__init__.py +++ b/__init__.py @@ -2,7 +2,7 @@ @author: Crystian @title: Crystools @nickname: Crystools -@version: 1.16.0 +@version: 1.16.1 @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 """ diff --git a/core/version.py b/core/version.py index 0910b68..ddfa1c3 100644 --- a/core/version.py +++ b/core/version.py @@ -1 +1 @@ -version = "1.16.0" +version = "1.16.1" diff --git a/general/hardware.py b/general/hardware.py index ad545b4..26645c8 100644 --- a/general/hardware.py +++ b/general/hardware.py @@ -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}") diff --git a/pyproject.toml b/pyproject.toml index 9d54681..43298f0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [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.16.0" +version = "1.16.1" license = { file = "LICENSE" } dependencies = ["deepdiff", "torch", "numpy", "Pillow>=9.5.0", "pynvml", "py-cpuinfo>=9.0.0"] diff --git a/version b/version index 15b989e..41c11ff 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.16.0 +1.16.1 From eef8f4755d08f7dcafddc5d2db74e7536e125066 Mon Sep 17 00:00:00 2001 From: Crystian Date: Wed, 31 Jul 2024 22:46:54 +0200 Subject: [PATCH 4/4] remove fixed version of pillow and cpuinfo --- __init__.py | 2 +- core/version.py | 2 +- pyproject.toml | 2 +- requirements.txt | 4 ++-- version | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/__init__.py b/__init__.py index a731888..33017a1 100644 --- a/__init__.py +++ b/__init__.py @@ -2,7 +2,7 @@ @author: Crystian @title: Crystools @nickname: Crystools -@version: 1.16.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 """ diff --git a/core/version.py b/core/version.py index ddfa1c3..2924828 100644 --- a/core/version.py +++ b/core/version.py @@ -1 +1 @@ -version = "1.16.1" +version = "1.16.2" diff --git a/pyproject.toml b/pyproject.toml index 43298f0..135ff07 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [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.16.1" +version = "1.16.2" license = { file = "LICENSE" } dependencies = ["deepdiff", "torch", "numpy", "Pillow>=9.5.0", "pynvml", "py-cpuinfo>=9.0.0"] diff --git a/requirements.txt b/requirements.txt index f62c840..cd1f8a4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ deepdiff torch numpy -Pillow>=9.5.0 +Pillow pynvml -py-cpuinfo>=9.0.0 +py-cpuinfo piexif diff --git a/version b/version index 41c11ff..4a02d2c 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.16.1 +1.16.2