I didn’t use to have this message in previous version of Isaac Sim but I get it in Isaac Sim 2023.1.0. Not sure exactly how to switch to asyn??
Detected a blocking function. This will cause hitches or hangs in the UI. Please switch to the async version
The async message is a warning and can be ignored, future versions will switch such blocking functions to async ones making the UI responsive while executing such tasks.
The amount of VRAM does not effect loading times. Is the loading slow after the initial one as well? If yes, was it faster in previous versions?
@ahaidu I am in the process of switching from the previous IsaacSim2022 to Isaacim2023. What I’ve noticed, aside from the blocking warning which I am also getting, is that the loading time for the simulation is much slower compared to the previous version. The complexity of the environment I am simulating is exactly the same and after having loaded the environment I didn’t notice performance degradation in the rt factor of the simulation. I am running on a RTX 3050 Laptop with 4GB of VRAM and 2048 cuda cores (which I’m aware it’s under the minimum requirements), using the 525.147.05 NVIDIA drivers. I don’t think the hardware is the issue though, since I tried the same env. on a much more powerful workstation, but with the same slow loading results.
Can you check with this script in the script editor if you have any difference between the two versions? I did not seem to have any. Tested under a windows laptop:
import asyncio
import time
import omni.kit.app
from omni.isaac.core.utils.nucleus import get_assets_root_path
from omni.isaac.core.utils.stage import create_new_stage_async, open_stage_async
ENV = "/Isaac/Environments/Simple_Warehouse/full_warehouse.usd"
NUM_RUNS = 5
async def run_open_stage_async(num):
assets_root_path = get_assets_root_path()
for i in range(num):
start_time = time.time()
await create_new_stage_async()
await open_stage_async(assets_root_path + ENV)
for _ in range(10):
await omni.kit.app.get_app().next_update_async()
print(f"[{i}] Stage opened in: {time.time() - start_time} seconds..")
asyncio.ensure_future(run_open_stage_async(NUM_RUNS))
Results:
2023.1.0:
[0] Stage opened in: 35.077611446380615 seconds..
[1] Stage opened in: 24.954912662506104 seconds..
[2] Stage opened in: 25.34042978286743 seconds..
[3] Stage opened in: 24.800984144210815 seconds..
[4] Stage opened in: 24.431441068649292 seconds..
2022.2.1:
[0] Stage opened in: 35.8921856880188 seconds..
[1] Stage opened in: 26.742398738861084 seconds..
[2] Stage opened in: 26.188152074813843 seconds..
[3] Stage opened in: 26.192384004592896 seconds..
[4] Stage opened in: 26.39604663848877 seconds..
@ahaidu I’ll try and let you know.
By script editor what do you mean? Can’t I just run it as a normal python script?
Consider that right now I am running in a personal conda env with python 3.10 and I simply source Isaac’s setup_conda_env.sh on top of it. With 2022 I used to do the same. Don’t know if this can cause issues.
Btw, I am running on ubuntu 20.04 and a laptop RTX3050 GPU
@ahaidu I run the test and I don’t see relevant differences in the printed scene loading times (around 25/26 s).
I think the delay I am seeing is related to something different.
My script blocks and stays a lot of time on this output
2023-11-06 14:10:19 [36,807ms] [Warning] [omni.client.python] Detected a blocking function. This will cause hitches or hangs in the UI. Please switch to the async version:
File "/home/username/LRhcExamples/lrhc_examples/scripts/play.py", line 93, in <module>
File "/home/username/LRhcExamples/lrhc_examples/envs/lrhcenv.py", line 36, in set_task
File "/home/username/OmniRoboGym/omni_robo_gym/gym/omni_vect_env/vec_envs.py", line 254, in set_task
File "/home/username/.local/share/ov/pkg/isaac_sim-2023.1.0/exts/omni.isaac.core/omni/isaac/core/world/world.py", line 276, in reset
File "/home/username/OmniRoboGym/omni_robo_gym/tasks/custom_task.py", line 780, in set_up_scene
File "/home/username/.local/share/ov/pkg/isaac_sim-2023.1.0/exts/omni.isaac.core/omni/isaac/core/scenes/scene.py", line 225, in add_default_ground_plane
File "/home/username/.local/share/ov/pkg/isaac_sim-2023.1.0/exts/omni.isaac.core/omni/isaac/core/utils/nucleus.py", line 504, in get_assets_root_path
File "/home/username/.local/share/ov/pkg/isaac_sim-2023.1.0/exts/omni.isaac.core/omni/isaac/core/utils/nucleus.py", line 191, in check_server
File "/home/username/.local/share/ov/pkg/isaac_sim-2023.1.0/kit/extscore/omni.client/omni/client/__init__.py", line 161, in stat
Hi here is an explanation from github about the blocking function issue
I found a solution without requiring the installation of a local nucleus server
You should have the omniverse cache installed
you can edit this file
/home/*/.local/share/ov/pkg/isaac_sim-2023.1.0/exts/omni.isaac.core/omni/isaac/core/utils/nucleus.py
change lines 178 to 198 which is the check server function to below
def check_server(server: str, path: str) -> bool:
"""Check a specific server for a path
Args:
server (str): Name of Nucleus server
path (str): Path to search
Returns:
bool: True if folder is found
"""
carb.log_info("Checking path: {}{}".format(server, path))
# Increase hang detection timeout
if "localhost" not in server:
omni.client.set_hang_detection_time_ms(10000)
result, _ = omni.client.stat("{}{}".format(server, path))
if result == Result.OK:
carb.log_info("Success: {}{}".format(server, path))
return True
carb.log_info("Failure: {}{} not accessible".format(server, path))
return False
I have encountered similar problems in the version of isaac_sim-2023.1.0-hotfix.1, and I have tried the methods mentioned above. But the loading time is still very long.