CUDA must not be initialized in the main process on Spaces with Stateless GPU environment.

#72
by jedyang97 - opened

I have tried multiple times to work around this error of "CUDA must not be initialized in the main process on Spaces with Stateless GPU environment." What I did:

  • carefully made sure that in the main thread, there is no GPU call before a single .to(device) call
  • surrounded the part needing GPU with the @spaces.GPU decorator
    image.png

What makes it even harder to debug is that the log above isn't complete. Can you advise what possibly could go wrong? The code is publically available at: https://huggingface.co/spaces/jedyang97/3D-GRAND/tree/main. Thanks!

Sign up or log in to comment