Closed btasdelen closed 1 month ago
Someone in the lab mentioned this the other day. It's because this line in config.py
of sigpy
evaluates as True
even in a completely unmodified, new Collabs notebook.
I.e. If you run
from importlib import util
cupy_enabled = util.find_spec("cupy") is not None
print(cupy_enabled)
In a new collab notebook it will print True
.
This is beacuse you get cupy
in google collabs notebooks by default, even when only running on CPU runtimes. If you switch to a GPU runtime (Runtime-->Change Runtime Type-->Select "T4 GPU") cupy
, sigpy
and pypulseq
import correctly. Unfortunately you don't seem to be able to !pip uninstall cupy
it claims it isn't installed.
I think the actual solution to this is submitting a PR to sigpy
to change the logic in the config.py so that instead of throwing an error, an ImportError
is used as an additional way to set cupy_enabled=False
.
I tested this, it looks like #188 solved it. Closing.
This was brought to my attention during the Pulseq workshop. I tested it and confirmed it. Without GPU support, we can't import
PyPulseq
, because it requiresSigPy
, which requirescuPy
and GPU compute.We should not really require GPU for sequence creation.
SigPy
listscupy
as optional. Is there a way to circumvent this error?