tlambert03 / pycudadecon

Python wrapper for cudaDecon - GPU accelerated 3D deconvolution for microscopy
http://www.talleylambert.com/pycudadecon/
MIT License
59 stars 12 forks source link

Creating environment of pycudadecon #36

Closed nasful closed 2 years ago

nasful commented 2 years ago

Hi I have a GPU in my local machine which is working fine for deep learning in MATLAB. I want to use your pycudadecon library for GPU accelerated 3D microscopic image deconvolution. I tried to create pycudadecon environment in my local machine using following command line: conda install -c conda-forge pycudadecon

It shows several conflict percentages though it finishes the processing. It took around 2 hours to finish. I cannot then import decon from pycudadecon library. I think because of several conflicts.

Can you please suggest me what could be the probable problem that I can fix? It would really be a great assistance for me. I appreciate your cooperation in this regard. Thanks Md Nasful Huda Prince, PhD student, OSE, UNM

tlambert03 commented 2 years ago

can you try in a new environment and let me know?

conda create -n new_env -c conda-forge pycudadecon
nasful commented 2 years ago

Yes, it works. Thanks a lot. It created a new environment and I activated the environment. But problem persists. I cannot import decon from pycudadecon. I used following command: from pycudadecon import decon My spyder ide shows 'No module named pycudadecon' though I restarted the kernel. Can I expect another suggestion from you, what else can I do now? Your suggestion is really helpful for my work.

Thanks Md Nasful Huda Prince

tlambert03 commented 2 years ago

are you certain you're activating the correct environment? Can you test it outside of spyder? For example, after following the instructions above, if this command works (in the sense that no exceptions are raised)

conda activate new_env
python -c "import pycudadecon"

then the issue is not pycudadecon, but rather environment management in spyder (I don't use spyder so can't help you there)

nasful commented 2 years ago

Hi I tried the same thing in jupyter notebook using following command: !conda create -n new_env -c conda-forge pycudadecon --y After activating the environment in jupyter notebook I am receiving the same message i.e. 'No module named pycudadecon'. Do you have any suggestion at this point to fix this issue? Thanks Md Nasful Huda Prince

tlambert03 commented 2 years ago

Can you try this outside of a jupyter notebook or spyder? Keep things simple? Just use the command line?

tlambert03 commented 2 years ago

In the active environment, paste the output of conda list, and once you start a python interpreter, print the output of sys.path and make sure it shows the site-packages folder from the corresponding conda environment

nasful commented 2 years ago

Hi Professor, Thanks for your support. I finally become able to install pycudadecon. But it was not in the base environment or not even the newly created environment. I rather created another new environment to run my python enterpreter where I install the pycudadecon. Anyway, thanks a lot. Md Nasful Huda Prince

nasful commented 2 years ago

Hi, Sorry to disturb you again. I tried to use decon function for the sample images found from your repository. I used following simple command to do it:

import tifffile from pycudadecon import decon img=tifffile.imread('C:/1.Prince/9.Github/5.Python Decovolution/pycudadecon#gpu-requirements/test/test_data/im_raw.tif') psf=tifffile.imread('C:/1.Prince/9.Github/5.Python Decovolution/pycudadecon#gpu-requirements/test/test_data/psf.tif') result = decon(img, psf)

I tried it in my jupyter notebook and spider interpreter. But once I try to run the decon function the kernel for both the interpreter dies. Spyder shows following error message and then dies: D:/bld/cudadecon_1652910207314/work/src/RLgpuImpl.cu(76) : cudaSafeCall() Runtime API error 13: invalid device symbol.

Jupyter notebook shows following error message. The kernel appears to have died. It will restart automatically.

I don't know what is the probable error for this. Can you please suggest me so that I can fix this issue? My computer RAM is 128 GB. It has 2 CPUs. I am using NVIDIA Quadro M4000 GPU.

Thanks Md Nasful Huda Prince

tlambert03 commented 2 years ago

can you tell me what cudatoolkit you ended up with? (paste output of conda list)

Note that your GPU is a bit old, and is not supported for cudadecon on cuda >= 11.

If you find that you've got cudatoolkit 11, you could try specifically installing the older version:

