question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Get segmentation fault with FFT callback function

See original GitHub issue

pr.py

import numpy as np
import cupy as cp

code = r'''
__device__ cufftComplex CB_ConvertInput(
    void *dataIn,
    size_t offset,
    void *callerInfo,
    void *sharedPtr) {
            return make_float2(0.0, 0.1);
}

__device__ cufftCallbackLoadC d_loadCallbackPtr = CB_ConvertInput;
'''

in_arr = cp.random.rand(12, dtype=np.float32)

with cp.fft.config.set_cufft_callbacks(cb_load=code):
    out_arr = cp.fft.fft(in_arr)

print(out_arr)

Run with

CUDA_VISIBLE_DEVICES=0 python pr.py

Then I got

[1]    410392 segmentation fault (core dumped)  CUDA_VISIBLE_DEVICES=0 python pr.py

My system information:

OS                           : Linux-5.12.8-arch1-1-x86_64-with-glibc2.33
Python Version               : 3.9.5
CuPy Version                 : 9.1.0
CuPy Platform                : NVIDIA CUDA
NumPy Version                : 1.20.0
SciPy Version                : 1.6.3
Cython Build Version         : 0.29.23
Cython Runtime Version       : 0.29.23
CUDA Root                    : /opt/cuda
nvcc PATH                    : /opt/cuda/bin/nvcc
CUDA Build Version           : 11030
CUDA Driver Version          : 11030
CUDA Runtime Version         : 11030
cuBLAS Version               : 11402
cuFFT Version                : 10402
cuRAND Version               : 10204
cuSOLVER Version             : (11, 1, 1)
cuSPARSE Version             : 11500
NVRTC Version                : (11, 3)
Thrust Version               : 101100
CUB Build Version            : 101100
Jitify Build Version         : 60e9e72
cuDNN Build Version          : 8200
cuDNN Version                : 8200
NCCL Build Version           : 20906
NCCL Runtime Version         : 20906
cuTENSOR Version             : None
cuSPARSELt Build Version     : None
Device 0 Name                : NVIDIA GeForce GTX 1080
Device 0 Compute Capability  : 61
Device 0 PCI Bus ID          : 0000:17:00.0
Device 1 Name                : NVIDIA Quadro K600
Device 1 Compute Capability  : 30
Device 1 PCI Bus ID          : 0000:65:00.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:23 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
szsdkcommented, May 31, 2021

@leofang My system is archlinux. The cupy is installed from archlinuxcn/python-cupy. After deleting .cupy folder, I got a warning before the segmentation fault.

nvprune warning : No device code that matched architecture, so stripped out all device code
1reaction
szsdkcommented, Jun 3, 2021

@leofang Thanks, everything works now on the 980 workstation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

f2py (1.20) causes segmentation fault when calling callback ...
Reproducing code example: For the same code as in #18335, when any callback function is actually called, it causes a segmentation fault.
Read more >
program crashing with segmentation fault while calling a ...
My program crashes with Segmentation fault while calling a callback function randomly. When I analyzed the core the callback function ...
Read more >
cuFFT API Reference - NVIDIA Documentation Center
The FFT is a divide-and-conquer algorithm for efficiently computing discrete Fourier transforms of complex or real-valued data sets.
Read more >
Distributing a function that uses FFTW - Julia Discourse
Here is a minimum example, where I just try to perform a FFT on an array of matrices: @everywhere using FFTW ... I...
Read more >
Orthogonal distance regression (scipy.odr)
The Model class stores information about the function you wish to fit. ... data for explanatory variables as fixed, i.e., not subject to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found