crystian / ComfyUI-Crystools

A powerful set of tools for ComfyUI
MIT License
697 stars 33 forks source link

New AMD patch stops comfy from loading. #84

Closed jdamboeck closed 1 month ago

jdamboeck commented 1 month ago

Describe the bug
With the latest update the node stops comfy loading process. When i breakt out of it this is the output.

Total VRAM 16368 MB, total RAM 31706 MB
pytorch version: 2.3.0+rocm6.0
Set vram state to: NORMAL_VRAM
Device: cuda:0 AMD Radeon RX 7800 XT : native
Using sub quadratic optimization for cross attention, if you have memory or speed issues try using: --use-split-cross-attention
[Prompt Server] web root: /home/jd/build/ComfyUI/web
[Crystools INFO] Crystools version: 1.15.0
[Crystools INFO] CPU: AMD Ryzen 7 7800X3D 8-Core Processor - Arch: x86_64 - OS: Linux 6.10.1-zen1-1-zen
[Crystools ERROR] Could not init pynvml (Nvidia).Driver Not Loaded
^CTraceback (most recent call last):
  File "/home/jd/build/ComfyUI/main.py", line 227, in <module>
    nodes.init_extra_nodes(init_custom_nodes=not args.disable_all_custom_nodes)
  File "/home/jd/build/ComfyUI/nodes.py", line 2055, in init_extra_nodes
    init_external_custom_nodes()
  File "/home/jd/build/ComfyUI/nodes.py", line 1977, in init_external_custom_nodes
    success = load_custom_node(module_path, base_node_names, module_parent="custom_nodes")
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jd/build/ComfyUI/nodes.py", line 1931, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/home/jd/build/ComfyUI/custom_nodes/ComfyUI-Crystools/__init__.py", line 24, in <module>
    from .server import *
  File "/home/jd/build/ComfyUI/custom_nodes/ComfyUI-Crystools/server/__init__.py", line 1, in <module>
    from .monitor import *
  File "/home/jd/build/ComfyUI/custom_nodes/ComfyUI-Crystools/server/monitor.py", line 4, in <module>
    from ..general import cmonitor
  File "/home/jd/build/ComfyUI/custom_nodes/ComfyUI-Crystools/general/__init__.py", line 1, in <module>
    from .monitor import *
  File "/home/jd/build/ComfyUI/custom_nodes/ComfyUI-Crystools/general/monitor.py", line 66, in <module>
    cmonitor = CMonitor(1, True, True, True, True, True)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jd/build/ComfyUI/custom_nodes/ComfyUI-Crystools/general/monitor.py", line 20, in __init__
    self.hardwareInfo = CHardwareInfo(switchCPU, switchGPU, switchHDD, switchRAM, switchVRAM)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jd/build/ComfyUI/custom_nodes/ComfyUI-Crystools/general/hardware.py", line 44, in __init__
    self.GPUInfo = CGPUInfo()
                   ^^^^^^^^^^
  File "/home/jd/build/ComfyUI/custom_nodes/ComfyUI-Crystools/general/gpu.py", line 38, in __init__
    rocml.smi_initialize()
  File "/home/jd/build/ComfyUI/.venv/lib/python3.12/site-packages/pyrsmi/rocml.py", line 232, in smi_initialize
    _load_rocm_library()
  File "/home/jd/build/ComfyUI/.venv/lib/python3.12/site-packages/pyrsmi/rocml.py", line 196, in _load_rocm_library
    path_librocm = _find_lib_rocm()
                   ^^^^^^^^^^^^^^^^
  File "/home/jd/build/ComfyUI/.venv/lib/python3.12/site-packages/pyrsmi/rocml.py", line 211, in _find_lib_rocm
    for root, dirs, files in os.walk('/opt', followlinks=True):
  File "<frozen os>", line 373, in walk

Regarding: https://github.com/ROCm/pyrsmi Maybe off-topic but building on a lib that had its last update 4 months ago might not really be the best choice regarding drivers that change daily.

Edit: Or Maybe just not for consumer hardware?

pyrsmi runs on latest ROCm-supported Instinct MI-series GPU systems.
PurplefinNeptuna commented 1 month ago

how long you wait? seems you pressed ^C also this lib read "/opt/rocm/lib/librocm_smi64.so" which should be available in rocm official package (from rocm 5.7 to 6.1.2). do you have rocm-smi-lib packages installed? can your python environment access that library files?

jdamboeck commented 1 month ago

Does not matter how long i wait. It stays at [Crystools ERROR] Could not init pynvml (Nvidia).Driver Not Loaded till i ^C

And yes rocm-smi-lib is installed.

ls /opt/rocm/lib/librocm_smi64.so -als
lrwxrwxrwx 1 root root 18 19. Mär 11:17 /opt/rocm/lib/librocm_smi64.so -> librocm_smi64.so.1
PurplefinNeptuna commented 1 month ago

can you try change it to latest version of pyrsmi? pip install --index-url https://test.pypi.org/simple pyrsmi==0.0.6 I just found out that pyrsmi in default pypi repo is outdated by 1 year, and the way of old pyrsmi load file is very slow (search through all /opt files)

jdamboeck commented 1 month ago

Its not slow.. i let it run for 10 minutes... But yeah.. with the newer pyrsmi it works.

PurplefinNeptuna commented 1 month ago

well, if this now working, I need to fix the requirement better keep this open until crystian merged it later

crystian commented 1 month ago

I will try and merge it

crystian commented 1 month ago

merged