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

sp.linop.ConvolveData fails on GPU, works with numpy on CPU #119

Open
ecat opened this issue Feb 7, 2023 · 0 comments
Open

sp.linop.ConvolveData fails on GPU, works with numpy on CPU #119

ecat opened this issue Feb 7, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@ecat
Copy link

ecat commented Feb 7, 2023

Describe the bug
Trying to implement a dirty 1D wavelet using the convolve data linop, crashes on GPU. I suppose arraytoblock could be used instead

To Reproduce

xp = np
a = xp.zeros((1, 32), dtype=np.float32)
a[:, 15:24] = 1.0
haar_filter = xp.array([[1.0, 1.0], [1.0, -1.0]], dtype=np.float32)
haar_filter = xp.reshape(haar_filter, (2, 1, 2))
W_haar = sp.linop.ConvolveData(a.shape, haar_filter, strides=(2,), multi_channel=True, mode='valid')
b = W_haar * a

plt.figure()
plt.plot(cp.asnumpy(a.T), label='original signal')
plt.plot(cp.asnumpy(b.T), label='filtered signal')
plt.legend()
plt.show()

image

Expected behavior
Works fine when xp is numpy, but when using cupy it throws a generic error from cudnn libraries.

image

CUDA version 11.6

Screenshots

@ecat ecat added the bug Something isn't working label Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant