cupy / cupy

NumPy & SciPy for GPU

Home Page:https://cupy.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error applying lfilter

Geodude-93 opened this issue · comments

Description

Hi,
I get an error when I try to apply a bandpass filter using cupyx.scipy.signal.lfilter.
Other functions like resample_poly work well.
I have attached a code examples. See the error below.


File ~/.conda/envs/cupy/lib/python3.12/site-packages/cupy/cuda/compiler.py:677 in compile

nvrtc.compileProgram(self.ptr, options)

File cupy_backends/cuda/libs/nvrtc.pyx:125 in cupy_backends.cuda.libs.nvrtc.compileProgram

File cupy_backends/cuda/libs/nvrtc.pyx:138 in cupy_backends.cuda.libs.nvrtc.compileProgram

File cupy_backends/cuda/libs/nvrtc.pyx:53 in cupy_backends.cuda.libs.nvrtc.check_status

NVRTCError: NVRTC_ERROR_COMPILATION (6)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File ~/.conda/envs/cupy/lib/python3.12/site-packages/spyder_kernels/py3compat.py:356 in compat_exec
exec(code, globals, locals)

File /mnt/Datastore/usr/keving/Scripts/Test/cupy_lfilt_min_example.py:32
data_cp_filt = cpsignal.lfilter(b_bp, a_bp, data_cp, axis=0, zi=None)

File ~/.conda/envs/cupy/lib/python3.12/site-packages/cupyx/scipy/signal/_signaltools.py:797 in lfilter
out = apply_iir(out, a_r, axis=axis, zi=prev_out, dtype=iir_dtype)

File ~/.conda/envs/cupy/lib/python3.12/site-packages/cupyx/scipy/signal/_iir_utils.py:577 in apply_iir
corr_kernel = _get_module_func(

File ~/.conda/envs/cupy/lib/python3.12/site-packages/cupyx/scipy/signal/_iir_utils.py:509 in _get_module_func
kernel = module.get_function(kernel_name)

File cupy/_core/raw.pyx:472 in cupy._core.raw.RawModule.get_function

File cupy/_core/raw.pyx:396 in cupy._core.raw.RawModule.module.get

File cupy/_core/raw.pyx:404 in cupy._core.raw.RawModule._module

File cupy/_util.pyx:64 in cupy._util.memoize.decorator.ret

File cupy/_core/raw.pyx:538 in cupy._core.raw._get_raw_module

File cupy/_core/core.pyx:2236 in cupy._core.core.compile_with_cache

File cupy/_core/core.pyx:2254 in cupy._core.core.compile_with_cache

File ~/.conda/envs/cupy/lib/python3.12/site-packages/cupy/cuda/compiler.py:484 in _compile_module_with_cache
return _compile_with_cache_cuda(

File ~/.conda/envs/cupy/lib/python3.12/site-packages/cupy/cuda/compiler.py:562 in _compile_with_cache_cuda
ptx, mapping = compile_using_nvrtc(

File ~/.conda/envs/cupy/lib/python3.12/site-packages/cupy/cuda/compiler.py:319 in compile_using_nvrtc
return _compile(source, options, cu_path,

File ~/.conda/envs/cupy/lib/python3.12/site-packages/cupy/cuda/compiler.py:303 in _compile
compiled_obj, mapping = prog.compile(options, log_stream)

File ~/.conda/envs/cupy/lib/python3.12/site-packages/cupy/cuda/compiler.py:696 in compile
raise CompileException(log, self.src, self.name, options,

CompileException: /tmp/tmpicj34uwe/b42b75ac773372a878930370cfd2b11e5a15836b.cubin.cu(2): catastrophic error: cannot open source file "cuda_runtime.h"

1 catastrophic error detected in the compilation of "/tmp/tmpicj34uwe/b42b75ac773372a878930370cfd2b11e5a15836b.cubin.cu".
Compilation terminated.

To Reproduce

import numpy as np
import cupy as cp 
import cupyx.scipy.signal as cpsignal


# settings data
start=0
winlen = 10_000 # in secs
num_samps=int(1e07)
freq1, freq2 = 50, 220 # in Hz

# bandpass
cutoff_freqs=(10,100) # in Hz
order_bp=4

t = np.linspace(0, winlen, num_samps)
dt = np.round( t[1]-t[0], 6 ) 

# create data
noise = np.random.rand(num_samps)
data = 1 *np.sin((2*np.pi)*t*freq1) +  0.5 *np.sin((2*np.pi)*t*freq2) + 2.5*noise

data_cp = cp.asarray(data)
b_bp, a_bp = cpsignal.butter(order_bp, cutoff_freqs, btype="bandpass", fs=1/dt)
data_cp_filt = cpsignal.lfilter(b_bp, a_bp, data_cp, axis=0, zi=None)
data_filt = cp.asnumpy(data_cp_filt)

print("done")

Installation

Conda-Forge (conda install ...)

Environment

OS                           : Linux-5.11.0-36-generic-x86_64-with-glibc2.31
Python Version               : 3.12.1
CuPy Version                 : 13.0.0
CuPy Platform                : NVIDIA CUDA
NumPy Version                : 1.26.3
SciPy Version                : 1.11.4
Cython Build Version         : 0.29.37
Cython Runtime Version       : None
CUDA Root                    : /home/keving/.conda/envs/cupy
nvcc PATH                    : None
CUDA Build Version           : 11080
CUDA Driver Version          : 11020
CUDA Runtime Version         : 11080 (linked to CuPy) / 11020 (locally installed)
cuBLAS Version               : (available)
cuFFT Version                : 10401
cuRAND Version               : 10203
cuSOLVER Version             : (11, 1, 0)
cuSPARSE Version             : (available)
NVRTC Version                : (11, 2)
Thrust Version               : 200200
CUB Build Version            : 200200
Jitify Build Version         : 95b2a2d
cuDNN Build Version          : 8800
cuDNN Version                : 8907
NCCL Build Version           : None
NCCL Runtime Version         : None
cuTENSOR Version             : None
cuSPARSELt Build Version     : None
Device 0 Name                : GeForce RTX 2080 Ti
Device 0 Compute Capability  : 75
Device 0 PCI Bus ID          : 0000:65:00.0

Additional Information

No response

What's the output of conda list?

here is the output of conda list:

Name Version Build Channel

_libgcc_mutex 0.1 conda_forge conda-forge
_openmp_mutex 4.5 2_gnu conda-forge
alabaster 0.7.16 pyhd8ed1ab_0 conda-forge
alsa-lib 1.2.10 hd590300_0 conda-forge
arrow 1.3.0 pyhd8ed1ab_0 conda-forge
astroid 3.0.3 py312h7900ff3_0 conda-forge
asttokens 2.4.1 pyhd8ed1ab_0 conda-forge
atomicwrites 1.4.1 pyhd8ed1ab_0 conda-forge
attr 2.5.1 h166bdaf_1 conda-forge
attrs 23.2.0 pyh71513ae_0 conda-forge
autopep8 2.0.4 pyhd8ed1ab_0 conda-forge
babel 2.14.0 pyhd8ed1ab_0 conda-forge
beautifulsoup4 4.12.3 pyha770c72_0 conda-forge
binaryornot 0.4.4 py_1 conda-forge
black 24.1.1 py312h7900ff3_0 conda-forge
bleach 6.1.0 pyhd8ed1ab_0 conda-forge
brotli 1.1.0 hd590300_1 conda-forge
brotli-bin 1.1.0 hd590300_1 conda-forge
brotli-python 1.1.0 py312h30efb56_1 conda-forge
bzip2 1.0.8 hd590300_5 conda-forge
c-ares 1.26.0 hd590300_0 conda-forge
ca-certificates 2024.2.2 hbcca054_0 conda-forge
cached-property 1.5.2 hd8ed1ab_1 conda-forge
cached_property 1.5.2 pyha770c72_1 conda-forge
cairo 1.18.0 h3faef2a_0 conda-forge
certifi 2024.2.2 pyhd8ed1ab_0 conda-forge
cffi 1.16.0 py312hf06ca03_0 conda-forge
chardet 5.2.0 py312h7900ff3_1 conda-forge
charset-normalizer 3.3.2 pyhd8ed1ab_0 conda-forge
click 8.1.7 unix_pyh707e725_0 conda-forge
cloudpickle 3.0.0 pyhd8ed1ab_0 conda-forge
colorama 0.4.6 pyhd8ed1ab_0 conda-forge
comm 0.2.1 pyhd8ed1ab_0 conda-forge
contourpy 1.2.0 py312h8572e83_0 conda-forge
cookiecutter 2.5.0 pyhca7485f_0 conda-forge
cryptography 42.0.2 py312h4742d6a_0 conda-forge
cuda-version 11.2 hb11dac2_2 conda-forge
cudatoolkit 11.2.2 hc23eb0c_13 conda-forge
cupy 13.0.0 py312h8e83189_2 conda-forge
cupy-core 13.0.0 py312hd7a312d_2 conda-forge
cycler 0.12.1 pyhd8ed1ab_0 conda-forge
dbus 1.13.6 h5008d03_3 conda-forge
debugpy 1.8.0 py312h30efb56_1 conda-forge
decorator 5.1.1 pyhd8ed1ab_0 conda-forge
defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge
diff-match-patch 20230430 pyhd8ed1ab_0 conda-forge
dill 0.3.8 pyhd8ed1ab_0 conda-forge
docstring-to-markdown 0.13 pyhd8ed1ab_0 conda-forge
docutils 0.20.1 py312h7900ff3_3 conda-forge
entrypoints 0.4 pyhd8ed1ab_0 conda-forge
exceptiongroup 1.2.0 pyhd8ed1ab_2 conda-forge
executing 2.0.1 pyhd8ed1ab_0 conda-forge
expat 2.5.0 hcb278e6_1 conda-forge
fastrlock 0.8.2 py312h30efb56_2 conda-forge
flake8 6.1.0 pyhd8ed1ab_0 conda-forge
font-ttf-dejavu-sans-mono 2.37 hab24e00_0 conda-forge
font-ttf-inconsolata 3.000 h77eed37_0 conda-forge
font-ttf-source-code-pro 2.038 h77eed37_0 conda-forge
font-ttf-ubuntu 0.83 h77eed37_1 conda-forge
fontconfig 2.14.2 h14ed4e7_0 conda-forge
fonts-conda-ecosystem 1 0 conda-forge
fonts-conda-forge 1 0 conda-forge
fonttools 4.47.2 py312h98912ed_0 conda-forge
freetype 2.12.1 h267a509_2 conda-forge
gettext 0.21.1 h27087fc_0 conda-forge
giflib 5.2.1 h0b41bf4_3 conda-forge
glib 2.78.3 hfc55251_0 conda-forge
glib-tools 2.78.3 hfc55251_0 conda-forge
gmp 6.3.0 h59595ed_0 conda-forge
graphite2 1.3.13 h58526e2_1001 conda-forge
gst-plugins-base 1.22.9 h8e1006c_0 conda-forge
gstreamer 1.22.9 h98fc4e7_0 conda-forge
h5py 3.10.0 nompi_py312h1b477d7_101 conda-forge
harfbuzz 8.3.0 h3d44ed6_0 conda-forge
hdf5 1.14.3 nompi_h4f84152_100 conda-forge
icu 73.2 h59595ed_0 conda-forge
idna 3.6 pyhd8ed1ab_0 conda-forge
imagesize 1.4.1 pyhd8ed1ab_0 conda-forge
importlib-metadata 7.0.1 pyha770c72_0 conda-forge
importlib_metadata 7.0.1 hd8ed1ab_0 conda-forge
importlib_resources 6.1.1 pyhd8ed1ab_0 conda-forge
inflection 0.5.1 pyh9f0ad1d_0 conda-forge
intervaltree 3.1.0 pyhd8ed1ab_1 conda-forge
ipykernel 6.29.0 pyhd33586a_0 conda-forge
ipython 8.21.0 pyh707e725_0 conda-forge
isort 5.13.2 pyhd8ed1ab_0 conda-forge
jaraco.classes 3.3.0 pyhd8ed1ab_0 conda-forge
jedi 0.19.1 pyhd8ed1ab_0 conda-forge
jeepney 0.8.0 pyhd8ed1ab_0 conda-forge
jellyfish 1.0.3 py312h4b3b743_0 conda-forge
jinja2 3.1.3 pyhd8ed1ab_0 conda-forge
jsonschema 4.21.1 pyhd8ed1ab_0 conda-forge
jsonschema-specifications 2023.12.1 pyhd8ed1ab_0 conda-forge
jupyter_client 8.6.0 pyhd8ed1ab_0 conda-forge
jupyter_core 5.7.1 py312h7900ff3_0 conda-forge
jupyterlab_pygments 0.3.0 pyhd8ed1ab_0 conda-forge
keyring 24.3.0 py312h7900ff3_0 conda-forge
keyutils 1.6.1 h166bdaf_0 conda-forge
kiwisolver 1.4.5 py312h8572e83_1 conda-forge
krb5 1.21.2 h659d440_0 conda-forge
lame 3.100 h166bdaf_1003 conda-forge
lcms2 2.16 hb7c19ff_0 conda-forge
ld_impl_linux-64 2.40 h41732ed_0 conda-forge
lerc 4.0.0 h27087fc_0 conda-forge
libaec 1.1.2 h59595ed_1 conda-forge
libblas 3.9.0 20_linux64_openblas conda-forge
libbrotlicommon 1.1.0 hd590300_1 conda-forge
libbrotlidec 1.1.0 hd590300_1 conda-forge
libbrotlienc 1.1.0 hd590300_1 conda-forge
libcap 2.69 h0f662aa_0 conda-forge
libcblas 3.9.0 20_linux64_openblas conda-forge
libclang 15.0.7 default_hb11cfb5_4 conda-forge
libclang13 15.0.7 default_ha2b6cf4_4 conda-forge
libcups 2.3.3 h4637d8d_4 conda-forge
libcurl 8.5.0 hca28451_0 conda-forge
libdeflate 1.19 hd590300_0 conda-forge
libedit 3.1.20191231 he28a2e2_2 conda-forge
libev 4.33 hd590300_2 conda-forge
libevent 2.1.12 hf998b51_1 conda-forge
libexpat 2.5.0 hcb278e6_1 conda-forge
libffi 3.4.2 h7f98852_5 conda-forge
libflac 1.4.3 h59595ed_0 conda-forge
libgcc-ng 13.2.0 h807b86a_5 conda-forge
libgcrypt 1.10.3 hd590300_0 conda-forge
libgfortran-ng 13.2.0 h69a702a_5 conda-forge
libgfortran5 13.2.0 ha4646dd_5 conda-forge
libglib 2.78.3 h783c2da_0 conda-forge
libgomp 13.2.0 h807b86a_5 conda-forge
libgpg-error 1.47 h71f35ed_0 conda-forge
libiconv 1.17 hd590300_2 conda-forge
libjpeg-turbo 3.0.0 hd590300_1 conda-forge
liblapack 3.9.0 20_linux64_openblas conda-forge
libllvm14 14.0.6 hcd5def8_4 conda-forge
libllvm15 15.0.7 hb3ce162_4 conda-forge
libnghttp2 1.58.0 h47da74e_1 conda-forge
libnsl 2.0.1 hd590300_0 conda-forge
libogg 1.3.4 h7f98852_1 conda-forge
libopenblas 0.3.25 pthreads_h413a1c8_0 conda-forge
libopus 1.3.1 h7f98852_1 conda-forge
libpng 1.6.42 h2797004_0 conda-forge
libpq 16.1 h33b98f1_7 conda-forge
libsndfile 1.2.2 hc60ed4a_1 conda-forge
libsodium 1.0.18 h36c2ea0_1 conda-forge
libspatialindex 1.9.3 h9c3ff4c_4 conda-forge
libsqlite 3.44.2 h2797004_0 conda-forge
libssh2 1.11.0 h0841786_0 conda-forge
libstdcxx-ng 13.2.0 h7e041cc_5 conda-forge
libsystemd0 255 h3516f8a_0 conda-forge
libtiff 4.6.0 ha9c0a0a_2 conda-forge
libuuid 2.38.1 h0b41bf4_0 conda-forge
libvorbis 1.3.7 h9c3ff4c_0 conda-forge
libwebp 1.3.2 h658648e_1 conda-forge
libwebp-base 1.3.2 hd590300_0 conda-forge
libxcb 1.15 h0b41bf4_0 conda-forge
libxcrypt 4.4.36 hd590300_1 conda-forge
libxkbcommon 1.6.0 hd429924_1 conda-forge
libxml2 2.12.5 h232c23b_0 conda-forge
libzlib 1.2.13 hd590300_5 conda-forge
llvmlite 0.42.0 py312hb06c811_1 conda-forge
lz4-c 1.9.4 hcb278e6_0 conda-forge
markdown-it-py 3.0.0 pyhd8ed1ab_0 conda-forge
markupsafe 2.1.5 py312h98912ed_0 conda-forge
matplotlib 3.8.2 py312h7900ff3_0 conda-forge
matplotlib-base 3.8.2 py312he5832f3_0 conda-forge
matplotlib-inline 0.1.6 pyhd8ed1ab_0 conda-forge
mccabe 0.7.0 pyhd8ed1ab_0 conda-forge
mdurl 0.1.2 pyhd8ed1ab_0 conda-forge
mistune 3.0.2 pyhd8ed1ab_0 conda-forge
more-itertools 10.2.0 pyhd8ed1ab_0 conda-forge
mpg123 1.32.4 h59595ed_0 conda-forge
mpmath 1.3.0 pyhd8ed1ab_0 conda-forge
munkres 1.1.4 pyh9f0ad1d_0 conda-forge
mypy_extensions 1.0.0 pyha770c72_0 conda-forge
mysql-common 8.0.33 hf1915f5_6 conda-forge
mysql-libs 8.0.33 hca2cd23_6 conda-forge
nbclient 0.8.0 pyhd8ed1ab_0 conda-forge
nbconvert 7.14.2 pyhd8ed1ab_0 conda-forge
nbconvert-core 7.14.2 pyhd8ed1ab_0 conda-forge
nbconvert-pandoc 7.14.2 pyhd8ed1ab_0 conda-forge
nbformat 5.9.2 pyhd8ed1ab_0 conda-forge
ncurses 6.4 h59595ed_2 conda-forge
nest-asyncio 1.6.0 pyhd8ed1ab_0 conda-forge
nspr 4.35 h27087fc_0 conda-forge
nss 3.97 h1d7d5a4_0 conda-forge
numba 0.59.0 py312hacefee8_1 conda-forge
numpy 1.26.3 py312heda63a1_0 conda-forge
numpydoc 1.6.0 pyhd8ed1ab_0 conda-forge
openjpeg 2.5.0 h488ebb8_3 conda-forge
openssl 3.2.1 hd590300_0 conda-forge
packaging 23.2 pyhd8ed1ab_0 conda-forge
pandas 2.2.0 py312hfb8ada1_0 conda-forge
pandoc 3.1.3 h32600fe_0 conda-forge
pandocfilters 1.5.0 pyhd8ed1ab_0 conda-forge
parso 0.8.3 pyhd8ed1ab_0 conda-forge
pathspec 0.12.1 pyhd8ed1ab_0 conda-forge
pcre2 10.42 hcad00b1_0 conda-forge
pexpect 4.9.0 pyhd8ed1ab_0 conda-forge
pickleshare 0.7.5 py_1003 conda-forge
pillow 10.2.0 py312hf3581a9_0 conda-forge
pip 24.0 pyhd8ed1ab_0 conda-forge
pixman 0.43.2 h59595ed_0 conda-forge
pkgutil-resolve-name 1.3.10 pyhd8ed1ab_1 conda-forge
platformdirs 4.2.0 pyhd8ed1ab_0 conda-forge
pluggy 1.4.0 pyhd8ed1ab_0 conda-forge
ply 3.11 py_1 conda-forge
prompt-toolkit 3.0.42 pyha770c72_0 conda-forge
psutil 5.9.8 py312h98912ed_0 conda-forge
pthread-stubs 0.4 h36c2ea0_1001 conda-forge
ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge
pulseaudio-client 16.1 hb77b528_5 conda-forge
pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge
pycodestyle 2.11.1 pyhd8ed1ab_0 conda-forge
pycparser 2.21 pyhd8ed1ab_0 conda-forge
pydocstyle 6.3.0 pyhd8ed1ab_0 conda-forge
pyflakes 3.1.0 pyhd8ed1ab_0 conda-forge
pygments 2.17.2 pyhd8ed1ab_0 conda-forge
pylint 3.0.3 pyhd8ed1ab_0 conda-forge
pylint-venv 3.0.3 pyhd8ed1ab_0 conda-forge
pyls-spyder 0.4.0 pyhd8ed1ab_0 conda-forge
pyparsing 3.1.1 pyhd8ed1ab_0 conda-forge
pyqt 5.15.9 py312h949fe66_5 conda-forge
pyqt5-sip 12.12.2 py312h30efb56_5 conda-forge
pyqtwebengine 5.15.9 py312hbd9a932_5 conda-forge
pysocks 1.7.1 pyha2e5f31_6 conda-forge
python 3.12.1 hab00c5b_1_cpython conda-forge
python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge
python-fastjsonschema 2.19.1 pyhd8ed1ab_0 conda-forge
python-lsp-black 2.0.0 pyhd8ed1ab_0 conda-forge
python-lsp-jsonrpc 1.1.2 pyhd8ed1ab_0 conda-forge
python-lsp-server 1.9.0 pyhd8ed1ab_0 conda-forge
python-lsp-server-base 1.9.0 pyhd8ed1ab_0 conda-forge
python-slugify 8.0.3 pyhd8ed1ab_0 conda-forge
python-tzdata 2023.4 pyhd8ed1ab_0 conda-forge
python_abi 3.12 4_cp312 conda-forge
pytoolconfig 1.2.5 pyhd8ed1ab_0 conda-forge
pytz 2024.1 pyhd8ed1ab_0 conda-forge
pyxdg 0.28 pyhd8ed1ab_0 conda-forge
pyyaml 6.0.1 py312h98912ed_1 conda-forge
pyzmq 25.1.2 py312h886d080_0 conda-forge
qdarkstyle 3.2.3 pyhd8ed1ab_0 conda-forge
qstylizer 0.2.2 pyhd8ed1ab_0 conda-forge
qt-main 5.15.8 h450f30e_18 conda-forge
qt-webengine 5.15.8 h7517aa4_5 conda-forge
qtawesome 1.3.0 pyh9208f05_0 conda-forge
qtconsole 5.5.1 pyhd8ed1ab_0 conda-forge
qtconsole-base 5.5.1 pyha770c72_0 conda-forge
qtpy 2.4.1 pyhd8ed1ab_0 conda-forge
readline 8.2 h8228510_1 conda-forge
referencing 0.33.0 pyhd8ed1ab_0 conda-forge
requests 2.31.0 pyhd8ed1ab_0 conda-forge
rich 13.7.0 pyhd8ed1ab_0 conda-forge
rope 1.12.0 pyhd8ed1ab_0 conda-forge
rpds-py 0.17.1 py312h4b3b743_0 conda-forge
rtree 1.2.0 py312hb0aae1a_0 conda-forge
scipy 1.11.4 py312heda63a1_0 conda-forge
secretstorage 3.3.3 py312h7900ff3_2 conda-forge
setuptools 69.0.3 pyhd8ed1ab_0 conda-forge
sip 6.7.12 py312h30efb56_0 conda-forge
six 1.16.0 pyh6c4a22f_0 conda-forge
snowballstemmer 2.2.0 pyhd8ed1ab_0 conda-forge
sortedcontainers 2.4.0 pyhd8ed1ab_0 conda-forge
soupsieve 2.5 pyhd8ed1ab_1 conda-forge
sphinx 7.2.6 pyhd8ed1ab_0 conda-forge
sphinxcontrib-applehelp 1.0.8 pyhd8ed1ab_0 conda-forge
sphinxcontrib-devhelp 1.0.6 pyhd8ed1ab_0 conda-forge
sphinxcontrib-htmlhelp 2.0.5 pyhd8ed1ab_0 conda-forge
sphinxcontrib-jsmath 1.0.1 pyhd8ed1ab_0 conda-forge
sphinxcontrib-qthelp 1.0.7 pyhd8ed1ab_0 conda-forge
sphinxcontrib-serializinghtml 1.1.10 pyhd8ed1ab_0 conda-forge
spyder 5.5.0 py312h7900ff3_3 conda-forge
spyder-kernels 2.5.0 unix_pyhd8ed1ab_0 conda-forge
stack_data 0.6.2 pyhd8ed1ab_0 conda-forge
sympy 1.12 pyh04b8f61_3 conda-forge
tabulate 0.9.0 pyhd8ed1ab_1 conda-forge
text-unidecode 1.3 pyhd8ed1ab_1 conda-forge
textdistance 4.5.0 pyhd8ed1ab_0 conda-forge
three-merge 0.1.1 pyh9f0ad1d_0 conda-forge
tinycss2 1.2.1 pyhd8ed1ab_0 conda-forge
tk 8.6.13 noxft_h4845f30_101 conda-forge
toml 0.10.2 pyhd8ed1ab_0 conda-forge
tomli 2.0.1 pyhd8ed1ab_0 conda-forge
tomlkit 0.12.3 pyha770c72_0 conda-forge
tornado 6.3.3 py312h98912ed_1 conda-forge
traitlets 5.14.1 pyhd8ed1ab_0 conda-forge
types-python-dateutil 2.8.19.20240106 pyhd8ed1ab_0 conda-forge
typing-extensions 4.9.0 hd8ed1ab_0 conda-forge
typing_extensions 4.9.0 pyha770c72_0 conda-forge
tzdata 2024a h0c530f3_0 conda-forge
ujson 5.9.0 py312h30efb56_0 conda-forge
urllib3 2.2.0 pyhd8ed1ab_0 conda-forge
watchdog 3.0.0 py312h7900ff3_1 conda-forge
wcwidth 0.2.13 pyhd8ed1ab_0 conda-forge
webencodings 0.5.1 pyhd8ed1ab_2 conda-forge
whatthepatch 1.0.5 pyhd8ed1ab_0 conda-forge
wheel 0.42.0 pyhd8ed1ab_0 conda-forge
wurlitzer 3.0.3 pyhd8ed1ab_0 conda-forge
xcb-util 0.4.0 hd590300_1 conda-forge
xcb-util-image 0.4.0 h8ee46fc_1 conda-forge
xcb-util-keysyms 0.4.0 h8ee46fc_1 conda-forge
xcb-util-renderutil 0.3.9 hd590300_1 conda-forge
xcb-util-wm 0.4.1 h8ee46fc_1 conda-forge
xkeyboard-config 2.41 hd590300_0 conda-forge
xorg-compositeproto 0.4.2 h7f98852_1001 conda-forge
xorg-damageproto 1.2.1 h7f98852_1002 conda-forge
xorg-fixesproto 5.0 h7f98852_1002 conda-forge
xorg-inputproto 2.3.2 h7f98852_1002 conda-forge
xorg-kbproto 1.0.7 h7f98852_1002 conda-forge
xorg-libice 1.1.1 hd590300_0 conda-forge
xorg-libsm 1.2.4 h7391055_0 conda-forge
xorg-libx11 1.8.7 h8ee46fc_0 conda-forge
xorg-libxau 1.0.11 hd590300_0 conda-forge
xorg-libxcomposite 0.4.6 h0b41bf4_1 conda-forge
xorg-libxdamage 1.1.5 h7f98852_1 conda-forge
xorg-libxdmcp 1.1.3 h7f98852_0 conda-forge
xorg-libxext 1.3.4 h0b41bf4_2 conda-forge
xorg-libxfixes 5.0.3 h7f98852_1004 conda-forge
xorg-libxi 1.7.10 h7f98852_0 conda-forge
xorg-libxrandr 1.5.2 h7f98852_1 conda-forge
xorg-libxrender 0.9.11 hd590300_0 conda-forge
xorg-libxtst 1.2.3 h7f98852_1002 conda-forge
xorg-randrproto 1.5.0 h7f98852_1001 conda-forge
xorg-recordproto 1.14.2 h7f98852_1002 conda-forge
xorg-renderproto 0.11.1 h7f98852_1002 conda-forge
xorg-util-macros 1.19.3 h7f98852_0 conda-forge
xorg-xextproto 7.3.0 h0b41bf4_1003 conda-forge
xorg-xf86vidmodeproto 2.3.1 h7f98852_1002 conda-forge
xorg-xproto 7.0.31 h7f98852_1007 conda-forge
xz 5.2.6 h166bdaf_0 conda-forge
yaml 0.2.5 h7f98852_2 conda-forge
yapf 0.40.1 pyhd8ed1ab_0 conda-forge
zeromq 4.3.5 h59595ed_0 conda-forge
zipp 3.17.0 pyhd8ed1ab_0 conda-forge
zlib 1.2.13 hd590300_5 conda-forge
zstd 1.5.5 hfc55251_0 conda-forge

Thanks, @Geodude-93, nothing unusual from a glance. Would you be able to rerun the reproducer, but this time with the environment variable CUPY_DUMP_CUDA_SOURCE_ON_ERROR=1 set, and attach the output? I cannot reproduce the error so I'd like to see what the generated code was.

How/where do I set the environment variable? (sorry, I am new to cupy)

It's a Linux thing, not CuPy specific. This should work in a terminal:

CUPY_DUMP_CUDA_SOURCE_ON_ERROR=1 python myscript.py

#2100 seems to be the same issue?

setting CUPY_DUMP_CUDA_SOURCE_ON_ERROR=1 did not help, I still get the same error.

As suggested earlier, could you attach the output? Adding the env var is meant for us to debug, not to solve or work around the bug.

ah sorry, I read over that part. Here is the output with CUPY_DUMP_CUDA_SOURCE_ON_ERROR=1 :

/home/keving/.conda/envs/cupy/lib/python3.12/site-packages/cupyx/jit/_interface.py:173: FutureWarning: cupyx.jit.rawkernel is experimental. The interface can change in the future.
cupy._util.experimental('cupyx.jit.rawkernel')
Traceback (most recent call last):
File "/home/keving/.conda/envs/cupy/lib/python3.12/site-packages/cupy/cuda/compiler.py", line 677, in compile
nvrtc.compileProgram(self.ptr, options)
File "cupy_backends/cuda/libs/nvrtc.pyx", line 125, in cupy_backends.cuda.libs.nvrtc.compileProgram
File "cupy_backends/cuda/libs/nvrtc.pyx", line 138, in cupy_backends.cuda.libs.nvrtc.compileProgram
File "cupy_backends/cuda/libs/nvrtc.pyx", line 53, in cupy_backends.cuda.libs.nvrtc.check_status
cupy_backends.cuda.libs.nvrtc.NVRTCError: NVRTC_ERROR_COMPILATION (6)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/mnt/Datastore/usr/keving/Scripts/Test/cupy_lfilt_min_example.py", line 32, in
data_cp_filt = cpsignal.lfilter(b_bp, a_bp, data_cp, axis=0, zi=None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/keving/.conda/envs/cupy/lib/python3.12/site-packages/cupyx/scipy/signal/_signaltools.py", line 797, in lfilter
out = apply_iir(out, a_r, axis=axis, zi=prev_out, dtype=iir_dtype)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/keving/.conda/envs/cupy/lib/python3.12/site-packages/cupyx/scipy/signal/_iir_utils.py", line 577, in apply_iir
corr_kernel = _get_module_func(
^^^^^^^^^^^^^^^^^
File "/home/keving/.conda/envs/cupy/lib/python3.12/site-packages/cupyx/scipy/signal/_iir_utils.py", line 509, in _get_module_func
kernel = module.get_function(kernel_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "cupy/_core/raw.pyx", line 472, in cupy._core.raw.RawModule.get_function
File "cupy/_core/raw.pyx", line 396, in cupy._core.raw.RawModule.module.get
File "cupy/_core/raw.pyx", line 404, in cupy._core.raw.RawModule._module
File "cupy/_util.pyx", line 64, in cupy._util.memoize.decorator.ret
File "cupy/_core/raw.pyx", line 538, in cupy._core.raw._get_raw_module
File "cupy/_core/core.pyx", line 2236, in cupy._core.core.compile_with_cache
File "cupy/_core/core.pyx", line 2254, in cupy._core.core.compile_with_cache
File "/home/keving/.conda/envs/cupy/lib/python3.12/site-packages/cupy/cuda/compiler.py", line 484, in _compile_module_with_cache
return _compile_with_cache_cuda(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/keving/.conda/envs/cupy/lib/python3.12/site-packages/cupy/cuda/compiler.py", line 562, in _compile_with_cache_cuda
ptx, mapping = compile_using_nvrtc(
^^^^^^^^^^^^^^^^^^^^
File "/home/keving/.conda/envs/cupy/lib/python3.12/site-packages/cupy/cuda/compiler.py", line 319, in compile_using_nvrtc
return _compile(source, options, cu_path,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/keving/.conda/envs/cupy/lib/python3.12/site-packages/cupy/cuda/compiler.py", line 303, in _compile
compiled_obj, mapping = prog.compile(options, log_stream)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/keving/.conda/envs/cupy/lib/python3.12/site-packages/cupy/cuda/compiler.py", line 696, in compile
raise CompileException(log, self.src, self.name, options,
cupy.cuda.compiler.CompileException: /tmp/tmpciit15lq/b42b75ac773372a878930370cfd2b11e5a15836b.cubin.cu(2): catastrophic error: cannot open source file "cuda_runtime.h"

1 catastrophic error detected in the compilation of "/tmp/tmpciit15lq/b42b75ac773372a878930370cfd2b11e5a15836b.cubin.cu".
Compilation terminated.

Hi @Geodude-93 this is not the full output. There should be more before the traceback, in particular there should be a line says CUDA source: followed by the CUDA source code sent to the compiler.

ah sorry, here is the first part:

/home/keving/.conda/envs/cupy/lib/python3.12/site-packages/cupyx/jit/_interface.py:173: FutureWarning: cupyx.jit.rawkernel is experimental. The interface can change in the future.
cupy._util.experimental('cupyx.jit.rawkernel')
NVRTC compilation error: /tmp/tmpyyhgi8xo/b42b75ac773372a878930370cfd2b11e5a15836b.cubin.cu(2): catastrophic error: cannot open source file "cuda_runtime.h"

1 catastrophic error detected in the compilation of "/tmp/tmpyyhgi8xo/b42b75ac773372a878930370cfd2b11e5a15836b.cubin.cu".
Compilation terminated.


Name: /tmp/tmpyyhgi8xo/b42b75ac773372a878930370cfd2b11e5a15836b.cubin.cu
Options: -I/home/keving/.conda/envs/cupy/lib/python3.12/site-packages/cupy/_core/include/cupy/_cccl/cub -I/home/keving/.conda/envs/cupy/lib/python3.12/site-packages/cupy/_core/include/cupy/_cccl/thrust -I/home/keving/.conda/envs/cupy/lib/python3.12/site-packages/cupy/_core/include/cupy/_cccl/libcudacxx -std=c++11 -I/home/keving/.conda/envs/cupy/lib/python3.12/site-packages/cupy/_core/include -I/home/keving/.conda/envs/cupy/lib/python3.12/site-packages/cupy/_core/include/cupy/_cuda/cuda-11 -I/home/keving/.conda/envs/cupy/include -ftz=true -arch=sm_75
CUDA source:

001 
002 #include <cuda_runtime.h>
003 #include <device_launch_parameters.h>
004 
005 #include <cupy/math_constants.h>
006 #include <cupy/carray.cuh>
007 #include <cupy/complex.cuh>
008 
009 template<typename U, typename T>
010 __global__ void compute_correction_factors(
011         const int m, const int k, const T* b, U* out) {
012     int idx = blockDim.x * blockIdx.x + threadIdx.x;
013     if(idx >= k) {
014         return;
015     }
016 
017     U* out_start = out + idx * (k + m);
018     U* out_off = out_start + k;
019 
020     for(int i = 0; i < m; i++) {
021         U acc = 0.0;
022         for(int j = 0; j < k; j++) {
023             acc += ((U) b[j]) * out_off[i - j - 1];
024 
025         }
026         out_off[i] = acc;
027     }
028 }
029 
030 template<typename T>
031 __global__ void first_pass_iir(
032         const int m, const int k, const int n, const int n_blocks,
033         const int carries_stride, const T* factors, T* out,
034         T* carries) {
035     int orig_idx = blockDim.x * (blockIdx.x % n_blocks) + threadIdx.x;
036 
037     int num_row = blockIdx.x / n_blocks;
038     int idx = 2 * orig_idx + 1;
039 
040     if(idx >= n) {
041         return;
042     }
043 
044     int group_num = idx / m;
045     int group_pos = idx % m;
046 
047     T* out_off = out + num_row * n;
048     T* carries_off = carries + num_row * carries_stride;
049 
050     T* group_start = out_off + m * group_num;
051     T* group_carries = carries_off + k * group_num;
052 
053     int pos = group_pos;
054     int up_bound = pos;
055     int low_bound = pos;
056     int rel_pos;
057 
058     for(int level = 1, iter = 1; level < m; level *=2, iter++) {
059         int sz = min(pow(2.0f, ((float) iter)), ((float) m));
060 
061         if(level > 1) {
062             int factor = ceil(pos / ((float) sz));
063             up_bound = sz * factor - 1;
064             low_bound = up_bound - level + 1;
065         }
066 
067         if(level == 1) {
068             pos = low_bound;
069         }
070 
071         if(pos < low_bound) {
072             pos += level / 2;
073         }
074 
075         if(pos + m * group_num >= n) {
076             break;
077         }
078 
079         rel_pos = pos % level;
080         T carry = 0.0;
081         for(int i = 1; i <= min(k, level); i++) {
082             T k_value = group_start[low_bound - i];
083             const T* k_factors = factors + (m + k) * (i - 1) + k;
084             T factor = k_factors[rel_pos];
085             carry += k_value * factor;
086         }
087 
088         group_start[pos] += carry;
089         __syncthreads();
090     }
091 
092     if(pos >= m - k) {
093         if(carries != NULL) {
094             group_carries[pos - (m - k)] = group_start[pos];
095         }
096     }
097 
098 }
099 
100 template<typename T>
101 __global__ void correct_carries(
102     const int m, const int k, const int n_blocks, const int carries_stride,
103     const int offset, const T* factors, T* carries) {
104 
105     int idx = threadIdx.x;
106     int pos = idx + (m - k);
107     T* row_carries = carries + carries_stride * blockIdx.x;
108 
109     for(int i = offset; i < n_blocks; i++) {
110         T* this_carries = row_carries + k * (i + (1 - offset));
111         T* prev_carries = row_carries + k * (i - offset);
112 
113         T carry = 0.0;
114         for(int j = 1; j <= k; j++) {
115             const T* k_factors = factors + (m + k) * (j - 1) + k;
116             T factor = k_factors[pos];
117             T k_value = prev_carries[k - j];
118             carry += factor * k_value;
119         }
120 
121         this_carries[idx] += carry;
122         __syncthreads();
123     }
124 }
125 
126 template<typename T>
127 __global__ void second_pass_iir(
128         const int m, const int k, const int n, const int carries_stride,
129         const int n_blocks, const int offset, const T* factors,
130         T* carries, T* out) {
131 
132     int idx = blockDim.x * (blockIdx.x % n_blocks) + threadIdx.x;
133     idx += offset * m;
134 
135     int row_num = blockIdx.x / n_blocks;
136     int n_group = idx / m;
137     int pos = idx % m;
138 
139     if(idx >= n) {
140         return;
141     }
142 
143     T* out_off = out + row_num * n;
144     T* carries_off = carries + row_num * carries_stride;
145     const T* prev_carries = carries_off + (n_group - offset) * k;
146 
147     T carry = 0.0;
148     for(int i = 1; i <= k; i++) {
149         const T* k_factors = factors + (m + k) * (i - 1) + k;
150         T factor = k_factors[pos];
151         T k_value = prev_carries[k - i];
152         carry += factor * k_value;
153     }
154 
155     out_off[idx] += carry;
156 }
157 

Thanks, @Geodude-93. Could you try removing this line locally and see if it works?

#include <cuda_runtime.h>

It should be in this file on your filesystem:

/home/keving/.conda/envs/cupy/lib/python3.12/site-packages/cupyx/scipy/signal/_iir_utils.py

Hi, I removed the line. Now I get the following:

(cupy) keving@CGF-C9X299-PG300F:/mnt/Datastore/usr/keving/Scripts/Test$ python cupy_lfilt_min_example.py
/home/keving/.conda/envs/cupy/lib/python3.12/site-packages/cupyx/jit/_interface.py:173: FutureWarning: cupyx.jit.rawkernel is experimental. The interface can change in the future.
cupy._util.experimental('cupyx.jit.rawkernel')
Traceback (most recent call last):
File "/home/keving/.conda/envs/cupy/lib/python3.12/site-packages/cupy/cuda/compiler.py", line 677, in compile
nvrtc.compileProgram(self.ptr, options)
File "cupy_backends/cuda/libs/nvrtc.pyx", line 125, in cupy_backends.cuda.libs.nvrtc.compileProgram
File "cupy_backends/cuda/libs/nvrtc.pyx", line 138, in cupy_backends.cuda.libs.nvrtc.compileProgram
File "cupy_backends/cuda/libs/nvrtc.pyx", line 53, in cupy_backends.cuda.libs.nvrtc.check_status
cupy_backends.cuda.libs.nvrtc.NVRTCError: NVRTC_ERROR_COMPILATION (6)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/mnt/Datastore/usr/keving/Scripts/Test/cupy_lfilt_min_example.py", line 32, in
data_cp_filt = cpsignal.lfilter(b_bp, a_bp, data_cp, axis=0, zi=None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/keving/.conda/envs/cupy/lib/python3.12/site-packages/cupyx/scipy/signal/_signaltools.py", line 797, in lfilter
out = apply_iir(out, a_r, axis=axis, zi=prev_out, dtype=iir_dtype)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/keving/.conda/envs/cupy/lib/python3.12/site-packages/cupyx/scipy/signal/_iir_utils.py", line 576, in apply_iir
corr_kernel = _get_module_func(
^^^^^^^^^^^^^^^^^
File "/home/keving/.conda/envs/cupy/lib/python3.12/site-packages/cupyx/scipy/signal/_iir_utils.py", line 508, in _get_module_func
kernel = module.get_function(kernel_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "cupy/_core/raw.pyx", line 472, in cupy._core.raw.RawModule.get_function
File "cupy/_core/raw.pyx", line 396, in cupy._core.raw.RawModule.module.get
File "cupy/_core/raw.pyx", line 404, in cupy._core.raw.RawModule._module
File "cupy/_util.pyx", line 64, in cupy._util.memoize.decorator.ret
File "cupy/_core/raw.pyx", line 538, in cupy._core.raw._get_raw_module
File "cupy/_core/core.pyx", line 2236, in cupy._core.core.compile_with_cache
File "cupy/_core/core.pyx", line 2254, in cupy._core.core.compile_with_cache
File "/home/keving/.conda/envs/cupy/lib/python3.12/site-packages/cupy/cuda/compiler.py", line 484, in _compile_module_with_cache
return _compile_with_cache_cuda(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/keving/.conda/envs/cupy/lib/python3.12/site-packages/cupy/cuda/compiler.py", line 562, in _compile_with_cache_cuda
ptx, mapping = compile_using_nvrtc(
^^^^^^^^^^^^^^^^^^^^
File "/home/keving/.conda/envs/cupy/lib/python3.12/site-packages/cupy/cuda/compiler.py", line 319, in compile_using_nvrtc
return _compile(source, options, cu_path,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/keving/.conda/envs/cupy/lib/python3.12/site-packages/cupy/cuda/compiler.py", line 303, in _compile
compiled_obj, mapping = prog.compile(options, log_stream)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/keving/.conda/envs/cupy/lib/python3.12/site-packages/cupy/cuda/compiler.py", line 696, in compile
raise CompileException(log, self.src, self.name, options,
cupy.cuda.compiler.CompileException: /tmp/tmp_cvzik4z/60d2bc895ff850256bdbd99f5d04e6aac91c688b.cubin.cu(2): catastrophic error: cannot open source file "device_launch_parameters.h"

1 catastrophic error detected in the compilation of "/tmp/tmp_cvzik4z/60d2bc895ff850256bdbd99f5d04e6aac91c688b.cubin.cu".
Compilation terminated.

Nice, could you try removing that include line too (right below the line that you removed)?

Great, it works now, thanks!

Thanks for reporting/testing, @Geodude-93! We'll get it fixed.