conda install -c conda-forge cudadecon cudatoolkit=10.2
nasful commented 2 years ago

Hi I am using CUDA toolkit 11.2. Do you then want me to install CUDA toolkit 10.2? I am now using visual studio 2019 community version. Should I then install some older version of visual studio? My conda list is given below:

Name Version Build Channel

alabaster 0.7.12 pyhd3eb1b0_0
aom 3.3.0 h0e60522_1 conda-forge appdirs 1.4.4 pyhd3eb1b0_0
argon2-cffi 21.3.0 pyhd3eb1b0_0
argon2-cffi-bindings 21.2.0 py39h2bbff1b_0
arrow 1.2.2 pyhd3eb1b0_0
astroid 2.6.6 py39haa95532_0
asttokens 2.0.5 pyhd3eb1b0_0
atomicwrites 1.4.0 py_0
attrs 21.4.0 pyhd3eb1b0_0
autopep8 1.6.0 pyhd3eb1b0_0
babel 2.9.1 pyhd3eb1b0_0
backcall 0.2.0 pyhd3eb1b0_0
bcrypt 3.2.0 py39h196d8e1_0
beautifulsoup4 4.11.1 py39haa95532_0
binaryornot 0.4.4 pyhd3eb1b0_1
black 19.10b0 py_0
bleach 4.1.0 pyhd3eb1b0_0
blosc 1.21.1 h74325e0_3 conda-forge bm3d 3.0.9 pypi_0 pypi boost-cpp 1.74.0 h9f4b32c_8 conda-forge brotlipy 0.7.0 py39h2bbff1b_1003
bzip2 1.0.8 h8ffe710_4 conda-forge c-blosc2 2.1.1 hdf67494_2 conda-forge ca-certificates 2022.5.18.1 h5b45459_0 conda-forge cachey 0.2.1 pypi_0 pypi certifi 2022.5.18.1 py39hcbf5309_0 conda-forge cffi 1.15.0 py39h2bbff1b_1
cfitsio 4.1.0 h5a969a9_0 conda-forge chardet 4.0.0 py39haa95532_1003
charls 2.3.4 h39d44d4_0 conda-forge charset-normalizer 2.0.4 pyhd3eb1b0_0
click 8.0.4 py39haa95532_0
cloudpickle 2.0.0 pyhd3eb1b0_0
colorama 0.4.4 pyhd3eb1b0_0
cookiecutter 1.7.3 pyhd3eb1b0_0
cryptography 37.0.1 py39h21b164f_0
cudadecon 0.5.0 ha357265_1 conda-forge cudatoolkit 11.7.0 ha6f8bbd_10 conda-forge cycler 0.11.0 pypi_0 pypi dask 2022.5.0 pypi_0 pypi debugpy 1.5.1 py39hd77b12b_0
decorator 5.1.1 pyhd3eb1b0_0
defusedxml 0.7.1 pyhd3eb1b0_0
diff-match-patch 20200713 pyhd3eb1b0_0
docstring-parser 0.14.1 pypi_0 pypi docutils 0.17.1 py39haa95532_1
entrypoints 0.4 py39haa95532_0
executing 0.8.3 pyhd3eb1b0_0
fftw 3.3.10 nompi_h77347bd_102 conda-forge flake8 3.9.2 pyhd3eb1b0_0
fonttools 4.33.3 pypi_0 pypi freetype-py 2.3.0 pypi_0 pypi fsspec 2022.5.0 pypi_0 pypi giflib 5.2.1 h8d14728_2 conda-forge heapdict 1.0.1 pypi_0 pypi hsluv 5.0.2 pypi_0 pypi icu 58.2 ha925a31_3
idna 3.3 pyhd3eb1b0_0
image-quality 1.2.7 pypi_0 pypi imagecodecs 2022.2.22 py39hc1e9cd8_5 conda-forge imageio 2.19.2 pypi_0 pypi imagesize 1.3.0 pyhd3eb1b0_0
importlib-metadata 4.11.3 py39haa95532_0
importlib_metadata 4.11.3 hd3eb1b0_0
inflection 0.5.1 py39haa95532_0
intel-openmp 2022.1.0 h57928b3_3787 conda-forge intervaltree 3.1.0 pyhd3eb1b0_0
ipykernel 6.9.1 py39haa95532_0
ipython 8.3.0 py39haa95532_0
ipython_genutils 0.2.0 pyhd3eb1b0_1
isort 5.9.3 pyhd3eb1b0_0
jbig 2.1 h8d14728_2003 conda-forge jedi 0.18.1 py39haa95532_1
jinja2 3.0.3 pyhd3eb1b0_0
jinja2-time 0.2.0 pyhd3eb1b0_3
joblib 1.1.0 pypi_0 pypi jpeg 9e h2bbff1b_0
jsonschema 4.4.0 py39haa95532_0
jupyter_client 6.1.12 pyhd3eb1b0_0
jupyter_core 4.10.0 py39haa95532_0
jupyterlab_pygments 0.1.2 py_0
jxrlib 1.1 h8ffe710_2 conda-forge keyring 23.4.0 py39haa95532_0
kiwisolver 1.4.2 pypi_0 pypi krb5 1.19.3 h1176d77_0 conda-forge lazy-object-proxy 1.6.0 py39h2bbff1b_0
lcms2 2.12 h2a16943_0 conda-forge lerc 3.0 h0e60522_0 conda-forge libaec 1.0.6 h39d44d4_0 conda-forge libavif 0.10.1 h8ffe710_0 conda-forge libblas 3.9.0 14_win64_mkl conda-forge libbrotlicommon 1.0.9 h8ffe710_7 conda-forge libbrotlidec 1.0.9 h8ffe710_7 conda-forge libbrotlienc 1.0.9 h8ffe710_7 conda-forge libcblas 3.9.0 14_win64_mkl conda-forge libcurl 7.83.1 h789b8ee_0 conda-forge libdeflate 1.10 h8ffe710_0 conda-forge liblapack 3.9.0 14_win64_mkl conda-forge libpng 1.6.37 h2a8f88b_0
libspatialindex 1.9.3 h6c2663c_0
libssh2 1.10.0 h680486a_2 conda-forge libsvm 3.23.0.4 pypi_0 pypi libtiff 4.3.0 hc4061b1_3 conda-forge libwebp-base 1.2.2 h8ffe710_1 conda-forge libzlib 1.2.11 h8ffe710_1014 conda-forge libzopfli 1.0.3 h0e60522_0 conda-forge

Note: you may need to restart the kernel to use updated packages. locket 1.0.0 pypi_0 pypi lz4-c 1.9.3 h8ffe710_1 conda-forge magicgui 0.4.0 pypi_0 pypi markupsafe 2.0.1 py39h2bbff1b_0
matplotlib 3.5.2 pypi_0 pypi matplotlib-inline 0.1.2 pyhd3eb1b0_2
mccabe 0.6.1 py39haa95532_1
mistune 0.8.4 py39h2bbff1b_1000
mkl 2022.0.0 h0e2418a_796 conda-forge mypy_extensions 0.4.3 py39haa95532_1
napari 0.4.15 pypi_0 pypi napari-console 0.0.4 pypi_0 pypi napari-plugin-engine 0.2.0 pypi_0 pypi napari-svg 0.1.6 pypi_0 pypi nbclient 0.5.13 py39haa95532_0
nbconvert 6.4.4 py39haa95532_0
nbformat 5.3.0 py39haa95532_0
nest-asyncio 1.5.5 py39haa95532_0
networkx 2.8.2 pypi_0 pypi notebook 6.4.11 py39haa95532_0
npe2 0.3.0 pypi_0 pypi numpy 1.22.4 py39h0948cea_0 conda-forge numpydoc 1.2 pyhd3eb1b0_0
opencv-python 4.5.5.64 pypi_0 pypi opencv-rolling-ball 1.0.1 pypi_0 pypi openjpeg 2.4.0 hb211442_1 conda-forge openssl 1.1.1o h8ffe710_0 conda-forge packaging 21.3 pyhd3eb1b0_0
pandas 1.4.2 pypi_0 pypi pandocfilters 1.5.0 pyhd3eb1b0_0
paramiko 2.8.1 pyhd3eb1b0_0
parso 0.8.3 pyhd3eb1b0_0
partd 1.2.0 pypi_0 pypi pathspec 0.7.0 py_0
pexpect 4.8.0 pyhd3eb1b0_3
pickleshare 0.7.5 pyhd3eb1b0_1003
pillow 9.1.1 pypi_0 pypi pint 0.19.2 pypi_0 pypi pip 21.2.4 py39haa95532_0
platformdirs 2.5.2 pypi_0 pypi pluggy 1.0.0 py39haa95532_1
poyo 0.5.0 pyhd3eb1b0_0
prometheus_client 0.13.1 pyhd3eb1b0_0
prompt-toolkit 3.0.20 pyhd3eb1b0_0
psutil 5.8.0 py39h2bbff1b_1
psygnal 0.3.4 pypi_0 pypi ptyprocess 0.7.0 pyhd3eb1b0_2
pure_eval 0.2.2 pyhd3eb1b0_0
pyclesperanto-prototype 0.17.2 pypi_0 pypi pycodestyle 2.7.0 pyhd3eb1b0_0
pycparser 2.21 pyhd3eb1b0_0
pycudadecon 0.2.0 pyhd8ed1ab_0 conda-forge pydantic 1.9.1 pypi_0 pypi pydocstyle 6.1.1 pyhd3eb1b0_0
pydom 0.1 dev_0 pyflakes 2.3.1 pyhd3eb1b0_0
pygments 2.11.2 pyhd3eb1b0_0
pylint 2.9.6 py39haa95532_1
pyls-spyder 0.4.0 pyhd3eb1b0_0
pynacl 1.4.0 py39hbd8134f_1
pyopencl 2022.1.5 pypi_0 pypi pyopengl 3.1.6 pypi_0 pypi pyopenssl 22.0.0 pyhd3eb1b0_0
pyparsing 3.0.4 pyhd3eb1b0_0
pyqt 5.9.2 py39hd77b12b_6
pyrsistent 0.18.0 py39h196d8e1_0
pysocks 1.7.1 py39haa95532_0
pystackreg 0.2.5 pypi_0 pypi python 3.9.12 h6244533_0
python-dateutil 2.8.2 pyhd3eb1b0_0
python-fastjsonschema 2.15.1 pyhd3eb1b0_0
python-lsp-black 1.0.0 pyhd3eb1b0_0
python-lsp-jsonrpc 1.0.0 pyhd3eb1b0_0
python-lsp-server 1.2.4 pyhd3eb1b0_0
python-slugify 5.0.2 pyhd3eb1b0_0
python_abi 3.9 2_cp39 conda-forge pytomlpp 1.0.11 pypi_0 pypi pytools 2022.1.9 pypi_0 pypi pytz 2021.3 pyhd3eb1b0_0
pywavelets 1.3.0 pypi_0 pypi pywin32 302 py39h2bbff1b_2
pywin32-ctypes 0.2.0 py39haa95532_1000
pywinpty 2.0.2 py39h5da7b33_0
pyyaml 6.0 py39h2bbff1b_1
pyzmq 22.3.0 py39hd77b12b_2
qdarkstyle 3.0.2 pyhd3eb1b0_0
qstylizer 0.1.10 pyhd3eb1b0_0
qt 5.9.7 vc14h73c81de_0
qtawesome 1.0.3 pyhd3eb1b0_0
qtconsole 5.3.0 pyhd3eb1b0_0
qtpy 2.0.1 pyhd3eb1b0_0
regex 2022.3.15 py39h2bbff1b_0
requests 2.27.1 pyhd3eb1b0_0
rope 0.22.0 pyhd3eb1b0_0
rtree 0.9.7 py39h2eaa2aa_1
scikit-image 0.19.2 pypi_0 pypi scikit-learn 1.1.1 pypi_0 pypi scipy 1.8.1 pypi_0 pypi seaborn 0.11.2 pypi_0 pypi send2trash 1.8.0 pyhd3eb1b0_1
setuptools 61.2.0 py39haa95532_0
sip 4.19.13 py39hd77b12b_0
six 1.16.0 pyhd3eb1b0_1
snappy 1.1.9 h82413e6_1 conda-forge snowballstemmer 2.2.0 pyhd3eb1b0_0
sortedcontainers 2.4.0 pyhd3eb1b0_0
soupsieve 2.3.1 pyhd3eb1b0_0
sphinx 4.4.0 pyhd3eb1b0_0
sphinxcontrib-applehelp 1.0.2 pyhd3eb1b0_0
sphinxcontrib-devhelp 1.0.2 pyhd3eb1b0_0
sphinxcontrib-htmlhelp 2.0.0 pyhd3eb1b0_0
sphinxcontrib-jsmath 1.0.1 pyhd3eb1b0_0
sphinxcontrib-qthelp 1.0.3 pyhd3eb1b0_0
sphinxcontrib-serializinghtml 1.1.5 pyhd3eb1b0_0
spyder 5.1.5 py39haa95532_1
spyder-kernels 2.1.3 py39haa95532_0
sqlite 3.38.3 h2bbff1b_0
stack_data 0.2.0 pyhd3eb1b0_0
superqt 0.3.2 pypi_0 pypi tbb 2021.5.0 h2d74725_1 conda-forge terminado 0.13.1 py39haa95532_0
testpath 0.5.0 pyhd3eb1b0_0
text-unidecode 1.3 pyhd3eb1b0_0
textdistance 4.2.1 pyhd3eb1b0_0
threadpoolctl 3.1.0 pypi_0 pypi three-merge 0.1.1 pyhd3eb1b0_0
tifffile 2022.5.4 pyhd8ed1ab_0 conda-forge tinycss 0.4 pyhd3eb1b0_1002
toml 0.10.2 pyhd3eb1b0_0
toolz 0.11.2 pypi_0 pypi tornado 6.1 py39h2bbff1b_0
tqdm 4.64.0 pypi_0 pypi traitlets 5.1.1 pyhd3eb1b0_0
transforms3d 0.3.1 pypi_0 pypi typed-ast 1.4.3 py39h2bbff1b_1
typer 0.4.1 pypi_0 pypi typing-extensions 4.1.1 hd3eb1b0_0
typing_extensions 4.1.1 pyh06a4308_0
tzdata 2022a hda174b7_0
ujson 5.1.0 py39hd77b12b_0
unidecode 1.2.0 pyhd3eb1b0_0
urllib3 1.26.9 py39haa95532_0
vc 14.2 h21ff451_1
vispy 0.10.0 pypi_0 pypi vs2015_runtime 14.27.29016 h5e58377_2
watchdog 2.1.6 py39haa95532_0
wcwidth 0.2.5 pyhd3eb1b0_0
webencodings 0.5.1 py39haa95532_1
wheel 0.37.1 pyhd3eb1b0_0
win_inet_pton 1.1.0 py39haa95532_0
wincertstore 0.2 py39haa95532_2
winpty 0.4.3 4
wrapt 1.12.1 py39h196d8e1_1
xz 5.2.5 h62dcd97_1 conda-forge yaml 0.2.5 he774522_0
yapf 0.31.0 pyhd3eb1b0_0
zfp 0.5.5 h0e60522_8 conda-forge zipp 3.8.0 py39haa95532_0
zlib 1.2.11 h8ffe710_1014 conda-forge zlib-ng 2.0.6 h8ffe710_0 conda-forge zstd 1.5.2 h6255e5f_1 conda-forge

Your support is highly appreciated.

Thanking you Md Nasful Huda Prince

tlambert03 commented 2 years ago

I am using CUDA toolkit 11.2. Do you then want me to install CUDA toolkit 10.2?

from your output, looks like you're on 11.7 (cudatoolkit 11.7.0 ha6f8bbd_10 conda-forge) the M4000 has a cuda compute number of 5.2, it might work on cuda 11.0, probably on 10.2, but won't work on 11.1 or greater.

I am now using visual studio 2019 community version. Should I then install some older version of visual studio?

the version of visual studio is irrelevant here. All of the dependencies will come in the conda environment (so stuff you have installed more globally on the computer shouldn't matter). Try, again with a fresh environment:

conda create -n new_env -c conda-forge pycudadecon cudatoolkit=10.2
conda activate new_env
nasful commented 2 years ago

Yes, it is working now. Thank you so much. Md Nasful Huda Prince