Replies · 3
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
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.

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
• 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.
• Commit 2dca0c44 introduced pinned.py:1-61 to lock host
staging buffers via Registration.register by calling torch.
cuda.cudart().cudaHostRegister(...) and cudaHostUnregister(...).
• 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:
Also ensure stream synchronization stubs (_dummy_stream and
_PatchedStream in device_patch.py:38-43) include:
Once applied, restart the WanGP service in Pinokio to reload the
patched runtime.