-
Notifications
You must be signed in to change notification settings - Fork 132
[BUG] cuSignal throws RawModule
Error with CuPy 6.0 on Windows OS
#284
Comments
Hi @leyojoseph! Thanks for submitting an issue. I see you're currently at CuPy version 6.0. If you update this to 8.0 or newer, this error will go away. A couple ways to do this:
Stable: Nightly: |
Thanks for the quick response. (base) PS C:\Windows\system32> conda create -n cusignal-stable -c rapidsai -c nvidia -c conda-forge \ -c defaults cusignal python=3.8 cudatoolkit=11.0 |
OOOOOH! You're on Windows. We've only worked on experimental Windows support, and I'm not sure what the latest CuPy version that's built for that OS is. I'm curious: if you run If we can get 8.0 to install on Windows, the cuSignal installation should be relatively straightforward from there. |
In your conda env, you could try first uninstalling cupy, and then install it from PyPI using
and see if it works for you or not. Usually if you already have CUDA Toolkit installed locally, the pip version can play nicely with the rest of conda packages. |
Thanks cupy-cuda110 8.1.0 PS C:\Windows\system32\cusignal> conda list packages in environment at C:\ProgramData\Anaconda3:Name Version Build Channel_ipyw_jlab_nb_ext_conf 0.1.0 py37_0 I don't know... now I am getting below message for cusignal ModuleNotFoundError: No module named 'cusignal' |
Could you try a fresh conda env and see if the problem persists or not? Your package lists look confusing to me -- I saw two cupy installs and two cusignal installs. |
Thanks for helping, @leofang! @leyojoseph -- when you've successfully installed cupy 8, follow the Windows build instructions here: https://github.com/rapidsai/cusignal#source-windows-os-experimental You'll basically just need to run We might have some issues with the custom CUDA kernels compiling. CC @mnicely @evanmayer has successfully build cuSignal on Windows and might have additional tips. |
I uninstalled everything a start from scratch. CuPy is not correctly installed. If you are using wheel distribution (cupy-cudaXX), make sure that the version of CuPy you installed matches with the version of CUDA on your host. If you are building CuPy from source, please check your environment, uninstall CuPy and reinstall it with: Check the Installation Guide for details: original error: cannot import name syncdetect Below is the output from pip list command==> base) PS C:> pip list alabaster 0.7.12 When I try to install cupy, getting below error message ==>
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. Please help me on this. |
For CuPy installation, I saw @leyojoseph has opened an issue in CuPy (cupy/cupy#4279). Let's move the discussion there, and come back with a working CuPy installation to resolve cuSignal installation issues (if any). |
RawModule
Error with CuPy 6.0RawModule
Error with CuPy 6.0 on Windows OS
Looks like we might be on the verge of having Cupy sorted.
These instructions should work now. |
Hello , |
D’oh! @awthomp how are Windows users going to build from source? Is it necessary? When I tried this last, I do not remember a |
Oh shoot, you're right. We changed the @mnicely -- any intuition on what will fail here on a Windows build? I'm going to try to find some time to work this over the weekend/early next week. Need to find a Windows testing rig :). @evanmayer -- mind running |
I’ll have to make my next GPU upgrade to this rig an NVIDIA card so I don’t have to keep swapping over to my old GTX760. I can do the swap this weekend and try a fresh cusignal install. I’ll report back so you’ll have a head start next week. Enjoy your weekend! |
Dropping some notes here as I go through the install...
A LOT of pytest output
There are two classes of failures: |
As per suggestion from cupy github forum, ran the below code and is working fine. start = 0 cx = cp.linspace(start, stop, num_samps, endpoint=False) But the below code gives errors ==> import cupy as cp start = 0 gx = cp.linspace(start, stop, num_samps, endpoint=False) %%timeitgf = cusignal.resample_poly(gy, resample_up, resample_down, window=('kaiser', 0.5)) Error output is as follows ==> File "C:\dpd\Python\DLA_Split band\cusig_example.py", line 14, in File "C:\ProgramData\Anaconda3\envs\gpu\lib\site-packages\cusignal-0.17.0a0+29.ga3e5293-py3.8.egg\cusignal\filtering\resample.py", line 422, in resample_poly File "C:\ProgramData\Anaconda3\envs\gpu\lib\site-packages\cusignal-0.17.0a0+29.ga3e5293-py3.8.egg\cusignal\filtering\resample.py", line 521, in upfirdn File "C:\ProgramData\Anaconda3\envs\gpu\lib\site-packages\cusignal-0.17.0a0+29.ga3e5293-py3.8.egg\cusignal\filtering_upfirdn_cuda.py", line 214, in apply_filter File "C:\ProgramData\Anaconda3\envs\gpu\lib\site-packages\cusignal-0.17.0a0+29.ga3e5293-py3.8.egg\cusignal\filtering_upfirdn_cuda.py", line 137, in _populate_kernel_cache File "C:\ProgramData\Anaconda3\envs\gpu\lib\site-packages\cusignal-0.17.0a0+29.ga3e5293-py3.8.egg\cusignal\utils\helper_tools.py", line 57, in _get_function File "cupy\core\raw.pyx", line 464, in cupy.core.raw.RawModule.get_function File "cupy\core\raw.pyx", line 89, in cupy.core.raw.RawKernel.kernel.get File "cupy\core\raw.pyx", line 106, in cupy.core.raw.RawKernel._kernel File "cupy_util.pyx", line 49, in cupy._util.memoize.decorator.ret File "cupy\core\raw.pyx", line 533, in cupy.core.raw._get_raw_module File "cupy\cuda\function.pyx", line 220, in cupy.cuda.function.Module.load_file File "cupy_backends\cuda\api\driver.pyx", line 237, in cupy_backends.cuda.api.driver.moduleLoad File "cupy_backends\cuda\api\driver.pyx", line 124, in cupy_backends.cuda.api.driver.check_status CUDADriverError: CUDA_ERROR_FILE_NOT_FOUND: file not found Below is the output of pytest (gpu) C:>cd cusignal (gpu) C:\cusignal>pytest ======================================================= ERRORS ======================================================== -- Docs: https://docs.pytest.org/en/stable/warnings.html (gpu) C:\cusignal> Please help me fix this. I installed cusignal using./build.sh |
Is WSL an option? https://docs.microsoft.com/en-us/windows/wsl/about |
I believe CUDA support is coming in WSL2. Edit: also realized I’m probably preaching to the choir here about CUDA in WSL2. |
Okay, I believe I understand the issue, but not sure how to fix it. A hack in the meantime is to run the nvcc commands manually. |
@mnicely -- is there a way to default to JIT'd kernels if, for whatever reason (like Windows OS or maybe unsupported GPU), the I do think we need to prioritize Windows OS support. I'm always shocked how much SDR development takes place here :). |
Could you please help me understand below even though it is not related to cusignal. Generally "GPU" mean "Graphics Processing unit" and it accelerates graphics related functions for CPU. As shown above "Nvidia Quadro K620" is Graphics processing unit as I am connecting display port to my monitor from this card. Why Tesla K40 C is also called "GPU"?. It is not helping for any graphical functions?. |
Hi @leyojoseph. GPUs can serve multiple purposes -- as you know: whether it's rendering graphics or performing compute. Further, if you have a single GPU system, it's possible to drive graphics at the same time as compute. The only downside here is that you'll have fewer resources available. Typically, you see setups where one GPU is dedicated for graphics and others are meant for compute. In my workstation, for example, I have a P2000 for Display out and 2 P100s for compute. Every GPU that is 'CUDA Capable' has the ability to put its hardware to work for solving compute problems. You can specify the specific GPU you're using via |
Please let me know if you figure out a solution for this. As Cusignal is not working, I am using scipy on cpu for convolve and it dead slow. Appreciate your help. |
@leyojoseph Can you confirm if you tried running the nvcc commands and if they worked or not? It's easy to extract what you need from the parent build.sh (https://github.com/rapidsai/cusignal/blob/branch-0.17/build.sh) Run from cusignal (parent directory) nvcc --fatbin -std=c++11 --generate-code arch=compute_35,code=sm_35 --generate-code arch=compute_50,code=sm_50 cpp/src/convolution/_convolution.cu -odir python/cusignal/convolution/ Once you've done that, you can run |
@evanmayer -- Do you mind seeing if the nvcc commands work on your Windows system? @leyojoseph -- Thanks for being patient with us. This is really about adding Windows support to cuSignal. Out of your issue, I'll submit a PR with more indepth (and working!) instructions concerning how to build cuSignal on Windows. |
I can try this evening if @leyojoseph doesn’t get to it and report back. |
Hello, (base) C:\cusignal>nvcc --fatbin -std=c++11 --generate-code arch=compute_35,code=sm_35 --generate-code arch=compute_50,code=sm_50 cpp/src/convolution/_convolution.cu -odir python/cusignal/convolution/ |
Thanks for getting back to us. Two things.
Unfortunately, I'm not familiar enough with Windows to provide a solution. Please start with https://stackoverflow.com/questions/8125826/error-compiling-cuda-from-command-prompt Thank you for your patience and help. We are discussing a better solution and your help is greatly appreciated. |
RecapGTX 760 (compute capability 3), CUDA Toolkit v10.1, VS2019. Spin up a new conda env to test install:
nvcc BuildAfter reinstalling Visual Studio to get cl.exe, and I ran Then, inside
which succeeded without errors. Warnings:
PitfallsIf you don't call the right Error output:
I think order matters, too. I installed VS, then reinstalled CUDA using the NVIDIA CUDA Installer. I'd be curious to learn if anyone has succeeded doing it in reverse order. I spent several hours trying to get the CUDA reinstall to succeed, mostly because uninstalling completely is not trivial. I eventually succeeded with installing after completely uninstalling all NVIDIA software on my machine and running the CUDA Installer executable as administrator. Testing to follow. |
Testing
PyTest output:
So, fail. It looks like the Pass/fail also doesn't depend on nvcc compiler options - I don't get different behavior by dropping Hope all that helps! |
Thanks for the feedback, @evanmayer !!! Much appreciated! And apologies for the low response and acknowledgement; I totally missed this comment until doing some pre-end-of-year cleaning :). I should be getting a Windows + GPU machine in the next couple of weeks, and will aim for more mature Windows support in the future for cuSignal. |
This issue has been marked stale due to no recent activity in the past 30d. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be marked rotten if there is no activity in the next 60d. |
@mnicely was able to build cuSignal with CUDA + WSL using the provided GH installation instructions. More information on this process can be found here: https://docs.nvidia.com/cuda/wsl-user-guide/index.html. I'll update the README to reflect these changes. |
Hello,
I have Nvidia Tesla K40 in my HP Z440 PC as shown below==>
import numba.cuda
numba.cuda.detect()
Found 2 CUDA devices
id 0 b'Tesla K40c' [SUPPORTED]
compute capability: 3.5
pci device id: 0
pci bus id: 3
id 1 b'Quadro K620' [SUPPORTED]
compute capability: 5.0
pci device id: 0
pci bus id: 2
Summary:
2/2 devices are supported
Out[8]: True
Have Nvidia Conda toolkit 11 as shown below==>
(base) PS C:\Windows\system32> nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Mon_Oct_12_20:54:10_Pacific_Daylight_Time_2020
Cuda compilation tools, release 11.1, V11.1.105
Build cuda_11.1.relgpu_drvr455TC455_06.29190527_0
(base) PS C:\Windows\system32>
Below is output of pip list command (Only cusignal relevant parts are posted)
clyent 1.2.2
colorama 0.4.3
comtypes 1.1.7
conda 4.9.2
conda-build 3.18.11
conda-package-handling 1.6.0
conda-verify 3.4.2
contextlib2 0.6.0.post1
cryptography 2.8
cupy 6.0.0
cupy-cuda111 8.1.0
Trying to run the example code in your site
Created on Thu Nov 12 13:30:18 2020
@author: ljoseph
"""
import cupy as cp
import cusignal
start = 0
stop = 10
num_samps = int(1e8)
resample_up = 2
resample_down = 3
gx = cp.linspace(start, stop, num_samps, endpoint=False)
gy = cp.cos(-gx**2/6.0)
%%timeit
gf = cusignal.resample_poly(gy, resample_up, resample_down, window=('kaiser', 0.5))
Getting below error message==>
runfile('C:/dpd/Python/Try/cusignal_1.py', wdir='C:/dpd/Python/Try')
Traceback (most recent call last):
File "C:\dpd\Python\Try\cusignal_1.py", line 21, in
gf = cusignal.resample_poly(gy, resample_up, resample_down, window=('kaiser', 0.5))
File "C:\ProgramData\Anaconda3\lib\site-packages\cusignal-0.17.0a0+29.ga3e5293-py3.7.egg\cusignal\filtering\resample.py", line 422, in resample_poly
y = upfirdn(h, x, up, down, axis)
File "C:\ProgramData\Anaconda3\lib\site-packages\cusignal-0.17.0a0+29.ga3e5293-py3.7.egg\cusignal\filtering\resample.py", line 521, in upfirdn
return ufd.apply_filter(x, axis)
File "C:\ProgramData\Anaconda3\lib\site-packages\cusignal-0.17.0a0+29.ga3e5293-py3.7.egg\cusignal\filtering_upfirdn_cuda.py", line 214, in apply_filter
_populate_kernel_cache(out.dtype, k_type)
File "C:\ProgramData\Anaconda3\lib\site-packages\cusignal-0.17.0a0+29.ga3e5293-py3.7.egg\cusignal\filtering_upfirdn_cuda.py", line 139, in populate_kernel_cache
"cupy" + k_type + "" + str(np_type),
File "C:\ProgramData\Anaconda3\lib\site-packages\cusignal-0.17.0a0+29.ga3e5293-py3.7.egg\cusignal\utils\helper_tools.py", line 54, in _get_function
module = cp.RawModule(
AttributeError: module 'cupy' has no attribute 'RawModule'
Could you please help me on this.
The text was updated successfully, but these errors were encountered: