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

GPUassert: invalid configuration argument #46

Open
JCCC0328 opened this issue Jun 27, 2023 · 4 comments
Open

GPUassert: invalid configuration argument #46

JCCC0328 opened this issue Jun 27, 2023 · 4 comments

Comments

@JCCC0328
Copy link

Hi,I encountered the following error when running the code. How can I resolve it?
GPUassert: invalid configuration argument /raid/chenjincheng/package/gpuRIR-master/src/gpuRIR_cuda.cu 672

@DavidDiazGuerra
Copy link
Owner

Hi, that's probably related to the arguments you used to call the function, but it's hard to know only from that error log. Could you share the code to replicate the error?

@JCCC0328
Copy link
Author

import numpy as np
import soundfile as sf
import torchvision
from gpuRIR import simulateRIR
import os
os.environ["CUDA_VISIBLE_DEVICES"] = '4'

audio, sr = sf.read("recapnet-vctk_p225_013_50cm.wav")

room_size = [5, 4, 3]
reflection_coeffs = [0.8, 0.7, 0.6, 0.5, 0.4, 0.3]
source_positions = np.array([[2, 2, 1]])
receiver_positions = np.array([[3, 3, 2]])
image_sources = [3, 3, 3]
rir_length = len(audio) / sr
sampling_rate = sr

rir = simulateRIR(room_size, reflection_coeffs, source_positions, receiver_positions, image_sources, rir_length, sampling_rate)

Here is my code above, and below is the error message.

GPUassert: invalid configuration argument /raid/chenjincheng/package/gpuRIR-master/src/gpuRIR_cuda.cu 672

@DavidDiazGuerra
Copy link
Owner

The issue is probably that you're asking for a too-long RIR. I don't know how long is your file recapnet-vctk_p225_013_50cm.wav, but I can guess it's at least several seconds long. The length of the RIR is not supposed to be the length of the signal but just the length of the filter. It will be longer or shorter depending on the reverberation level that you're trying to simulate, I usually use the $T_{60}$ (i.e. the time that the reverberation needs decrease 60dB) or even less for this.

Btw, rir_length is just controlling the length of the filter in memory, but it doesn't mean that all those samples are going to be filled with the RIR. If you use too low values of image_sources and a large value of rir_length, you're just going to get the beginning of the RIR in the first samples and then a lot of 0s.

I don't know your application so I don't know if this is possible, but in general, I first choose the $T_{60}$ and the room size, and then I compute values for reflection_coeffs, image_sources, and rir_length which makes sense for them. The library contains some functions to do this using the Sabine equation, you can see how they work in this example: https://github.com/DavidDiazGuerra/gpuRIR/blob/master/examples/example.py

@JCCC0328
Copy link
Author

Thanks a lot ,I'll give it a try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants