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

Error accessing position of SceneObject #449

Closed
SimoneDelPrete opened this issue May 28, 2024 · 6 comments
Closed

Error accessing position of SceneObject #449

SimoneDelPrete opened this issue May 28, 2024 · 6 comments

Comments

@SimoneDelPrete
Copy link

I am trying to replicate some example I found on the documentation. In particular, I am running this code here:

import os

os.environ["CUDA_VISIBLE_DEVICES"] = ""
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"


import sionna
from sionna.rt import PlanarArray, SceneObject, Transmitter, load_scene

scene = load_scene(sionna.rt.scene.simple_street_canyon_with_cars)
scene.tx_array = PlanarArray(1, 1, 0.5, 0.5, "tr38901", "V")
scene.add(Transmitter("tx", position=[22.7, 5.6, 0.75], orientation=[0, 0, 0]))

# new_obj = SceneObject(name="new", object_id=1, scene=scene, mi_shape="square")

# print(new_obj.position)
car: SceneObject = scene.get("car_3")  # type: ignore

print(car.position)

When I run this code, I get this error when running print(car.position):

2024-05-28 13:10:45.861420: F tensorflow/core/framework/tensor.cc:847] Check failed: IsAligned() ptr = 0x5654e12ee320
Aborted

I am running sionna version 0.17.0
CUDA Version: 12.5

OS: Ubuntu 22.04.3 LTS on Windows 10 x86_64 (Linux version 5.15.146.1-microsoft-standard-WSL2)

@SebastianCa
Copy link
Collaborator

Hi @SimoneDelPrete,

I cannot reproduce the error on my local machine (Ubuntu 22.04). This seems related to #446 and the issue happens at the exact same point when accessing the position argument.

Does python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))" work now?

@SimoneDelPrete
Copy link
Author

Hi @SebastianCa

So the issue persists as in #446, I installed CUDA as explained in the nvidia guide, but I think that the kernel is actually not compatible with NUMA, so probably that's why tensorflow doesn't recognise GPU. In fact, if I run the command numactl I get this output:

simonedelprete@PC-SDP:~$ numactl --show                                                                                                                          physcpubind: 0 1 2 3 4 5 6 7                                                                                                                                     No NUMA support available on this system.                                                                                                                        simonedelprete@PC-SDP:~$ numactl --hardware                                                                                                                      No NUMA available on this system

I read here that is a problem related to WSL and I might need to compile my own kernel.

As a matter of fact, I was thinking to avoid using GPU for computation (since my simulations will not be very complex) and in fact I set os.environ["CUDA_VISIBLE_DEVICES"] = "" in order to avoid any problem with the GPU.

Everything works fine, I tried some other examples and they work fine, only when I try to access to the position attribute it gives me that error. In case I run directly with python it gives me that error, with jupyter the kernel crashes.

@SebastianCa
Copy link
Collaborator

You are right, it seems as if there is an issue when no GPU is selected (see #450 for a similar observation).
We'll look into the problem and keep you updated.

@faycalaa
Copy link
Collaborator

Hi,

This bug will be fixed in the next release.
In the meantime, you can fix it by making the following change to these lines:

# Bounding box
# [3]
bbox_min = tf.cast(self._mi_shape.bbox().min, rdtype)
# [3]
bbox_max = tf.cast(self._mi_shape.bbox().max, rdtype)

@SimoneDelPrete
Copy link
Author

Hi,

This bug will be fixed in the next release. In the meantime, you can fix it by making the following change to these lines:

# Bounding box
# [3]
bbox_min = tf.cast(self._mi_shape.bbox().min, rdtype)
# [3]
bbox_max = tf.cast(self._mi_shape.bbox().max, rdtype)

Thanks, now it works!

@jhoydis
Copy link
Collaborator

jhoydis commented Jun 12, 2024

Fixed in v0.18.

@jhoydis jhoydis closed this as completed Jun 12, 2024
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

4 participants