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

Ray tracing: error in scene.compute_paths(), if scattering is activated and more than one receiver in the scene #273

Closed
member67 opened this issue Nov 27, 2023 · 2 comments

Comments

@member67
Copy link

Summary

In the ray-tracing tutorial, when executing scene.compute_paths(), I get an error if multiple (more than one) receivers are present in the scene and if the parameter "scattering" is set to True.
For example:

rx2 = Receiver(name="rx2",
               position=[45, 90, 0.5],
               orientation=[0, 0, 0])
scene.add(rx2)
paths = scene.compute_paths(max_depth=1, diffraction=False, scattering=True)

results in the following error:

tensorflow.python.framework.errors_impl.InvalidArgumentError: {{function_node __wrapped__GatherV2_device_/job:localhost/replica:0/task:0/device:CPU:0}} indices[88,0,2650] = -1 is not in [0, 218) [Op:GatherV2] name: 

Process finished with exit code 1

I run compute_paths() on a CPU, no GPU is involved.

System configuration

System information: [running on CPU, I explicitly switch off the GPU]

OS: Ubuntu 20.04.6 LTS
CPU: Intel(R) Xeon(R) CPU E5-2697 v4 @ 2.30GHz
GPU: Quadro M5000
Python: 3.9.17 (main, Jul 5 2023, 20:41:20) [GCC 11.2.0]
NVidia driver: 545.29.02
CUDA: 12.2.128
LLVM: -1.-1.-1

Dr.Jit: 0.4.3
Mitsuba: 3.4.0
Is custom build? False
Compiled with: GNU 10.2.1
Variants:
scalar_rgb
scalar_spectral
cuda_ad_rgb
llvm_ad_rgb

OS version: Linux-5.15.0-78-generic-x86_64-with-glibc2.31
processor: X86_64 [GenuineIntel]
tensorflow version: 2.15.0
sionna version: 0.15.1

Description

I run the ray-tracing tutorial. I add one more receiver to the scene, and explicitly set the scattering parameter to False as follows.

rx2 = Receiver(name="rx2",
               position=[45, 90, 0.5],
               orientation=[0, 0, 0])
scene.add(rx2)
paths = scene.compute_paths(max_depth=1, diffraction=False, scattering=True)

Every time that there is more than one receiver in the scene and scattering is activated, I end up with the following error in the scene.compute_paths() method:

Traceback (most recent call last):
  File "[...]/main.py", line 1193, in trace_cirs
    all_paths = scene.compute_paths(max_depth=p_radio_options['max_depth'],
  File "/media/hdd/miniconda/envs/pychEnv3/lib/python3.9/site-packages/sionna/rt/scene.py", line 564, in compute_paths
    paths = self._solver_paths(max_depth,
  File "/media/hdd/miniconda/envs/pychEnv3/lib/python3.9/site-packages/sionna/rt/solver_paths.py", line 627, in __call__
    all_paths = self._compute_paths_coefficients(rx_rot_mat,
  File "/media/hdd/miniconda/envs/pychEnv3/lib/python3.9/site-packages/sionna/rt/solver_paths.py", line 4136, in _compute_paths_coefficients
    k_x = tf.gather(xpd_coefficient, paths_tmp.scat_last_objects)
  File "/media/hdd/miniconda/envs/pychEnv3/lib/python3.9/site-packages/tensorflow/python/util/traceback_utils.py", line 153, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "/media/hdd/miniconda/envs/pychEnv3/lib/python3.9/site-packages/tensorflow/python/framework/ops.py", line 5883, in raise_from_not_ok_status
    raise core._status_to_exception(e) from None  # pylint: disable=protected-access
tensorflow.python.framework.errors_impl.InvalidArgumentError: {{function_node __wrapped__GatherV2_device_/job:localhost/replica:0/task:0/device:CPU:0}} indices[88,0,2650] = -1 is not in [0, 218) [Op:GatherV2] name: 

Process finished with exit code 1

The indices in "indices" are different (seems random) each time, so the last line in the error message may say:

[...] indices[40,0,2670] = -1 is not in [0, 218) [Op:GatherV2] name: 
[...] indices[29,0,2631] = -1 is not in [0, 218) [Op:GatherV2] name: 
[...] indices[36,0,2652] = -1 is not in [0, 218) [Op:GatherV2] name: 
[...] indices[48,0,860] = -1 is not in [0, 218) [Op:GatherV2] name: 

I can't tell whether these indices have any meaning - I do not see any connection to my scene.

If I set the scattering parameter to False, i.e.,
paths = scene.compute_paths(max_depth=8, diffraction=True, scattering=False)
the paths are computed without a problem.
However, scattering and having multiple recievers are both key requirements for me.

I have seen issues with a similar error message, and they said "solved" with the latest Sionna version (0.15.1). However, I have that version and the error still occurs.

By the way, if I run through the single receiver locations in a for loop (calling compute_paths each time with a single receiver) instead of having a number of receivers at the same time, I run into the following error:

Assertion failed in /project/ext/drjit-core/ext/nanothread/src/queue.cpp:354: remain == 1
Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

as described here: mitsuba-renderer/mitsuba3#849 (comment)

Steps to reproduce

  1. adapt ray tracing tutorial such that there are two receivers, e.g., scene.add(rx2)
  2. compute paths with scene.compute_paths(scattering=True)
@faycalaa
Copy link
Collaborator

Hi,

Thank you for reporting this issue. We were able to reproduce it and it will be fixed in the next release.

@faycalaa
Copy link
Collaborator

Fixed by v0.16.

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