Coder Social home page Coder Social logo

daviddiazguerra / gpurir Goto Github PK

View Code? Open in Web Editor NEW
447.0 11.0 89.0 4.03 MB

Python library for Room Impulse Response (RIR) simulation with GPU acceleration

License: GNU Affero General Public License v3.0

CMake 2.68% Python 19.93% Cuda 65.59% C++ 11.81%
room-impulse-responses image-source-model acoustics rir gpu-acceleration python-library

gpurir's People

Contributors

corrooli avatar daviddiazguerra avatar fakufaku avatar gaetanlepage avatar jazcarretao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gpurir's Issues

Possible memory leak

There might be a memory leak in gpuRIR_cuda::cuda_simulateRIR since the memory of orV_src is not free at the end of the function:

gpuRIR/src/gpuRIR_cuda.cu

Lines 917 to 927 in 283235d

// Free memory
gpuErrchk( cudaFree(pos_src) );
gpuErrchk( cudaFree(pos_rcv) );
gpuErrchk( cudaFree(orV_rcv) );
gpuErrchk( cudaFree(amp) );
gpuErrchk( cudaFree(tau) );
gpuErrchk( cudaFree(tau_dp) );
gpuErrchk( cudaFree(rirISM) );
gpuErrchk( cudaFree(A) );
gpuErrchk( cudaFree(alpha) );
gpuErrchk( cudaFree(rirDiff) );

Can't generate 48kHz rirs longer than 1s

Hi. I'm aware about #46 but it looks like it shouldn't be a big problem to generate bigger number of points. There's no problem in generating for example 2 seconds of 16kHz RIRs, and for consistency of my experiments I'd like to generate 2s of 48kHz RIRs, but it throws me GPUassert: invalid configuration argument /tmp/pip-req-build-m2v7oxdq/src/gpuRIR_cuda.cu 661. Is there any workaround or am I stuck with shorter fullband files?

filtered_signal = gpuRIR.simulateTrajectory(source_signal, RIRs) get wrong signal to save

in example/simulate_trajectory.py:
filtered_signal = gpuRIR.simulateTrajectory(source_signal, RIRs)
in which source_signal.shape = (65030,) but get filtered_signal .shape = (74629, 2), why length is not equal?
Besides, when i run wavfile.write('filtered_signal.wav', fs, filtered_signal), i can't play the audio filtered_signal.wav even when i add

filtered_signal= filtered_signal[0]
wavfile.write('filtered_signal.wav', fs, filtered_signal)

to get a shape of (74629, ), ican't play it
thanks~

gpuassert cuda error on larger number of source positions

I'm trying to simulate RIRs on a 4 x 4 x 4 room with fully reflective walls with a single reciever at the center of the room and 2600 source positions randomly chosen on the unit sphere centered at [2, 2, 2]

gpuRIR was installed using pip on a machine with 128 GB cpu memory and a Nvidia Titan Xp GPU with 12Gb memory with Ubuntu 18.

These are the parameters I use to run gpuRIR.simulateRIR:
beta = [0.] * 6
nb_img = [2] * 3
Tmax = 0.0066
Tdiff = None
mic_pattern='omni'

gpuRIR.simulateRIR function sometimes fails with the error:
GPUassert: invalid argument /tmp/pip-req-build-93zmrk8r/src/gpuRIR_cuda.cu 795

The error goes away if I reduce the pos_src chunk size to 2000 x 3. This is while GPU memory usage never exceeds 200 mb and the utilization rate is always below 4-5%. Any idea on what might be causing this issue?

Installation problems (macosx)

Hi David,

thanks for sharing your work. I have tried to install via python setup.py install with Python2.7 and 3.7 but always the same error:
[ 80%] Linking CUDA device code CMakeFiles/gpuRIR_bind.dir/cmake_device_link.o nvcc fatal : Unknown option 'undefined' make[2]: *** [CMakeFiles/gpuRIR_bind.dir/cmake_device_link.o] Error 1 make[1]: *** [CMakeFiles/gpuRIR_bind.dir/all] Error 2 make: *** [all] Error 2 Traceback (most recent call last): File "setup.py", line 86, in <module> "Operating System :: OS Independent", File "/usr/local/lib/python2.7/site-packages/setuptools/__init__.py", line 140, in setup return distutils.core.setup(**attrs) File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup dist.run_commands() File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands self.run_command(cmd) File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/local/lib/python2.7/site-packages/setuptools/command/install.py", line 67, in run self.do_egg_install() File "/usr/local/lib/python2.7/site-packages/setuptools/command/install.py", line 109, in do_egg_install self.run_command('bdist_egg') File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command self.distribution.run_command(command) File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/local/lib/python2.7/site-packages/setuptools/command/bdist_egg.py", line 172, in run cmd = self.call_command('install_lib', warn_dir=0) File "/usr/local/lib/python2.7/site-packages/setuptools/command/bdist_egg.py", line 158, in call_command self.run_command(cmdname) File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command self.distribution.run_command(command) File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/local/lib/python2.7/site-packages/setuptools/command/install_lib.py", line 11, in run self.build() File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/install_lib.py", line 111, in build self.run_command('build_ext') File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command self.distribution.run_command(command) File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "setup.py", line 37, in run self.build_extension(ext) File "setup.py", line 62, in build_extension subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp) File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 190, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j2']' returned non-zero exit status 2

Thanks in advance :)

How to simulate direct-path rir with gpuRIR

Hello, I'm working on de-reverbration, and trying to use gpuRIR to simulate the reverberant rir and direct-path rir. I know how to simulate reverberant one, but don't know how to simulate direct-path rir (given an RT60=0 reports an error).

The difference of RIRs between gpuRIR and rir-generator

Hi,

When I use example.py to generate some RIRs, I also create some through rir-generator with the same environment. The code is:
rir_generator.generate(c=343, fs=fs, r=pos_rcv[0], s=pos_src[0], L=room_sz, reverberation_time=T60)
and I plot two figures. To analysis, only first 500 points are shown.
image
Note that some early reflections have the same amplitude but the reverse value. I don't know if I make some mistakes when using these two methods or if some parameters are used incorrectly.

Thank you for your answering

CUDA version error while Installing

Hello,
While installing I am getting the NVCC fatal error which shows "unsupported gpu architecture 'compute_30'"
The detailed error is:

running install
running bdist_egg
running egg_info
writing gpuRIR.egg-info/PKG-INFO
writing dependency_links to gpuRIR.egg-info/dependency_links.txt
writing top-level names to gpuRIR.egg-info/top_level.txt
reading manifest file 'gpuRIR.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
writing manifest file 'gpuRIR.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
-- pybind11 v2.2.0
-- Configuring done
-- Generating done
-- Build files have been written to: /home/gol/gpuRIR/build/temp.linux-x86_64-3.9
[ 20%] Building CUDA object CMakeFiles/gpuRIRcu.dir/src/gpuRIR_cuda.cu.o
nvcc fatal : Unsupported gpu architecture 'compute_30'
gmake[2]: *** [CMakeFiles/gpuRIRcu.dir/build.make:63: CMakeFiles/gpuRIRcu.dir/src/gpuRIR_cuda.cu.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/gpuRIRcu.dir/all] Error 2
gmake: *** [Makefile:84: all] Error 2
Traceback (most recent call last):
File "/home/gol/gpuRIR/setup.py", line 67, in
setup(
File "/home/gol/anaconda3/lib/python3.9/site-packages/setuptools/init.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/home/gol/anaconda3/lib/python3.9/distutils/core.py", line 148, in setup
dist.run_commands()
File "/home/gol/anaconda3/lib/python3.9/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/home/gol/anaconda3/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/gol/anaconda3/lib/python3.9/site-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "/home/gol/anaconda3/lib/python3.9/site-packages/setuptools/command/install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "/home/gol/anaconda3/lib/python3.9/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/gol/anaconda3/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/gol/anaconda3/lib/python3.9/site-packages/setuptools/command/bdist_egg.py", line 164, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "/home/gol/anaconda3/lib/python3.9/site-packages/setuptools/command/bdist_egg.py", line 150, in call_command
self.run_command(cmdname)
File "/home/gol/anaconda3/lib/python3.9/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/gol/anaconda3/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/gol/anaconda3/lib/python3.9/site-packages/setuptools/command/install_lib.py", line 11, in run
self.build()
File "/home/gol/anaconda3/lib/python3.9/distutils/command/install_lib.py", line 107, in build
self.run_command('build_ext')
File "/home/gol/anaconda3/lib/python3.9/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/gol/anaconda3/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/gol/gpuRIR/setup.py", line 37, in run
self.build_extension(ext)
File "/home/gol/gpuRIR/setup.py", line 62, in build_extension
subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
File "/home/gol/anaconda3/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j2']' returned non-zero exit status 2.

Please let me know the work around for this

How to decide the direction of speaker and micphone when setting their patterions?

Hi, thanks for your great work!
I want to generate some precise RIRs, for example, the cardioid microphone array is pointed to the direction where a people exists, and this people back to the microphone array(so this people should be cardioid too). I don't know how to decide the direction of speaker and micphone when setting their patterions.
Thanks for your help!

an error occured when using gpuRIR.simulateTrajectory

Hi! Thank you for your awesome library. Currently, I am using gpuRIR in my code. However, when I generate my data, there always exists an error "cuFFT error: 5 /tmp/pip-req-build-y4n86nx1/src/gpuRIR_cuda.cu 978".
I am quite new to this library, could you please help me with this? Thank you so much!

install error [MinGW]

pip install https://github.com/DavidDiazGuerra/gpuRIR/zipball/master
Collecting https://github.com/DavidDiazGuerra/gpuRIR/zipball/master
Using cached https://github.com/DavidDiazGuerra/gpuRIR/zipball/master
Installing collected packages: gpuRIR
Running setup.py install for gpuRIR ... error
Complete output from command C:\Users\Never\Desktop\TAC-master\venv\Scripts\python.exe -u -c "import setuptools, tokenize;file='C:\Users\Never\AppData\Local\Temp\pip-req-build-7ze1k7yk\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\Never\AppData\Local\Temp\pip-record-l14xf53f\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\Never\Desktop\TAC-master\venv\include\site\python3.6\gpuRIR:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\gpuRIR
copying gpuRIR_init_.py -> build\lib.win-amd64-3.6\gpuRIR
running build_ext
-- Building for: NMake Makefiles
CMake Error at CMakeLists.txt:5 (project):
Generator

    NMake Makefiles

  does not support platform specification, but platform

    x64

  was specified.


CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CUDA_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/Never/AppData/Local/Temp/pip-req-build-7ze1k7yk/build/temp.win-amd64-3.6/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\Never\AppData\Local\Temp\pip-req-build-7ze1k7yk\setup.py", line 86, in <module>
    "Operating System :: OS Independent",
  File "C:\Users\Never\Desktop\TAC-master\venv\lib\site-packages\setuptools-40.8.0-py3.6.egg\setuptools\__init__.py", line 145, in setup
  File "D:\ProgramData\Anaconda3\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "D:\ProgramData\Anaconda3\lib\distutils\dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "D:\ProgramData\Anaconda3\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "C:\Users\Never\Desktop\TAC-master\venv\lib\site-packages\setuptools-40.8.0-py3.6.egg\setuptools\command\install.py", line 61, in run
  File "D:\ProgramData\Anaconda3\lib\distutils\command\install.py", line 545, in run
    self.run_command('build')
  File "D:\ProgramData\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "D:\ProgramData\Anaconda3\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "D:\ProgramData\Anaconda3\lib\distutils\command\build.py", line 135, in run
    self.run_command(cmd_name)
  File "D:\ProgramData\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "D:\ProgramData\Anaconda3\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "C:\Users\Never\AppData\Local\Temp\pip-req-build-7ze1k7yk\setup.py", line 37, in run
    self.build_extension(ext)
  File "C:\Users\Never\AppData\Local\Temp\pip-req-build-7ze1k7yk\setup.py", line 61, in build_extension
    subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
  File "D:\ProgramData\Anaconda3\lib\subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Never\\AppData\\Local\\Temp\\pip-req-build-7ze1k7yk', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Never\\AppData\\Local\\Temp\\pip-req-build-7ze1k7yk\\build\\lib.win-amd64-3.6', '-DPYTHON_EXECUTABLE=C:\\Users\\Never\\Desktop\\TAC-master\\venv\\Scripts\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Never\\AppData\\Local\\Temp\\pip-req-build-7ze1k7yk\\build\\lib.win-amd64-3.6', '-A', 'x64']' returned non-zero exit status 1.

Source and Receiver positions

Hello! Thanks for this very cool tool! I have a little question regarding the definition of the sound source and receiver positions. What is the coordinate origin that the source and receiver positions are with respect to?
I tried a room size of [3, 3, 2.5], a source position of [2, 2.9, 0.5], and a receiver position of [-2, 1, 0.5]. I thought there would be error in the simulation because the distance between the source and the receiver along the x-axis is 2-(-2) = 4, which is even larger than the room size in x direction, but the simulation still ran successfully and output a RIR which looks normal.
I'm a bit confused about this.. Is this a little error in the code? (init.py, line 142, line 143)
Thanks in advance.

ImportError: DLL load failed while importing gpuRIR_bind: The specified module could not be found.

Hi David,

I want to use the gpuRIR library to generate a dataset for doing beamforming. I successfully installed gpuRIR on my laptop, but I keep getting this error when I run the code. I have tried many solutions to similar errors, but I have not been able to solve this problem, and I have not seen anyone else encountering this error about the gpuRIR library on the Internet. Hope to get your help, thank you!

Regards
Xiao

Can gpurir run with multiprocessing?

I try to generate rir when training, but when I user torch.utils.data.DataLoaderto generate data, there is error :GPUassert: initialization error /data/tangyf/preprocess/gpuRIR-master/src/gpuRIR_cuda.cu 793. Even I set the tnum_workers to 1, the error still happen. But when I set num_workers to 0, no error happened.

The value range about input source.

When I ran simulate_trajectory.py using wavfile.read , which read the data as int16, I convolved the int16 data with the rir calculated by gpurir and then I used wavfile.write to write the output data. And I found that datas are all overflowed. When I normalize the value of input to [-1,1], the output was small . My microphone distance is 2.5cm, source to microphone distance is 10cm.

Do I need to normalize the input to [-1,1] before convolve with rir?

Bug in 'assert mic_pattern is "omni" or orV_rcv is not None'

when mic_pattern is loaded from a json file, and equals to 'omni', simulateRIR raises an exception:
Traceback (most recent call last): File "<string>", line 1, in <module> File "D:\ProgramData\Miniconda3\envs\torch\lib\site-packages\gpurir-1.2.0-py3.8-win-amd64.egg\gpuRIR\__init__.py", line 146, in simulateRIR assert mic_pattern is "omni" or orV_rcv is not None, "the mics are not omni but their orientation is undefined" AssertionError: the mics are not omni but their orientation is undefined

Maybe we can modify the code below
assert mic_pattern is "omni" or orV_rcv is not None
to
assert mic_pattern == "omni" or orV_rcv is not None
to avoid the bug.

from gpuRIR_bind import gpuRIR_bind ImportError: DLL load failed while importing gpuRIR_bind: The specified module could not be found

I've tried to install this package by both pip install and setup.py, and their generated files were different in envs/Lib/site-package/..., there's no gpuRIR_bind.py when installed by pip and the setup.py running logs were below:
I have just one GPU and I've imported torch before the gpuRIR but make no sense
btw, could you send me the site-package of gpuRIR directly?

D:\Anaconda3\envs\neural_srp-main\python.exe setup.py install
running install
D:\Anaconda3\envs\neural_srp-main\lib\site-packages\setuptools_distutils\cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

    ********************************************************************************
    Please avoid running ``setup.py`` directly.
    Instead, use pypa/build, pypa/installer or other
    standards-based tools.

    See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
    ********************************************************************************

!!
self.initialize_options()
D:\Anaconda3\envs\neural_srp-main\lib\site-packages\setuptools_distutils\cmd.py:66: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!

    ********************************************************************************
    Please avoid running ``setup.py`` and ``easy_install``.
    Instead, use pypa/build, pypa/installer or other
    standards-based tools.

    See https://github.com/pypa/setuptools/issues/917 for details.
    ********************************************************************************

!!
self.initialize_options()
running bdist_egg
running egg_info
writing gpuRIR.egg-info\PKG-INFO
writing dependency_links to gpuRIR.egg-info\dependency_links.txt
writing top-level names to gpuRIR.egg-info\top_level.txt
reading manifest file 'gpuRIR.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
writing manifest file 'gpuRIR.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
copying gpuRIR_init_.py -> build\lib.win-amd64-cpython-38\gpuRIR
running build_ext
setup.py:32: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
cmake_version = LooseVersion(re.search(r'version\s*([\d.]+)', out.decode()).group(1))
CMake Warning (dev) at CMakeLists.txt:6 (find_package):
Policy CMP0146 is not set: The FindCUDA module is removed. Run "cmake
--help-policy CMP0146" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:9 (include):
Policy CMP0146 is not set: The FindCUDA module is removed. Run "cmake
--help-policy CMP0146" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Deprecation Warning at third_party/pybind11/CMakeLists.txt:8 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.

CMake Deprecation Warning at third_party/pybind11/tools/pybind11Tools.cmake:8 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.
Call Stack (most recent call first):
third_party/pybind11/CMakeLists.txt:33 (include)

CMake Warning (dev) at third_party/pybind11/tools/FindPythonLibsNew.cmake:60 (find_package):
Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
are removed. Run "cmake --help-policy CMP0148" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
third_party/pybind11/tools/pybind11Tools.cmake:16 (find_package)
third_party/pybind11/CMakeLists.txt:33 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

-- pybind11 v2.2.0
-- Configuring done (3.2s)
CMake Warning (dev) in CMakeLists.txt:
Policy CMP0104 is not set: CMAKE_CUDA_ARCHITECTURES now detected for NVCC,
empty CUDA_ARCHITECTURES not allowed. Run "cmake --help-policy CMP0104"
for policy details. Use the cmake_policy command to set the policy and
suppress this warning.

CUDA_ARCHITECTURES is empty for target "gpuRIRcu".
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
Policy CMP0104 is not set: CMAKE_CUDA_ARCHITECTURES now detected for NVCC,
empty CUDA_ARCHITECTURES not allowed. Run "cmake --help-policy CMP0104"
for policy details. Use the cmake_policy command to set the policy and
suppress this warning.

CUDA_ARCHITECTURES is empty for target "gpuRIRcu".
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
Policy CMP0104 is not set: CMAKE_CUDA_ARCHITECTURES now detected for NVCC,
empty CUDA_ARCHITECTURES not allowed. Run "cmake --help-policy CMP0104"
for policy details. Use the cmake_policy command to set the policy and
suppress this warning.

CUDA_ARCHITECTURES is empty for target "gpuRIRcu".
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
Policy CMP0104 is not set: CMAKE_CUDA_ARCHITECTURES now detected for NVCC,
empty CUDA_ARCHITECTURES not allowed. Run "cmake --help-policy CMP0104"
for policy details. Use the cmake_policy command to set the policy and
suppress this warning.

CUDA_ARCHITECTURES is empty for target "gpuRIRcu".
This warning is for project developers. Use -Wno-dev to suppress it.

-- Generating done (0.0s)
-- Build files have been written to: D:/PyCharm/PycharmProjects/gpuRIR/build/temp.win-amd64-cpython-38/Release
������ .NET Framework MSBuild �汾 17.8.3+195e7f5a3

gpuRIRcu.vcxproj -> D:\PyCharm\PycharmProjects\gpuRIR\build\temp.win-amd64-cpython-38\Release\Release\gpuRIRcu.lib
gpuRIR_bind.vcxproj -> D:\PyCharm\PycharmProjects\gpuRIR\build\lib.win-amd64-cpython-38\gpuRIR_bind.cp38-win_amd64.pyd
creating build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\gpuRIR
copying build\lib.win-amd64-cpython-38\gpuRIR_init_.py -> build\bdist.win-amd64\egg\gpuRIR
copying build\lib.win-amd64-cpython-38\gpuRIR_bind.cp38-win_amd64.pyd -> build\bdist.win-amd64\egg
byte-compiling build\bdist.win-amd64\egg\gpuRIR_init_.py to init.cpython-38.pyc
creating stub loader for gpuRIR_bind.cp38-win_amd64.pyd
byte-compiling build\bdist.win-amd64\egg\gpuRIR_bind.py to gpuRIR_bind.cpython-38.pyc
creating build\bdist.win-amd64\egg\EGG-INFO
copying gpuRIR.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying gpuRIR.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying gpuRIR.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying gpuRIR.egg-info\not-zip-safe -> build\bdist.win-amd64\egg\EGG-INFO
copying gpuRIR.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
writing build\bdist.win-amd64\egg\EGG-INFO\native_libs.txt
creating 'dist\gpuRIR-1.2.0-py3.8-win-amd64.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing gpuRIR-1.2.0-py3.8-win-amd64.egg
creating d:\anaconda3\envs\neural_srp-main\lib\site-packages\gpuRIR-1.2.0-py3.8-win-amd64.egg
Extracting gpuRIR-1.2.0-py3.8-win-amd64.egg to d:\anaconda3\envs\neural_srp-main\lib\site-packages
Adding gpuRIR 1.2.0 to easy-install.pth file

Installed d:\anaconda3\envs\neural_srp-main\lib\site-packages\gpurir-1.2.0-py3.8-win-amd64.egg
Processing dependencies for gpuRIR==1.2.0
Finished processing dependencies for gpuRIR==1.2.0

and these are the generated files:
image
but the example.py still runs with this error:
屏幕截图 2024-01-11 231306

Installation failed on MACOS

When I try to run pip install https://github.com/DavidDiazGuerra/gpuRIR/zipball/master. I get the following errors although I have installed CMAKE

Collecting https://github.com/DavidDiazGuerra/gpuRIR/zipball/master
Using cached https://github.com/DavidDiazGuerra/gpuRIR/zipball/master
Preparing metadata (setup.py) ... done
Building wheels for collected packages: gpuRIR
Building wheel for gpuRIR (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [64 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-14.0-arm64-cpython-311
creating build/lib.macosx-14.0-arm64-cpython-311/gpuRIR
copying gpuRIR/init.py -> build/lib.macosx-14.0-arm64-cpython-311/gpuRIR
running build_ext
Traceback (most recent call last):
File "/private/var/folders/t2/qcdrdtq16v1d93n5hnwd7lkw0000gn/T/pip-req-build-4_fd8o24/setup.py", line 26, in run
out = subprocess.check_output(['cmake', '--version'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.11.8/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 466, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.11.8/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 548, in run
with Popen(*popenargs, **kwargs) as process:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.11.8/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1026, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/opt/homebrew/Cellar/[email protected]/3.11.8/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1953, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'cmake'

  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/private/var/folders/t2/qcdrdtq16v1d93n5hnwd7lkw0000gn/T/pip-req-build-4_fd8o24/setup.py", line 67, in <module>
      setup(
    File "/opt/homebrew/lib/python3.11/site-packages/setuptools/__init__.py", line 103, in setup
      return distutils.core.setup(**attrs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/opt/homebrew/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
      return run_commands(dist)
             ^^^^^^^^^^^^^^^^^^
    File "/opt/homebrew/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
      dist.run_commands()
    File "/opt/homebrew/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/opt/homebrew/lib/python3.11/site-packages/setuptools/dist.py", line 963, in run_command
      super().run_command(command)
    File "/opt/homebrew/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/opt/homebrew/lib/python3.11/site-packages/wheel/bdist_wheel.py", line 368, in run
      self.run_command("build")
    File "/opt/homebrew/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "/opt/homebrew/lib/python3.11/site-packages/setuptools/dist.py", line 963, in run_command
      super().run_command(command)
    File "/opt/homebrew/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/opt/homebrew/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 131, in run
      self.run_command(cmd_name)
    File "/opt/homebrew/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "/opt/homebrew/lib/python3.11/site-packages/setuptools/dist.py", line 963, in run_command
      super().run_command(command)
    File "/opt/homebrew/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/private/var/folders/t2/qcdrdtq16v1d93n5hnwd7lkw0000gn/T/pip-req-build-4_fd8o24/setup.py", line 28, in run
      raise RuntimeError("CMake must be installed to build the following extensions: " +
  RuntimeError: CMake must be installed to build the following extensions: gpuRIR_bind
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for gpuRIR
Running setup.py clean for gpuRIR
Failed to build gpuRIR
ERROR: Could not build wheels for gpuRIR, which is required to install pyproject.toml-based projects

The cuda

My env is Ubuntu 20.04. 3090Ti and CUDA 12.1.When I run the gpuRIR ,it occurs.

  File "./ROOMA.py", line 12, in <module>
    import gpuRIR
  File "/home/tutti/anaconda3/envs/GPURIR/lib/python3.6/site-packages/gpuRIR-1.2.0-py3.6-linux-x86_64.egg/gpuRIR/__init__.py", line 9, in <module>
    from gpuRIR_bind import gpuRIR_bind
ImportError: /home/tutti/anaconda3/envs/GPURIR/lib/python3.6/site-packages/gpuRIR-1.2.0-py3.6-linux-x86_64.egg/gpuRIR_bind.cpython-36m-x86_64-linux-gnu.so: undefined symbol: cufftExecC2R```

gpuRIR.beta_SabineEstimation is not consistent with RIR-Generator

For room_sz = [6.98986182, 7.65234006, 3.58826744], RT60 = 0.14357507, RIR-Generator returns

"Error: The reflection coefficients cannot be calculated using the current room parameters, i.e. room size and reverberation time.
Please specify the reflection coefficients or change the room parameters."

While, gpuRIR.beta_SabineEstimation(room_sz, RT60) returns [0., 0., 0., 0., 0., 0.].

I don't know if gpuRIR.beta_SabineEstimation gave the right results, or [0., 0., 0., 0., 0., 0.] is a sign of error.

Code of matlab for testing RIR-Generator:

c = 340;                    % Sound velocity (m/s)
fs = 16000;                 % Sample frequency (samples/s)
r = [5.30233645, 3.80691334, 1.7705954];              % Receiver position [x y z] (m)
s = [2.93155193, 6.25306989, 0.86049909];              % Source position [x y z] (m)
L = [6.98986182, 7.65234006, 3.58826744];                % Room dimensions [x y z] (m)

beta = 0.14357507;                 % Reverberation time (s)
n = 4096;                   % Number of samples

h = rir_generator(c, fs, r, s, L, beta, n);

CPU version

Thank you for creating great library.
Would you support the CPU implementation in this library? It's not necessary, but I think more useful for comparing the performance, for example.

Bug in "beta_SabineEstimation" when given optional parameter abs_weights

Hi,

It seems that the function will return incorrect beta value when abs_weights is given and the maximum is not 1.0.

As in the sub-function t60error, abs_weights is normalized, the return of beta_SabineEstimation should be consistent with that and be np.sqrt(1 - result.x * abs_weights/ np.array(abs_weights).max() ).astype(np.float32) instead (See line 54. gpuRIR.init.py).

Otherwise the beta value computed will be higher that the actual one.

Kind regards,

Nelson

position

Is the center the coordinate of origin?

simulated rir values are not fixed?

Hi! Thanks for the great work. After trying some examples, I found that the exact same python scripts don't give same simulated rirs. I attached the code block down below, please take a look.

Is this normal behavior of the package?
Input

import gpuRIR
gpuRIR.activateMixedPrecision(False)
gpuRIR.activateLUT(True)

import numpy as np
import numpy.matlib
import pandas as pd
import random

room_sz = [3,3,2.5]  # Size of the room [m]
nb_src = 1  # Number of sources
pos_src = np.array([[1,2.9,0.5]]) # Positions of the sources ([m]
nb_rcv = 1 # Number of receivers
pos_rcv = np.array([[0.5,1,0.5]])	 # Position of the receivers [m]
orV_rcv = np.matlib.repmat(np.array([0,1,0]), nb_rcv, 1) # Vectors pointing in the same direction than the receivers
mic_pattern = "card" # Receiver polar pattern
abs_weights = [0.9]*5+[0.5] # Absortion coefficient ratios of the walls
T60 = 1.0	 # Time for the RIR to reach 60dB of attenuation [s]
att_diff = 15.0	# Attenuation when start using the diffuse reverberation model [dB]
att_max = 60.0 # Attenuation at the end of the simulation [dB]
fs=16000.0 # Sampling frequency [Hz]

beta = gpuRIR.beta_SabineEstimation(room_sz, T60, abs_weights=abs_weights) # Reflection coefficients
Tdiff= gpuRIR.att2t_SabineEstimator(att_diff, T60) # Time to start the diffuse reverberation model [s]
Tmax = gpuRIR.att2t_SabineEstimator(att_max, T60)	 # Time to stop the simulation [s]
nb_img = gpuRIR.t2n( Tdiff, room_sz )	# Number of image sources in each dimension

RIRs = gpuRIR.simulateRIR(room_sz, beta, pos_src, pos_rcv, nb_img, Tmax, fs, Tdiff=Tdiff, orV_rcv=orV_rcv, mic_pattern=mic_pattern)
RIRs2 = gpuRIR.simulateRIR(room_sz, beta, pos_src, pos_rcv, nb_img, Tmax, fs, Tdiff=Tdiff, orV_rcv=orV_rcv, mic_pattern=mic_pattern)
RIRs3 = gpuRIR.simulateRIR(room_sz, beta, pos_src, pos_rcv, nb_img, Tmax, fs, Tdiff=Tdiff, orV_rcv=orV_rcv, mic_pattern=mic_pattern)

print(RIRs)
print(RIRs2)
print(RIRs3)

Output

[[[ 0.0000000e+00  0.0000000e+00  0.0000000e+00 ... -5.4983880e-06
   -4.3508267e-06 -3.1973832e-05]]]
[[[ 0.0000000e+00  0.0000000e+00  0.0000000e+00 ... -1.1684125e-05
    7.6331999e-06  4.2453180e-06]]]
[[[ 0.0000000e+00  0.0000000e+00  0.0000000e+00 ...  8.7333092e-06
   -1.1309399e-05  5.8924693e-06]]]

error when run example.py

After I install gpurir successfully, I tried to run example.py. An error came out, which is miniconda3/envs/crn_train/lib/python3.9/site-packages/gpuRIR-1.2.0-py3.9-linux-x86_64.egg/gpuRIR_bind.cpython-39-x86_64-linux-gnu.so: undefined symbol: cufftExecC2R . How can I solve this problem?

Compute30 is deprecated for nvcc 530

Hi :)
hope you are doing well.
Just mentioning the library was failing when compiled for drivers version 530.

cuda_select_nvcc_arch_flags(CUDA_ARCH_FLAGS Common) # Change Common by Auto for autodetect

  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [82 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-310
      creating build/lib.linux-x86_64-cpython-310/gpuRIR
      copying gpuRIR/__init__.py -> build/lib.linux-x86_64-cpython-310/gpuRIR
      running build_ext
      -- The CXX compiler identification is GNU 9.4.0
      -- The CUDA compiler identification is NVIDIA 12.2.91
      -- Check for working CXX compiler: /usr/bin/c++
      -- Check for working CXX compiler: /usr/bin/c++ -- works
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Check for working CUDA compiler: /usr/local/cuda-12.2/bin/nvcc
      -- Check for working CUDA compiler: /usr/local/cuda-12.2/bin/nvcc -- works
      -- Detecting CUDA compiler ABI info
      -- Detecting CUDA compiler ABI info - done
      -- Looking for C++ include pthread.h
      -- Looking for C++ include pthread.h - found
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
      -- Looking for pthread_create in pthreads
      -- Looking for pthread_create in pthreads - not found
      -- Looking for pthread_create in pthread
      -- Looking for pthread_create in pthread - found
      -- Found Threads: TRUE
      -- Found CUDA: /usr/local/cuda-12.2 (found version "12.2")
      -- Found PythonInterp: /home/jmt/.mlflow/envs/mlflow-dea84f7f3ec804ae1d7f6843ff7170c9178c7aab/bin/python (found version "3.10.6")
      -- Found PythonLibs: /home/jmt/.pyenv/versions/3.10.6/lib/libpython3.10.so
      -- pybind11 v2.2.0
      -- Configuring done
      -- Generating done
      -- Build files have been written to: /tmp/pip-req-build-vck4k6y4/build/temp.linux-x86_64-cpython-310
      Scanning dependencies of target gpuRIRcu
      [ 25%] Building CUDA object CMakeFiles/gpuRIRcu.dir/src/gpuRIR_cuda.cu.o
      nvcc fatal   : Unsupported gpu architecture 'compute_30'

I imagine nvidia deprecated support for that generation. Just letting you know in case you can manager what is considered as "Common".
It can be easily patched by switching from Common to Auto.

'GPUassert: unknown error' (gpuRIR_cuda.cu line 1002) when importing the module

Hello,

I have a strange problem while importing the gpuRIR library: (simply calling python -c "import gpuRIR").
Indeed, I get the following error:
GPUassert: unknown error /home/gaetan/inria/repo/rir_simulation/gpuRIR/src/gpuRIR_cuda.cu 1002

This only happens on one of my machine:
GPUs: GTX 1070 and GTX 1080
OS: Arch Linux
Python version: same behavious with both 3.7 and 3.9
Cuda version: 11.2
Nvidia driver: 460.56

The error does not occur on my other machine:
GPU: Quadro RTX4000
OS: Ubuntu 18.04
Python version: works with both 3.7 and 3.8
Cuda version: 11.2
Nvidia driver: 460.56

Do you have an idea where this problem could be coming from ?

gpuRIR install error

Hi David,
Thanks for your write back.This is my all logs.

C:\Users\admin.conda\envs\DeepLearning36\lib\site-packages\pkg_resources_init_.py:119: PkgResourcesDeprecationWarning: R2017b is an invalid version and will not be supported in a future release
PkgResourcesDeprecationWarning,
running bdist_egg
running egg_info
writing gpuRIR.egg-info\PKG-INFO
writing dependency_links to gpuRIR.egg-info\dependency_links.txt
writing top-level names to gpuRIR.egg-info\top_level.txt
reading manifest file 'gpuRIR.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
writing manifest file 'gpuRIR.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044.
-- pybind11 v2.2.0
-- Configuring done
CMake Warning (dev) in CMakeLists.txt:
Policy CMP0104 is not set: CMAKE_CUDA_ARCHITECTURES now detected for NVCC,
empty CUDA_ARCHITECTURES not allowed. Run "cmake --help-policy CMP0104"
for policy details. Use the cmake_policy command to set the policy and
suppress this warning.

CUDA_ARCHITECTURES is empty for target "gpuRIRcu".
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
Policy CMP0104 is not set: CMAKE_CUDA_ARCHITECTURES now detected for NVCC,
empty CUDA_ARCHITECTURES not allowed. Run "cmake --help-policy CMP0104"
for policy details. Use the cmake_policy command to set the policy and
suppress this warning.

CUDA_ARCHITECTURES is empty for target "gpuRIRcu".
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
Policy CMP0104 is not set: CMAKE_CUDA_ARCHITECTURES now detected for NVCC,
empty CUDA_ARCHITECTURES not allowed. Run "cmake --help-policy CMP0104"
for policy details. Use the cmake_policy command to set the policy and
suppress this warning.

CUDA_ARCHITECTURES is empty for target "gpuRIRcu".
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
Policy CMP0104 is not set: CMAKE_CUDA_ARCHITECTURES now detected for NVCC,
empty CUDA_ARCHITECTURES not allowed. Run "cmake --help-policy CMP0104"
for policy details. Use the cmake_policy command to set the policy and
suppress this warning.

CUDA_ARCHITECTURES is empty for target "gpuRIRcu".
This warning is for project developers. Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: D:/sound source localization/icoDOA-master/gpuRIR/build/temp.win-amd64-3.6/Release
用于 .NET Framework 的 Microsoft (R) 生成引擎版本 16.11.2+f32259642
版权所有(C) Microsoft Corporation。保留所有权利。

Compiling CUDA source file ......\src\gpuRIR_cuda.cu...

(DeepLearning36) D:\sound source localization\icoDOA-master\gpuRIR\build\temp.win-amd64-3.6\Release>"C:\Program Files
\NVIDIA GPU Computing Toolkit\CUDA\v11.1\bin\nvcc.exe" -gencode=arch=compute_53,code="sm_53,compute_53" -gencode=ar
ch=compute_60,code="sm_60,compute_60" -gencode=arch=compute_61,code="sm_61,compute_61" -gencode=arch=compute_70,c
ode="sm_70,compute_70" -gencode=arch=compute_75,code="sm_75,compute_75" -gencode=arch=compute_80,code="sm_80,com
pute_80" -gencode=arch=compute_86,code="sm_86,compute_86" -gencode=arch=compute_86,code="compute_86,compute_86"
--use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\H
ostX64\x64" -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\include" --keep-dir x64\Release
-maxrregcount=0 --machine 64 --compile -cudart static -std=c++14 -Xcompiler="/EHsc -Ob2" -D_WINDOWS -D_FORCE_INLI
NES -DNDEBUG -D"CMAKE_INTDIR="Release"" -D_MBCS -D"CMAKE_INTDIR="Release"" -Xcompiler "/EHsc /W3 /nologo /O2 /Fd"
D:\sound source localization\icoDOA-master\gpuRIR\build\temp.win-amd64-3.6\Release\Release\gpuRIRcu.pdb" /FS /MD /G
R" -o gpuRIRcu.dir\Release\gpuRIR_cuda.obj "D:\sound source localization\icoDOA-master\gpuRIR\src\gpuRIR_cuda.cu"
nvcc fatal : A single input file is required for a non-link phase when an outputfile is specified
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\CUDA 11.1.t
argets(785,9): error MSB3721: 命令“"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\bin\nvcc.exe" -gencode=arch=
compute_53,code="sm_53,compute_53" -gencode=arch=compute_60,code="sm_60,compute_60" -gencode=arch=compute_61,code=
"sm_61,compute_61" -gencode=arch=compute_70,code="sm_70,compute_70" -gencode=arch=compute_75,code="sm_75,compute_75
" -gencode=arch=compute_80,code="sm_80,compute_80" -gencode=arch=compute_86,code="sm_86,compute_86" -gencode=arch=
compute_86,code="compute_86,compute_86" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2019\C
ommunity\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64" -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.
1\include" --keep-dir x64\Release -maxrregcount=0 --machine 64 --compile -cudart static -std=c++14 -Xcompiler="/EH
sc -Ob2" -D_WINDOWS -D_FORCE_INLINES -DNDEBUG -D"CMAKE_INTDIR="Release"" -D_MBCS -D"CMAKE_INTDIR="Release"" -Xco
mpiler "/EHsc /W3 /nologo /O2 /Fd"D:\sound source localization\icoDOA-master\gpuRIR\build\temp.win-amd64-3.6\Release\Re
lease\gpuRIRcu.pdb" /FS /MD /GR" -o gpuRIRcu.dir\Release\gpuRIR_cuda.obj "D:\sound source localization\icoDOA-master
gpuRIR\src\gpuRIR_cuda.cu"”已退出,返回代码为 1。 [D:\sound source localization\icoDOA-master\gpuRIR\build\temp.win-amd64-3.6\Rel
ease\gpuRIRcu.vcxproj]
Traceback (most recent call last):
File "setup.py", line 86, in
"Operating System :: OS Independent",
File "C:\Users\admin.conda\envs\DeepLearning36\lib\site-packages\setuptools_init_.py", line 153, in setup
return distutils.core.setup(**attrs)
File "C:\Users\admin.conda\envs\DeepLearning36\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\admin.conda\envs\DeepLearning36\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Users\admin.conda\envs\DeepLearning36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\admin.conda\envs\DeepLearning36\lib\site-packages\setuptools\command\install.py", line 74, in run
self.do_egg_install()
File "C:\Users\admin.conda\envs\DeepLearning36\lib\site-packages\setuptools\command\install.py", line 116, in do_egg_install
self.run_command('bdist_egg')
File "C:\Users\admin.conda\envs\DeepLearning36\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\admin.conda\envs\DeepLearning36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\admin.conda\envs\DeepLearning36\lib\site-packages\setuptools\command\bdist_egg.py", line 164, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "C:\Users\admin.conda\envs\DeepLearning36\lib\site-packages\setuptools\command\bdist_egg.py", line 150, in call_command
self.run_command(cmdname)
File "C:\Users\admin.conda\envs\DeepLearning36\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\admin.conda\envs\DeepLearning36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\admin.conda\envs\DeepLearning36\lib\site-packages\setuptools\command\install_lib.py", line 11, in run
self.build()
File "C:\Users\admin.conda\envs\DeepLearning36\lib\distutils\command\install_lib.py", line 107, in build
self.run_command('build_ext')
File "C:\Users\admin.conda\envs\DeepLearning36\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\admin.conda\envs\DeepLearning36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "setup.py", line 37, in run
self.build_extension(ext)
File "setup.py", line 62, in build_extension
subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
File "C:\Users\admin.conda\envs\DeepLearning36\lib\subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '/m']' returned non-zero exit status 1.

Installation failed

I tried to install gpurir by cloning the repository and running python setup.py install in an activated anaconda environment. Than error happened:
`running install
/home/tungyu/anaconda3/envs/ambi/lib/python3.7/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
setuptools.SetuptoolsDeprecationWarning,
/home/tungyu/anaconda3/envs/ambi/lib/python3.7/site-packages/setuptools/command/easy_install.py:147: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
EasyInstallDeprecationWarning,
running bdist_egg
running egg_info
creating gpuRIR.egg-info
writing gpuRIR.egg-info/PKG-INFO
writing dependency_links to gpuRIR.egg-info/dependency_links.txt
writing top-level names to gpuRIR.egg-info/top_level.txt
writing manifest file 'gpuRIR.egg-info/SOURCES.txt'
reading manifest file 'gpuRIR.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
writing manifest file 'gpuRIR.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.linux-x86_64-cpython-37
creating build/lib.linux-x86_64-cpython-37/gpuRIR
copying gpuRIR/init.py -> build/lib.linux-x86_64-cpython-37/gpuRIR
running build_ext
-- The CXX compiler identification is GNU 7.5.0
CMake Error at /home/tungyu/anaconda3/envs/ambi/lib/python3.7/site-packages/cmake/data/share/cmake-3.27/Modules/CMakeDetermineCUDACompiler.cmake:180 (message):
Failed to find nvcc.

Compiler requires the CUDA toolkit. Please set the CUDAToolkit_ROOT
variable.
Call Stack (most recent call first):
CMakeLists.txt:5 (project)

-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
File "setup.py", line 86, in
"Operating System :: OS Independent",
File "/home/tungyu/anaconda3/envs/ambi/lib/python3.7/site-packages/setuptools/init.py", line 87, in setup
return distutils.core.setup(**attrs)
File "/home/tungyu/anaconda3/envs/ambi/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
File "/home/tungyu/anaconda3/envs/ambi/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/home/tungyu/anaconda3/envs/ambi/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/home/tungyu/anaconda3/envs/ambi/lib/python3.7/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/home/tungyu/anaconda3/envs/ambi/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/home/tungyu/anaconda3/envs/ambi/lib/python3.7/site-packages/setuptools/command/install.py", line 74, in run
self.do_egg_install()
File "/home/tungyu/anaconda3/envs/ambi/lib/python3.7/site-packages/setuptools/command/install.py", line 123, in do_egg_install
self.run_command('bdist_egg')
File "/home/tungyu/anaconda3/envs/ambi/lib/python3.7/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/home/tungyu/anaconda3/envs/ambi/lib/python3.7/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/home/tungyu/anaconda3/envs/ambi/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/home/tungyu/anaconda3/envs/ambi/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 165, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "/home/tungyu/anaconda3/envs/ambi/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 151, in call_command
self.run_command(cmdname)
File "/home/tungyu/anaconda3/envs/ambi/lib/python3.7/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/home/tungyu/anaconda3/envs/ambi/lib/python3.7/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/home/tungyu/anaconda3/envs/ambi/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/home/tungyu/anaconda3/envs/ambi/lib/python3.7/site-packages/setuptools/command/install_lib.py", line 11, in run
self.build()
File "/home/tungyu/anaconda3/envs/ambi/lib/python3.7/site-packages/setuptools/_distutils/command/install_lib.py", line 112, in build
self.run_command('build_ext')
File "/home/tungyu/anaconda3/envs/ambi/lib/python3.7/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/home/tungyu/anaconda3/envs/ambi/lib/python3.7/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/home/tungyu/anaconda3/envs/ambi/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "setup.py", line 37, in run
self.build_extension(ext)
File "setup.py", line 61, in build_extension
subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
File "/home/tungyu/anaconda3/envs/ambi/lib/python3.7/subprocess.py", line 363, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/home/tungyu/Project/gpuRIR/gpuRIR', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/tungyu/Project/gpuRIR/gpuRIR/build/lib.linux-x86_64-cpython-37', '-DPYTHON_EXECUTABLE=/home/tungyu/anaconda3/envs/ambi/bin/python', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
(ambi) root@tungyu-1080:/home/tungyu/Project/gpuRIR/gpuRIR# bash --version
GNU bash, version 4.4.20(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
(ambi) root@tungyu-1080:/home/tungyu/Project/gpuRIR/gpuRIR# make --version
GNU Make 4.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
`
The os system is Ubuntu18.04.

Installation Problems

Hi, I'm getting the following error when I do pip setup.y install. I'm using the ubuntu system. And I installed cudatoolkit (version 10.2.89) and don't know how to fix this.
running build_ext
-- The CXX compiler identification is GNU 5.4.0
-- The CUDA compiler identification is unknown
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:5 (project):
No CMAKE_CUDA_COMPILER could be found.

Tell CMake where to find the compiler by setting either the environment
variable "CUDACXX" or the CMake cache entry CMAKE_CUDA_COMPILER to the full
path to the compiler, or to the compiler name if it is in the PATH.

-- Configuring incomplete, errors occurred!
See also "/data/zhouxiaolong/TF-FaSNet/gpuRIR-master/gpuRIR-master/build/temp.linux-x86_64-cpython-37/CMakeFiles/CMakeOutput.log".
See also "/data/zhouxiaolong/TF-FaSNet/gpuRIR-master/gpuRIR-master/build/temp.linux-x86_64-cpython-37/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
File "setup.py", line 86, in
"Operating System :: OS Independent",
File "/data/zhouxiaolong/miniconda3/envs/TF_FaSNet/lib/python3.7/site-packages/setuptools/init.py", line 87, in setup
return distutils.core.setup(**attrs)
File "/data/zhouxiaolong/miniconda3/envs/TF_FaSNet/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
File "/data/zhouxiaolong/miniconda3/envs/TF_FaSNet/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/data/zhouxiaolong/miniconda3/envs/TF_FaSNet/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/data/zhouxiaolong/miniconda3/envs/TF_FaSNet/lib/python3.7/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/data/zhouxiaolong/miniconda3/envs/TF_FaSNet/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/data/zhouxiaolong/miniconda3/envs/TF_FaSNet/lib/python3.7/site-packages/setuptools/command/install.py", line 74, in run
self.do_egg_install()
File "/data/zhouxiaolong/miniconda3/envs/TF_FaSNet/lib/python3.7/site-packages/setuptools/command/install.py", line 123, in do_egg_install
self.run_command('bdist_egg')
File "/data/zhouxiaolong/miniconda3/envs/TF_FaSNet/lib/python3.7/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/data/zhouxiaolong/miniconda3/envs/TF_FaSNet/lib/python3.7/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/data/zhouxiaolong/miniconda3/envs/TF_FaSNet/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/data/zhouxiaolong/miniconda3/envs/TF_FaSNet/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 165, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "/data/zhouxiaolong/miniconda3/envs/TF_FaSNet/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 151, in call_command
self.run_command(cmdname)
File "/data/zhouxiaolong/miniconda3/envs/TF_FaSNet/lib/python3.7/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/data/zhouxiaolong/miniconda3/envs/TF_FaSNet/lib/python3.7/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/data/zhouxiaolong/miniconda3/envs/TF_FaSNet/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/data/zhouxiaolong/miniconda3/envs/TF_FaSNet/lib/python3.7/site-packages/setuptools/command/install_lib.py", line 11, in run
self.build()
File "/data/zhouxiaolong/miniconda3/envs/TF_FaSNet/lib/python3.7/site-packages/setuptools/_distutils/command/install_lib.py", line 112, in build
self.run_command('build_ext')
File "/data/zhouxiaolong/miniconda3/envs/TF_FaSNet/lib/python3.7/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/data/zhouxiaolong/miniconda3/envs/TF_FaSNet/lib/python3.7/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/data/zhouxiaolong/miniconda3/envs/TF_FaSNet/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "setup.py", line 37, in run
self.build_extension(ext)
File "setup.py", line 61, in build_extension
subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
File "/data/zhouxiaolong/miniconda3/envs/TF_FaSNet/lib/python3.7/subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/data/zhouxiaolong/TF-FaSNet/gpuRIR-master/gpuRIR-master', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/data/zhouxiaolong/TF-FaSNet/gpuRIR-master/gpuRIR-master/build/lib.linux-x86_64-cpython-37', '-DPYTHON_EXECUTABLE=/data/zhouxiaolong/miniconda3/envs/TF_FaSNet/bin/python', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.

GPUassert: invalid configuration argument

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

ImportError: DLL load failed while importing gpuRIR_bind: The specified module could not be found.

I am installing using the setup.py script.
I can see it do not find any CUDA_ARCHITECTURES. It is installed and I have checked the paths,
nvcc C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\bin
CUDA_PATH C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1
CUDA_PATH_V12_1 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1
is set correctly.
Any ideas what I could do?

>python setup.py install
running install
running bdist_egg
running egg_info
writing gpuRIR.egg-info\PKG-INFO
writing dependency_links to gpuRIR.egg-info\dependency_links.txt
writing top-level names to gpuRIR.egg-info\top_level.txt
adding license file 'LICENSE' (matched pattern 'LICEN[CS]E*')
reading manifest file 'gpuRIR.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'gpuRIR.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.
-- pybind11 v2.2.0
-- Configuring done (1.9s)
CMake Warning (dev) in CMakeLists.txt:
  Policy CMP0104 is not set: CMAKE_CUDA_ARCHITECTURES now detected for NVCC,
  empty CUDA_ARCHITECTURES not allowed.  Run "cmake --help-policy CMP0104"
  for policy details.  Use the cmake_policy command to set the policy and
  suppress this warning.

  CUDA_ARCHITECTURES is empty for target "gpuRIRcu".
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
  Policy CMP0104 is not set: CMAKE_CUDA_ARCHITECTURES now detected for NVCC,
  empty CUDA_ARCHITECTURES not allowed.  Run "cmake --help-policy CMP0104"
  for policy details.  Use the cmake_policy command to set the policy and
  suppress this warning.

  CUDA_ARCHITECTURES is empty for target "gpuRIRcu".
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
  Policy CMP0104 is not set: CMAKE_CUDA_ARCHITECTURES now detected for NVCC,
  empty CUDA_ARCHITECTURES not allowed.  Run "cmake --help-policy CMP0104"
  for policy details.  Use the cmake_policy command to set the policy and
  suppress this warning.

  CUDA_ARCHITECTURES is empty for target "gpuRIRcu".
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
  Policy CMP0104 is not set: CMAKE_CUDA_ARCHITECTURES now detected for NVCC,
  empty CUDA_ARCHITECTURES not allowed.  Run "cmake --help-policy CMP0104"
  for policy details.  Use the cmake_policy command to set the policy and
  suppress this warning.

  CUDA_ARCHITECTURES is empty for target "gpuRIRcu".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done (0.0s)
-- Build files have been written to: C:/Users/johan/icoDOA/gpuRIR/build/temp.win-amd64-3.8/Release
MSBuild version 17.5.1+f6fdcf537 for .NET Framework

  Checking Build System
  Building Custom Rule C:/Users/johan/icoDOA/gpuRIR/CMakeLists.txt
  gpuRIRcu.vcxproj -> C:\Users\johan\icoDOA\gpuRIR\build\temp.win-amd64-3.8\Release\Release\gpuRIRcu.lib
  Building Custom Rule C:/Users/johan/icoDOA/gpuRIR/CMakeLists.txt
  gpuRIR_bind.vcxproj -> C:\Users\johan\icoDOA\gpuRIR\build\lib.win-amd64-3.8\gpuRIR_bind.cp38-win_amd64.pyd
  Building Custom Rule C:/Users/johan/icoDOA/gpuRIR/CMakeLists.txt
creating build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\gpuRIR
copying build\lib.win-amd64-3.8\gpuRIR\__init__.py -> build\bdist.win-amd64\egg\gpuRIR
copying build\lib.win-amd64-3.8\gpuRIR_bind.cp38-win_amd64.pyd -> build\bdist.win-amd64\egg
byte-compiling build\bdist.win-amd64\egg\gpuRIR\__init__.py to __init__.cpython-38.pyc
creating stub loader for gpuRIR_bind.cp38-win_amd64.pyd
byte-compiling build\bdist.win-amd64\egg\gpuRIR_bind.py to gpuRIR_bind.cpython-38.pyc
creating build\bdist.win-amd64\egg\EGG-INFO
copying gpuRIR.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying gpuRIR.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying gpuRIR.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying gpuRIR.egg-info\not-zip-safe -> build\bdist.win-amd64\egg\EGG-INFO
copying gpuRIR.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
writing build\bdist.win-amd64\egg\EGG-INFO\native_libs.txt
creating 'dist\gpuRIR-1.2.0-py3.8-win-amd64.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing gpuRIR-1.2.0-py3.8-win-amd64.egg
removing 'c:\users\johan\appdata\local\programs\python\python38\lib\site-packages\gpuRIR-1.2.0-py3.8-win-amd64.egg' (and everything under it)
creating c:\users\johan\appdata\local\programs\python\python38\lib\site-packages\gpuRIR-1.2.0-py3.8-win-amd64.egg
Extracting gpuRIR-1.2.0-py3.8-win-amd64.egg to c:\users\johan\appdata\local\programs\python\python38\lib\site-packages
gpuRIR 1.2.0 is already the active version in easy-install.pth

Installed c:\users\johan\appdata\local\programs\python\python38\lib\site-packages\gpurir-1.2.0-py3.8-win-amd64.egg
Processing dependencies for gpuRIR==1.2.0
Finished processing dependencies for gpuRIR==1.2.0

Source Directivity

Hi David

Thank you for this great library! Do you have plans to include the directivity of the sources in the library? Would it even be possible to add them to your library?

Two source audios from different directions?

Here is my confusion. I am testing my beamforming algorithm on a dual-mic array. I intend to generate wavs including two source audios playing simultaneously from different directions. I set the pos_src as the coordinates of the two sources audio and got an RIR array of shape (2, 2, rir_len). But how should I do with simulateTrajectory to feed two different audios channels into it? Or did I misunderstand the meaning of pos_src?

question for orV_rcv configuration

I have question to configure card recv.

for calculate amp, it use related vector of source and recv position vec[d] = clust_pos[d] + (1-2*rflx_idx[d]) * sh_pos_src[m_src*3+d] - sh_pos_rcv[m_rcv*3+d];

so I'm confusing when I set up cardiac microphone as below,

room_sz = [8,8,8]
nb_src = 1  # Number of sources
pos_src = np.array([ [1,1,0.5] ]) # Positions of the source  [x,y,z position] 
nb_rcv = 5 # Number of receivers
pos_rcv = np.array([ [4,4,1.5], [4,4,1.5], [4,4,1.5], [4,4,1.5], [4,4,1.5]   ] )	 # same position  [m] [x,y,z] position

how to configure the orV base on clockwise(north direction) ?
for example, 0 degree, 45 degree, 90 degree(north direction), 135 degree and 180 degree.

orV_rcv = np.array([  [?,?,0],  [?,?,0],  [?,?,0],  [?,?,0],  [?,?,0]  ]   )
mic_pattern = "card" # Receiver polar pattern

How to customize usage of GPU

Hi

The computation will always run on the first graphic card (cuda:0). Is there anyway to customize which card to used?

Besides I met error while simulating wav in a pytorch Dataloader with multi sub-processes (num_workers > 0). The processing breaks and return initialization error of gpuRIR. Does anyone notice this problem and know how to solve it?

thx

Best regards,
Nelson

Can't work well with pytorch online trainning when set num_worker > 0

Hello,
I met a problem during using the gpuRIR with Pytorch online training when I set the num_worker of dataloader bigger than 0.
The Error info is: GPUassert: initialization error gpuRIR_cuda.cu 793.
But it works well with num_worker=0.
Is this a known problem and do you have any good suggestions?
Thanks a lot.

An error occurs when calling after the installation is complete.

(torch_env) zhuang@amax:$ pip install cmake
Collecting cmake
Downloading cmake-3.26.1-py2.py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (24.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 24.0/24.0 MB 1.1 MB/s eta 0:00:00
Installing collected packages: cmake
Successfully installed cmake-3.26.1
(torch_env) zhuang@amax:
$ pip install https://github.com/DavidDiazGuerra/gpuRIR/zipball/master
Collecting https://github.com/DavidDiazGuerra/gpuRIR/zipball/master
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='github.com', port=443): Read timed out. (read timeout=15)")': /DavidDiazGuerra/gpuRIR/zipball/master
Downloading https://github.com/DavidDiazGuerra/gpuRIR/zipball/master
\ 698.5 kB 1.5 MB/s 0:00:00
Preparing metadata (setup.py) ... done
Building wheels for collected packages: gpuRIR
Building wheel for gpuRIR (setup.py) ... done
Created wheel for gpuRIR: filename=gpuRIR-1.2.0-cp37-cp37m-linux_x86_64.whl size=458068 sha256=bc04d5dfaa6f34b9380e12012ba5c1e4aca6aa4582dffa2810419a1befad24f0
Stored in directory: /tmp/pip-ephem-wheel-cache-bi0498gj/wheels/4a/21/c3/ecebf86781b6956140ea1030a6209ca0c286bd6c633619cb01
Successfully built gpuRIR
Installing collected packages: gpuRIR
Successfully installed gpuRIR-1.2.0
(torch_env) zhuang@amax:~$ python
Python 3.7.15 (default, Nov 24 2022, 21:12:53)
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.

import gpuRIR
Traceback (most recent call last):
File "", line 1, in
File "/home/zhuang/anaconda3/envs/torch_env/lib/python3.7/site-packages/gpuRIR/init.py", line 9, in
from gpuRIR_bind import gpuRIR_bind
ImportError: /home/zhuang/anaconda3/envs/torch_env/lib/python3.7/site-packages/gpuRIR_bind.cpython-37m-x86_64-linux-gnu.so: undefined symbol: cufftExecC2R

This error occurred when I called after the installation was complete.

My nvcc is 11.1.74:
(torch_env) zhuang@amax:~$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Tue_Sep_15_19:10:02_PDT_2020
Cuda compilation tools, release 11.1, V11.1.74
Build cuda_11.1.TC455_06.29069683_0

my gcc is 9.3.0:
(torch_env) zhuang@amax:$ gcc --version
gcc (Ubuntu 9.3.0-17ubuntu1
20.04) 9.3.0

my ubuntu is Ubuntu 20.04.1 LTS

all-zero values exist in generated RIRs

Hello! I'm trying to simulate RIRs with gpuRIR toolbox. But there are some generated RIR examples that are with all-zero values. Could you please give me some suggestions about how to deal with this case?

One example is as follows:

import numpy as np 
import gpuRIR

fs = 16000
T60 = 0.32
room_sz = np.array([14.97, 29.60,  5.74])
traj_pts = np.array([[14.65, 28.10,  3.54]])
mic_pos = np.array([[3.71, 7.30, 1.58], [3.81, 7.21, 1.58]])
abs_weights = [0.57, 0.24,  0.66, 0.48, 0.43, 0.58]
beta = gpuRIR.beta_SabineEstimation(room_sz, T60, abs_weights)
mic_orV = np.array([[-1.,  0.,  0.], [ 1.,  0.,  0.]])
mic_pattern = 'omni'
Tdiff = gpuRIR.att2t_SabineEstimator(12, T60) 
Tmax = gpuRIR.att2t_SabineEstimator(60, T60)  
nb_img = gpuRIR.t2n( Tdiff, room_sz )
RIRs = gpuRIR.simulateRIR(room_sz, beta, traj_pts, mic_pos,
    nb_img, Tmax, fs, Tdiff=Tdiff, orV_rcv=mic_orV, mic_pattern=mic_pattern)

Generated signal contains noise

Hello, I tried to simulate a moving sound source with simulate_trajectory.py, but why does the generated multi-channel signal contain a lot of noise?

room_sz = [6,6,3] # Size of the room [m]
traj_pts = 64 # Number of trajectory points
pos_traj = np.tile(np.array([0.0,2.0,1.0]), (traj_pts,1))
pos_traj[:,0] = np.linspace(0.5, 5.5, traj_pts) # Positions of the trajectory points [m]
nb_rcv = 6 # Number of receivers
pos_rcv = np.c_[
[3.+0.035, 3., 1.],
[3.+0.035/2, 3.0+np.sqrt(3)*0.035/2, 1.],
[3.-0.035/2, 3.0+np.sqrt(3)*0.035/2, 1.],
[3.-0.035, 3., 1.],
[3.-0.035/2, 3.0-np.sqrt(3)*0.035/2, 1.],
[3.+0.035/2, 3.0-np.sqrt(3)*0.035/2, 1.]] # Position of the receivers [m]
pos_rcv = pos_rcv.T
print("pos_rcv",pos_rcv.shape)
mic_pattern = "omni" # Receiver polar pattern
T60 = 0.3 # Time for the RIR to reach 60dB of attenuation [s]
att_diff = 15 # Attenuation when start using the diffuse reverberation model [dB]
att_max = 60.0 # Attenuation at the end of the simulation [dB]
beta = gpuRIR.beta_SabineEstimation(room_sz, T60) # Reflection coefficients
Tdiff= gpuRIR.att2t_SabineEstimator(att_diff, T60) # Time to start the diffuse reverberation model [s]
Tmax = gpuRIR.att2t_SabineEstimator(att_max, T60) # Time to stop the simulation [s]
nb_img = gpuRIR.t2n( Tdiff, room_sz ) # Number of image sources in each dimension
RIRs = gpuRIR.simulateRIR(room_sz, beta, pos_traj, pos_rcv, nb_img, Tmax, fs, Tdiff=Tdiff, mic_pattern=mic_pattern)
filtered_signal = gpuRIR.simulateTrajectory(source_signal, RIRs)
wavfile.write('filtered_signal.wav', fs, filtered_signal)

amp calculation for cadiac recv

I test cardiac recv with multiple direction.

only [1,1,0] sound is normal but other directions, it include loud noise.
I guess some mis calculation of amp for cardiac recv.
I didn't investigate the source code, IMHO, during amp calculation for card recv, not only vector direction but also vector length would be affects.

I'm include my test script and spectrogram analysis result

room_sz = [40,40,40]  # Size of the room [m]
import scipy.io.wavfile as wf
fs, source_signal = wavfile.read('pong.wav') # 3 sec w/ 22khz sound
nb_src = 1  # Number of sources
pos_src = np.array([ [10,10,0.3] ]) # Positions of the sources ([m]
nb_rcv = 1 # Number of receivers
pos_rcv = np.array([ [20,20,1.7]   ])	 # Position of the receivers [m]
orV_rcv = np.array([    [-1,0,0]  ] )  # Vectors pointing in the same direction than the receivers
mic_pattern = "card" # Receiver polar pattern
#fs=44100 # Sampling frequency [Hz]
beta = np.zeros(6) # Reflection coefficients
Tmax = 0.05	 # Time to stop the simulation [s]
Tdiff= Tmax  # Time to start the diffuse reverberation model [s]
nb_img = gpuRIR.t2n( Tdiff, room_sz )	# Number of image sources in each dimension
RIRs = gpuRIR.simulateRIR(room_sz, beta, pos_src, pos_rcv, nb_img, Tmax, fs, Tdiff=Tdiff, orV_rcv=orV_rcv, mic_pattern=mic_pattern)
RIRs.shape
RIRs
filtered_signal = gpuRIR.simulateTrajectory(source_signal, RIRs)
filtered_signal.shape
import numpy as np

#filtered_signal /=1.414
filtered_signal *= 32767
int16_data = filtered_signal.astype(np.int16)
wf.write("filtered_signal_recv_-1_0_0.wav", fs, int16_data)

stereo with left [1,1,0], right [-1,1,0]
image

direction[1,1,0] is normal
image

direction[1,0,0]
image

direction [-1,0,0]
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.