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
Issue getting Cellpose to use GPU #56
Comments
Hi! The step that worked for me which was not clear was Please let me know if any of this solved your issue. EDIT: Changed the link to reflect our new documentation. |
Thanks for the help @lacan, that's right, you have to uninstall |
( |
Thanks for the comments, I had tried both the instructions on the original site (including uninstalling I believe I followed all of the CUDA setup instructions, @carsen-stringer do you have an advice on tracing what might be causing this issue? I'm not sure if this is likely an issue, but I am trying to run this locally on my laptop which has both an integrated Intel graphics card (listed as GPU 0) and an NVIDIA GeForce GTX 1060 (listed as GPU 1). Is it possible that Cellpose is querying the first GPU and deciding it can't run CUDA? Sorry if I am missing some obvious debugging steps, I have only really used CUDA/GPU computing through pre-packaged libraries like PyTorch and TensorFlow. |
Hi nolsman, |
Hmm, I'll try that next I guess. I just realized that I had a version of Cellpose installed in my base environment, I uninstalled it and updated conda, made sure to uninstall
|
It is precisely the same error message I was getting with versions >= 10.0. |
@glossdrop When you installed 9.0, did you uninstall the previous version? I found some posts saying it isn't necessary, but when I run If I do need to uninstall 10.1, do I just uninstall through the windows uninstaller, or do I also need to delete environment variables/do anything else to tell nvcc to point to 9.0? |
weird, I've also gotten that error when I didn't fully uninstall things. to specify a certain gpu you can use the "device" input
|
Yes, I did uninstall CUDA 10 before installing a previous version. I would recommend you do it too. In addition, in respect to what @carsen-stringer suggests, my computer also has an integrated and a dedicated gpu. Although when checking on the computer they respectively appear as device 0 and device 1, I can only use CUDA by setting |
I tried uninstalling CUDA10 and now just have 9, getting new errors just from running
|
I had this same error when setting up a Google Colab notebook (where CUDA 10.1 was installed) after uninstalling mxnet-mkl and installing mxnet-cu101, whereas everything worked fine on my PC (with CUDA 10.2 and mxnet-cu102, though I don't know if it's related to that). Uninstalling mxnet-mkl and installing mxnet-cu101mkl did the trick it seems, the following code runs fine:
|
Yeah I'm really confused, I tried installing everything in our compute cluster and the GPU works fine (but can't use GUI anymore). It isn't the end of the world because we can't practically do that much hand correction anyway. Apparently in the near future there will be CUDA support for Windows Subsystem for Linux, so I may try running locally again once that is out. Thanks for all the help! |
Hi all. I am having the same issue as the above, and couldn't seem to solve it (ImportError: cannot import name 'gluon' from 'mxnet') when I attempt to import in the Jupyter Notebook. In the cmd line (anaconda prompt), cellpose started running, but on the CPU, not the GPU. As I was using CUDA 9.0, i was trying to install mxnet-cu90 and mxnet-cu90mkl and encountered the problems above. As I need CUDA 9.0 for another application, I decided to try to get around this by installing CUDA 10.2, and switching to using that with mxnet-cu102 in my anaconda cellpose environment. I was attempting to do this by following the following guide: https://stackoverflow.com/questions/40517083/multiple-cuda-versions-on-machine-nvcc-v-confusion But when I checked my CUDA version in that environment, (nvcc -V) it still read 9.0. I think that could be because the above is a linux guide, and i am using windows 10. Does anyone therefore have a windows guide for pointing the path to a particular CUDA version in the cellpose environment? Alternatively, did anyone fix the original problem? |
Update: Semi-solved. I manually deleted mxnet and mxnet-mkl components in the lib/sitepackages section of the cellpose environment on my machine. I did this because pip uninstall could not find mxnet. Then I used this: pip install https://repo.mxnet.io/dist/python/cu102/mxnet_cu102-1.6.0-py2.py3-none-win_amd64.whl to download and install mxnet-cu102 (I have CUDA 10.2). I did this because pip install mxnet-cu102 could not find mxnet. Now, as you can see, the GPU is running. However, it is only running at 7 % capacity - does anyone know whether it is normal? Thanks very much. |
Hi @Jiburii First off congrats on getting it to work! Concerning your question, I have also experienced this low GPU usage on a GTX 1080. Thing is, these methods dont't use giant deep nets to work their magic. Usually what's useful is having RAM. So I would not worry about this. @carsen-stringer thank you for the new GPU version of your notebook! |
@carsen-stringer
But it seems it may not be working.
From the discussion above it seems that maybe one has to modify the |
Just an FYI, @tischi, perhaps the paths to your CUDA are not exported properly? Seeing as your anaconda .yml file has no mention of the packages I mentionned, the issue most likely lies outside of your environment. Similarily, if you install it the way you are doing it, you either need to make sure that either cellpose is installed without the dependecies OR that you uninstall mxnet before installing mxnet-cu10x as a last step. This is documented here: |
@constantinpape
Could you provide me with an example of how to do this? I am totally new to all of this! |
Because the EMBL drivers support cuda 10.2 ;). In my experience it works best to use the most up-to-date version.
This is a good point. I set up the env file a while ago and I assumed that mxnet-cu would include the cuda packages already, but that's probably not the case. @tischi I can try including the cudatoolkit, and see if this helps. |
@constantinpape |
@tischi did you manage to get that working? |
@olatarkowska |
thanks for the help @constantinpape ! |
Hi, I'm trying to test out Cellpose on data from a very large data set of bacterial images, and the CPU version seems to be struggling to process our images. I followed the instructions on your website regarding installing the GPU version of mxnet, but in the GUI the GPU setting remains grayed out.
When I try to run
model = models.Cellpose(gpu=True, model_type='cyto')
, I get the readoutUsing CPU
.My CUDA version is:
nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2019 NVIDIA Corporation Built on Fri_Feb__8_19:08:26_Pacific_Standard_Time_2019 Cuda compilation tools, release 10.1, V10.1.105
And my mxnet version is
mxnet-cu101mkl
version 1.5.0.The text was updated successfully, but these errors were encountered: