PyTorchWavelets icon indicating copy to clipboard operation
PyTorchWavelets copied to clipboard

RuntimeError: CUDA error: unspecified launch failure

Open y0umu opened this issue 6 years ago • 0 comments

Hi there, I am testing PyTorchWavelets with some minimal code snippets. Unfortunately I encountered the problem with the very first example :-(

# filename is PyTorchWavelets_minitest.py
import torch
import numpy as np
from wavelets_pytorch.transform import WaveletTransform        # SciPy version
from wavelets_pytorch.transform import WaveletTransformTorch   # PyTorch version

def test():
    dt = 0.1         # sampling frequency
    dj = 0.125       # scale distribution parameter
    batchsize = 32    #! this is where the problem comes. If the problem wont reproduce try increasing this number
    
    # Batch of signals to process
    batch = np.random.randn(batchsize,10000)

    wa_torch = WaveletTransformTorch(dt, dj, cuda=True)
    cwt_torch = wa_torch.cwt(batch)

    print(cwt_torch)

if __name__ == "__main__":
    test()

It will either give me CUDA error: unspecified launch failure:

(base) xzc@HP-XZC D:\dev_workspace
> python PyTorchWavelets_minitest.py
Traceback (most recent call last):
  File "PyTorchWavelets_minitest.py", line 20, in <module>
    test()
  File "PyTorchWavelets_minitest.py", line 15, in test
    cwt_torch = wa_torch.cwt(batch)
  File "d:\Anaconda3\lib\site-packages\wavelets_pytorch-0.1-py3.6.egg\wavelets_pytorch\transform.py", line 310, in cwt
RuntimeError: CUDA error: unspecified launch failure

Or CUDA error: the launch timed out and was terminated

(base) xzc@HP-XZC D:\dev_workspace
> python PyTorchWavelets_minitest.py
Traceback (most recent call last):
  File "PyTorchWavelets_minitest.py", line 20, in <module>
    test()
  File "PyTorchWavelets_minitest.py", line 15, in test
    cwt_torch = wa_torch.cwt(batch)
  File "d:\Anaconda3\lib\site-packages\wavelets_pytorch-0.1-py3.6.egg\wavelets_pytorch\transform.py", line 310, in cwt
RuntimeError: CUDA error: the launch timed out and was terminated

I am using pytorch 1.0.0, Python version 3.6.5 (both installed through anaconda) on a Windows 10 x64 host. I googled the words "CUDA error: the launch timed out and was terminated" and found this. Not sure if it is corresponding to what is described in that post.

y0umu avatar Mar 04 '19 02:03 y0umu