WeisongZhao / sparse-deconv-py

Official Python implementation of the 'Sparse deconvolution'-v0.3.0
Open Data Commons Open Database License v1.0
46 stars 17 forks source link

CUFFT ERROR #6

Open chengarthur opened 3 months ago

chengarthur commented 3 months ago

Hi Dr.Zhao, I met some problem when I try to apply sparse-deconv on my image: my image is 3072307230(XYZ) and 2048204859,(XYZ) dtype int8 tif,When I used sci-image's io to import tif, the shape is (30, 3072, 3072), and (59,2048,2048)and when I used the decon function ,there was error in FFT function like this:

~/anaconda3/envs/sparse/lib/python3.7/site-packages/cupy/fft/_fft.py in _get_cufft_plan_nd(shape, fft_type, axes, order, out_size, to_cache) 457 plan = cached_plan 458 elif mgr is None: --> 459 plan = cufft.PlanNd(*keys) 460 if to_cache: 461 cache[keys] = plan

~/anaconda3/envs/sparse/lib/python3.7/site-packages/cupy/cuda/cufft.pyx in cupy.cuda.cufft.PlanNd.init()

~/anaconda3/envs/sparse/lib/python3.7/site-packages/cupy/cuda/cufft.pyx in cupy.cuda.cufft.check_result()

CuFFTError: CUFFT_INTERNAL_ERROR

I tried to transpose the shape, modify sigma to 2or 3 elements list however the error still happen , and my cupy is 9.6.0 and cuda toolkit is 11.5.0 ,my OS is Ubtuntu22.04 LTS and GPU is RTX 4090, in nvida-smi the data was loaded into gpu and cupy.cuda.is_available() is true, could you help with this issue ?

yuanyuanhuang0118 commented 3 months ago

Hi Dr.Zhao, I met some problem when I try to apply sparse-deconv on my image: my image is 3072_3072_30(XYZ) and 2048_2048_59,(XYZ) dtype int8 tif,When I used sci-image's io to import tif, the shape is (30, 3072, 3072), and (59,2048,2048)and when I used the decon function ,there was error in FFT function like this:

~/anaconda3/envs/sparse/lib/python3.7/site-packages/cupy/fft/_fft.py in _get_cufft_plan_nd(shape, fft_type, axes, order, out_size, to_cache) 457 plan = cached_plan 458 elif mgr is None: --> 459 plan = cufft.PlanNd(*keys) 460 if to_cache: 461 cache[keys] = plan

~/anaconda3/envs/sparse/lib/python3.7/site-packages/cupy/cuda/cufft.pyx in cupy.cuda.cufft.PlanNd.init()

~/anaconda3/envs/sparse/lib/python3.7/site-packages/cupy/cuda/cufft.pyx in cupy.cuda.cufft.check_result()

CuFFTError: CUFFT_INTERNAL_ERROR

I tried to transpose the shape, modify sigma to 2or 3 elements list however the error still happen , and my cupy is 9.6.0 and cuda toolkit is 11.5.0 ,my OS is Ubtuntu22.04 LTS and GPU is RTX 4090, in nvida-smi the data was loaded into gpu and cupy.cuda.is_available() is true, could you help with this issue ?

This error seems to be related to your environment. You can check if there is a conflict with the CuPy version. Also, I've seen a similar issue before where changing the CUDA version to 11.8 resolved the problem. You could try that as well.

chengarthur commented 3 months ago

Hi Dr.Zhao, I met some problem when I try to apply sparse-deconv on my image: my image is 3072_3072_30(XYZ) and 2048_2048_59,(XYZ) dtype int8 tif,When I used sci-image's io to import tif, the shape is (30, 3072, 3072), and (59,2048,2048)and when I used the decon function ,there was error in FFT function like this: ~/anaconda3/envs/sparse/lib/python3.7/site-packages/cupy/fft/_fft.py in _get_cufft_plan_nd(shape, fft_type, axes, order, out_size, to_cache) 457 plan = cached_plan 458 elif mgr is None: --> 459 plan = cufft.PlanNd(*keys) 460 if to_cache: 461 cache[keys] = plan ~/anaconda3/envs/sparse/lib/python3.7/site-packages/cupy/cuda/cufft.pyx in cupy.cuda.cufft.PlanNd.init() ~/anaconda3/envs/sparse/lib/python3.7/site-packages/cupy/cuda/cufft.pyx in cupy.cuda.cufft.check_result() CuFFTError: CUFFT_INTERNAL_ERROR I tried to transpose the shape, modify sigma to 2or 3 elements list however the error still happen , and my cupy is 9.6.0 and cuda toolkit is 11.5.0 ,my OS is Ubtuntu22.04 LTS and GPU is RTX 4090, in nvida-smi the data was loaded into gpu and cupy.cuda.is_available() is true, could you help with this issue ?

This error seems to be related to your environment. You can check if there is a conflict with the CuPy version. Also, I've seen a similar issue before where changing the CUDA version to 11.8 resolved the problem. You could try that as well.

thanks I used conda to manage my enviroment and thanks for your advice there is no more FFT issure in cuda11.8, however I met Vram issue when the data loaded into My GPU: cupy/cuda/memory.pyx in cupy.cuda.memory.SingleDeviceMemoryPool.malloc()

cupy/cuda/memory.pyx in cupy.cuda.memory.SingleDeviceMemoryPool._malloc()

cupy/cuda/memory.pyx in cupy.cuda.memory.SingleDeviceMemoryPool._try_malloc()

OutOfMemoryError: Out of memory allocating 4,529,848,320 bytes (allocated so far: 23,783,918,080 bytes).:

should I subtile the figure or there is some paramter for me to reduce Vram usage?