Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to enable CUDA in the plugins #1

Open
cyf203 opened this issue Feb 12, 2020 · 3 comments
Open

how to enable CUDA in the plugins #1

cyf203 opened this issue Feb 12, 2020 · 3 comments

Comments

@cyf203
Copy link

cyf203 commented Feb 12, 2020

Dear ImagePy team,

I came from cellpose repository and I am a cellpose user. When I use cellpose, I can select CPU or GPU to compute the segregation. But, I didn't see this option here. The another question is when I install cellpose-plgs from imagePy. I saw mxnet and mxnet-mkl was installed. But, my CUDA version is 10.1. If I use cellpose alone, I should install mxnet-cu101. Can you give me some suggestions?

@yxdragon
Copy link
Member

I can add the selection in the UI, but imagepy's pluginsmanager use pip solve the dependence, So you need install mxnet-cu101 with your pip.
(do you install imagepy on your local python? or download the release one which with a isolate python?)

@cyf203
Copy link
Author

cyf203 commented Feb 17, 2020

I install imagepy on my local python via pip install. Thanks for your suggestion. But, I wonder even if I installed mxnet-cu101. But, will the plugins automatically use GPU to do the segmentation? Because when I use cellpose alone, I believe no matter in GUI or script, the GPU is always an option, but not sure if it is by default using GPU or not. So, if you have a way to force GPU computation or ask user to select will be very helpful!

@yxdragon
Copy link
Member

if you are aware of python, maybe you can see the source code directly. ImagePy 's plugin is very easy to understand (all the cellpose plugin is in about 30 lines).

config "para and view", para are the parameter needed, view indicate how to show.
then call the core function in run.

here is the plugin development document.

about if GPU is used by default, I need ask @carsen-stringer.

use_gpu = utils.use_gpu()
if use_gpu:
    device = mx.gpu()
else:
    device = mx.cpu()

I think that means try to use gpu, if failed, use cpu, right?
I can add a choice in the plugin's dialog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants