Any2HRTF / Mesh2HRTF

Open software for the numerical calculation of head-related transfer functions
European Union Public License 1.2
111 stars 14 forks source link

Error running NumCalc #15

Closed eoolatm closed 2 years ago

eoolatm commented 2 years ago

Hello, I'm trying to run NumCalc on a linux OS by doing this: In the directory with the NC.inp file exported by mesh2hrtf, I also put the NumCalc executable file that was created when running make in the path/to/mesh2hrtf/NumCalc directory

I then run the script by typing ./NumCalc

The process starts up, but after a few seconds it stops with this message:

---------- NumCalc started: 9/6/2022 14:32:13 ----------

Running on: mycomputer

3D analysis Job title: Head-Related Transfer Functions

Step 1, Frequency = 100 Hz

Informations about the canceled interacting cluster pairs: Level N. canceled pairs N. interacting pairs Cancel ratio (%) 0 23 82934 0.0277329

Single level fast multipole BEM

Number of equations = 110660

Informations about clusters: Level Num. of clusters Maximum radius Minimum radius 0 413 0.0344163 0.00796333 resu. nets 1850 0 0

Informations about the FMM expansion: Level N. expa. terms N. p. theta N. p. phi N. p. sphere 0 8 8 16 128 terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Aborted (core dumped)

I don't know the .cpp-scripts run by NumCalc very well, so I don't really know what to make of this error message.

The reason I'm trying to run it this way is that I don't have sudo permission on the machine I'm on, so I can't edit the program path. Any help is very much appreciated, Mattias

SDX-LV commented 2 years ago

Hi, while you are testing the process and perhaps not sure if your 3D mesh is solid, I would suggest to use any computer where you can properly install NumCalc. https://youtu.be/AVcPBrZ0rLQ You can worry about performance when you are confident that your project is ready to run. Plus you really want to use NumCalcManager or other way to manage resources. Just launching NumCalc is very inefficient and can be a bit risky.

To solve your main issue, can you confirm that you used hrtf_mesh_grading? Plus some more mesh troubleshooting tips: https://youtu.be/wRvSooD0n0E?t=388

eoolatm commented 2 years ago

Okay, the 3D-mesh is from the chedar database (https://sofacoustics.org/data/database/chedar/documentation.pdf), so there shouldn't be a problem with it (already graded and triangular mesh). I will try to run it on another computer the standard way and see if I get the same error. Thanks

eoolatm commented 2 years ago

Now, using NumCalcManager.py and following the exact installation steps on a different machine, things seem to work using the same mesh as before, so the mesh indeed does not seem to be the source of error. However, it is not feasible to run the whole simulation due to RAM-limitations. If I were to try using NumCalcManager.py on the computer without sudo permission, do you think it would be possible to skip sudo cp NumCalc /usr/local/bin/ and perhaps modify something in the NumCalcManager.py script to get it to work? Best regards, Mattias

f-brinkmann commented 2 years ago

sudo cp NumCalc /usr/local/bin/ is only a step for convenience to make the NumCalc command accessible from anywhere on a machine. NumCalc itself does not require sudo privileges. Running it locally, as you have done in the first place is usually fine. I'm not sure why the problem occurs on one machine and not on the other using the same input data.

There is a slightly different version of numcalc_manager.py in https://github.com/Any2HRTF/Mesh2HRTF/tree/add_numcalcmanager/mesh2hrtf/NumCalc where the path to NumCalc can be passed as an argument.

eoolatm commented 2 years ago

Okay, so actually once the simulation has run on windows machine for a while using NumCalcManager.py i get the same error as before image terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc The simulation completed for the highest frequency 24 kHz, but after that the simulations break down. What exactly does what(): std::bad_alloc mean? Is there a specific part of the code I could look at to investigate? Bets regards, Mattias

eoolatm commented 2 years ago

Trying once again to run the simulation on a GPU-machine but this time with the modified NumCalcManager.py I get this error image even though I placed the NumCalc.exe in the /home/eoolatm/Mesh2HRTF-develop/mesh2hrtf/NumCalc directory. Any idea why this error occurs?

SDX-LV commented 2 years ago

Hi, It is difficult to follow what are you modifying and why, but please check this first:

  1. Make 100% sure that your NumCalc simulation succeeds. I would do it on Windows, where you don't need administrator access to run NumCalc. In case you do not trust NumCalcManager, you can try following the "- run_NumCalc_instance.bat" instructions to just run the 1st simulation step. One step is usually simulated in under 1 hour (probably 15min) and in the log file you will see "End Time" line.
  2. If you have ANY issues with the NumCalc simulation not succeding, you must try to use the "hrtf_mesh_grading" (optimization). In my experience there is no such thing as a 100% reliable, error-free 3D mesh downloaded from the Internet.
  3. You can even create a simulation project with just ~5 steps so that you can quickly simulate it on any computer using just NumCalc.exe. Then you can run post-processing to get the SOFA files. This way you can test the whole workflow.

After you are reasonably confident that NumCalc simulations are not-failing, then I would experiment with some unusual installations, modified NumCalcManagers and perhaps not using "hrtf_mesh_grading".

f-brinkmann commented 2 years ago

closed due to inactivity - reopen if required...