Pinokio
FeedAppsRemote
Author@flowshow
Download Pinokio
Sign inCreate accountJoin
Sign inCreate accountJoin

@flowshow

Joined October 2026

0 Following0 Followers
PostsReplies
More
ActivityCheckpointsFollowed appsGitHub creations
Replies · 3
@carolusGetting error Error The generation has encountered an error (AttributeError in pinned.py:55 register): ''NoneType' object has no attribute 'cudaHostRegister''. The full traceback is in the WanGP console. How to fix this?
@flowshow·4d
in Wan2GP

I got this issue

Based on the logs from latest:149-153, here is what went wrong, the
root cause, and the fix.
──────

1. What Went Wrong

During media generation with the LTX-2 distilled pipeline and Gemma
3 text encoder on Apple Silicon (M3 Max), the MMGP offloading
engine attempted to transfer model weights into GPU memory via
_PinnedStager.to_gpu.
The operation crashed with an unhandled exception:
File ".../app/mmgp/pinned.py", line 55, in register
error = torch.cuda.cudart().cudaHostRegister(self.pointer,
self.size, self.flags)
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute
'cudaHostRegister'
──────

2. Root Cause

  1. Hardware & Platform:
    • The application is running on macOS Apple Silicon (MPS) using
    unified memory (CPU RAM and GPU VRAM share the same physical
    address space).
    • PyTorch on macOS is built without CUDA support (USE_CUDA=OFF),
    meaning the CUDA Runtime library (libcudart) does not exist and
    torch.cuda.cudart() evaluates to None.
  2. Recent MMGP Upstream Changes:
    • Commit 2dca0c44 introduced pinned.py:1-61 to lock host
    staging buffers via Registration.register by calling torch.
    cuda.cudart().cudaHostRegister(...) and cudaHostUnregister(...).
  3. Missing Patch in MPS Compatibility Layer:
    • device_patch.py:105-157 redirects most CUDA methods to MPS
    and stubs _lazy_init() to a no-op.
    • However, it did not stub torch.cuda.cudart(). When MMGP
    called torch.cuda.cudart().cudaHostRegister(), cudart()
    returned None, triggering the AttributeError.

──────

3. Next Fix

Add a mock CUDA runtime stub directly in device_patch.py:154-157
inside apply_mps_patch:

Code Change in device_patch.py:154-157:

    # Stub cudart for MMGP host memory registration on Apple
    Silicon Unified Memory
    class _CudaRt:
        class cudaError:
            success = 0
        @staticmethod
        def cudaHostRegister(pointer, size, flags):
            return 0
        @staticmethod
        def cudaHostUnregister(pointer):
            return 0
        @staticmethod
        def cudaGetErrorString(error):
            return "cudaSuccess"

    _cuda_rt_instance = _CudaRt()
    _cuda.cudart = lambda: _cuda_rt_instance

Also ensure stream synchronization stubs (_dummy_stream and
_PatchedStream in device_patch.py:38-43) include:

        wait_event=lambda *a, **kw: None,
        record_event=lambda *a, **kw: None,

Once applied, restart the WanGP service in Pinokio to reload the
patched runtime.

@carolusGetting error Error The generation has encountered an error (AttributeError in pinned.py:55 register): ''NoneType' object has no attribute 'cudaHostRegister''. The full traceback is in the WanGP console. How to fix this?
@flowshow·5d
in Wan2GP
same error I got and the logs in terminal as pinokio/api/wan.git/app/mmgp/pinned.py", line 55, in register error = torch.cuda.cudart().cudaHostRegister(self.pointer, self.size, self.flags) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'cudaHostRegister' Error Queue autosaved successfully to error_queue.zip
@carolusGetting error Error The generation has encountered an error (AttributeError in pinned.py:55 register): ''NoneType' object has no attribute 'cudaHostRegister''. The full traceback is in the WanGP console. How to fix this?
@flowshow·5d
in Wan2GP
pinokio/api/wan.git/app/mmgp/pinned.py", line 55, in register error = torch.cuda.cudart().cudaHostRegister(self.pointer, self.size, self.flags) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'cudaHostRegister' Error Queue autosaved successfully to error_queue.zip
You’re all caught up.
Pinokio
PrivacyTerms
FeedAppsRemote