Skip to content

p2p_registry hardcodes "libcudart.so" — FileNotFoundError during NVFP4 dequantize (MiniMax H3) #218

Description

@lumennoxx-sketch

Environment

  • OS: Windows 11
  • ComfyUI: Desktop app, core up to date (commit d8e7bbc)
  • ComfyUI-MultiGPU version: 2.6.4 (latest available)
  • GPUs: RTX 5080 (cuda:0) + 2x RTX 3080 (cuda:1, cuda:2)
  • PyTorch 2.13.0+cu130

Description
When using DisTorch2MultiGPU loaders with MiniMax H3's NVFP4-quantized text
encoder (qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors), execution fails
because p2p_registry.py hardcodes a Linux shared library name with no
Windows fallback:

p2p_registry.py, line 20:
_libcudart = ctypes.CDLL("libcudart.so")

This should resolve to cudart64_*.dll on Windows instead.

Steps to reproduce

  1. Load the official MiniMax H3 I2V/T2V workflow
  2. Replace UNETLoader/CLIPLoader/VAELoader with the DisTorch2MultiGPU
    equivalents, split across cuda:0/cuda:1/cuda:2 (CLIP donor_device: cpu)
  3. Queue a generation
  4. NVFP4 dequantization triggers a P2P device-access check that crashes

Expected behavior
The CUDA runtime lookup in _get_libcudart() should work cross-platform,
or the P2P check should skip gracefully when it can't load the library.

Actual behavior
FileNotFoundError, full relevant traceback:

File "...\custom_nodes\comfy_kitchen\backends\cuda\__init__.py", line 658, in dequantize_nvfp4
    _wrap_for_dlpack(qx),
  File "...\custom_nodes\comfyui-multigpu\__init__.py", line 557, in wrap_for_dlpack_with_device_guard
    if tensor_device.index != exec_device.index and not p2p_registry.can_access_peer(tensor_device.index, exec_device.index):
  File "...\custom_nodes\comfyui-multigpu\p2p_registry.py", line 62, in can_access_peer
    result = self._raw_can_access_peer(src_device, dst_device)
  File "...\custom_nodes\comfyui-multigpu\p2p_registry.py", line 38, in _raw_can_access_peer
    lib = _get_libcudart()
  File "...\custom_nodes\comfyui-multigpu\p2p_registry.py", line 20, in _get_libcudart
    _libcudart = ctypes.CDLL("libcudart.so")
FileNotFoundError: Could not find module 'libcudart.so' (or one of its
dependencies). Try using the full path with constructor syntax.

Notes
Also reproduces when the donor_device is cpu (not just GPU-to-GPU),
suggesting the P2P check may be firing in cases where it shouldn't need to
run at all.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions