Fix for PSHuman on ZeroGPU Blackwell / torch 2.11.0+cu130

#9
by painter3000 - opened

Hi @fffiloni ,

first of all, thank you for maintaining the PSHuman Space on Hugging Face.

I have been working on a Blackwell / ZeroGPU compatibility fix after the recent migration to NVIDIA RTX PRO 6000 Blackwell and the torch 2.11.0+cu130 stack.

I managed to get my PSHuman Space running again on Hugging Face ZeroGPU with the full pipeline working:

  • Multiview generation works again
  • SMPL body optimization runs through
  • Reconstruction runs through
  • MP4 video export via MoviePy completes successfully

The working setup uses:

  • torch 2.11.0+cu130
  • CUDA 13.0
  • NVIDIA RTX PRO 6000 Blackwell / sm_120
  • backend:cudaMallocAsync for the subprocess CUDA allocator
  • custom cu130 wheels for pytorch3d, torch_scatter, nvdiffrast, kaolin, and xformers
  • sys.executable instead of "python" for subprocess calls
  • SDPA as a safe fallback for multiview attention
  • removal of the deprecated verbose argument from ReduceLROnPlateau in reconstruct.py

The most important fixes were:

  1. Move the whole stack from cu128 to cu130.
  2. Use sys.executable for inference.py subprocess calls.
  3. Set PYTORCH_CUDA_ALLOC_CONF=backend:cudaMallocAsync in the subprocess environment.
  4. Replace the torch.bmm attention fallback with torch.nn.functional.scaled_dot_product_attention to avoid huge quadratic memory usage.
  5. Patch the diffusers 0.31.0 Attention API incompatibility by using keyword arguments instead of positional arguments.
  6. Remove verbose=0 from ReduceLROnPlateau in reconstruct.py because torch 2.11 no longer accepts it.
  7. Use warp-lang >= 1.5.0 for kaolin 0.18.0.
  8. Use a real CUDA-built nvdiffrast wheel, not a py3-none-any wheel without the compiled plugin.

I documented the full fix notes here:

https://huggingface.co/spaces/painter3000/PSHuman/blob/main/PSHUMAN_BLACKWELL_FIX_NOTES_ENG_US.md

My working Space is here:

https://huggingface.co/spaces/painter3000/PSHuman

If this is useful, feel free to use my notes or compare the changes with your Space to restore PSHuman on the current ZeroGPU Blackwell/cu130 environment.

Best regards,
Michael / Painter3000

Sign up or log in to comment