cellpose icon indicating copy to clipboard operation
cellpose copied to clipboard

GPU not being used by Cellpose

Open ismaelfhz opened this issue 10 months ago • 3 comments

Install problem I installed CUDA 11.8.0 and PyTorch 11.8. TORCH CUDA version installed and working. The Use GPU option is enabled on the GUI. Yet, GPU remains idle (i.e. 0%) and CPU runs at max speed while running Cellpose.

Environment info Cellpose 2.2.3

Run log (cellpose) PS C:> python -m cellpose 2024-03-26 15:31:20,772 [INFO] WRITING LOG OUTPUT TO C:\Users\XXXXXXXXXX.cellpose\run.log 2024-03-26 15:31:20,772 [INFO] cellpose version: 2.2.3 platform: win32 python version: 3.11.7 torch version: 2.2.1 2024-03-26 15:31:22,626 [INFO] ** TORCH CUDA version installed and working. **

ismaelfhz avatar Mar 26 '24 14:03 ismaelfhz

Only the CNN and the net outputs are processed on the GPU, if you're not actively segmenting an image the GPU isn't utilized

mrariden avatar Apr 17 '24 20:04 mrariden

I have the same problem. If I enter print('>>> GPU activated? %d'%use_GPU) I get >>> GPU activated? 1 however the GPU usage remains ideal even when I run model.eval() . This function should be using the GPU right? Further I don't get any error at the lines before this when I initialise the model ~ model = models.Cellpose(gpu=True, model_type='cyto') How can I make sure that cellpose is using the GPU? I have fairly large images to work with around 5GB in size so would like to make use of it. Thanks!

Nespresso2000 avatar Apr 18 '24 09:04 Nespresso2000

I would use nvidia-smi on the command line to check the usage, or in windows maybe something like geforce. does the GPU version of cellpose not run faster than the CPU version?

carsen-stringer avatar Sep 11 '24 07:09 carsen-stringer