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

world.apply_settings() slow in 0.9.11 synchronous mode #3867

Open
syveqc opened this issue Feb 8, 2021 · 9 comments
Open

world.apply_settings() slow in 0.9.11 synchronous mode #3867

syveqc opened this issue Feb 8, 2021 · 9 comments
Assignees
Labels
possible bug stale Issue has not had recent activity

Comments

@syveqc
Copy link

syveqc commented Feb 8, 2021

Hi,

I just upgraded to Carla 0.9.11 and now my code runs slow. (Ubuntu 20.04). After some digging I found that world.apply_settings() needs significantly more time than before.
Code example:

import carla
import time

#load carla and apply basic settings
client = carla.Client("localhost", 2000)
world = client.load_world("Town04")
settings = world.get_settings()
settings.no_rendering_mode = True
settings.fixed_delta_seconds = 0.1
settings.synchronous_mode = True
world.apply_settings(settings)

#needed because first tick takes longer than subsequent ones sometimes
world.tick(1)

#tick without applying settings
start = time.time()
world.tick(1)
print(f"normal step needed {int((time.time()-start)*1000)}ms")

#tick after applying settings
start = time.time()
world.apply_settings(settings)
print(f"apply settings needed {int((time.time()-start)*1000)}ms")
world.tick(1)
print(f"apply settings and step needed {int((time.time()-start)*1000)}ms")

I tested it in opengl and vulkan mode, the error exists in both. (in vulkan the non-apply_settings() steps are a lot quicker, the apply_settings() steps need nearly identical time)

Output in 0.9.10 on my machine (time may vary a couple ms)

normal step needed 6ms
apply settings needed 0ms
apply settings and step needed 9ms

Output in 0.9.11 on my machine (time may vary a couple ms)

normal step needed 8ms
apply settings needed 1002ms
apply settings and step needed 1003ms

For completion's sake here is my hardware, but the behavior was also confirmed on another machine, so I do not think the hardware actually matters:

  • CPU: AMD Ryzen 5950x
  • GPU: Nvidia RTX 3090
  • RAM: 32GB 3600MHz C16

Thanks in advance for your help!

@hh0rva1h
Copy link

hh0rva1h commented Feb 9, 2021

I can confirm this.
@germanros1987 could you please triage this issue?

@corkyw10
Copy link
Contributor

@bernatx could you follow up on this please?

@stale
Copy link

stale bot commented Jul 21, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issue has not had recent activity label Jul 21, 2021
@hh0rva1h
Copy link

go away stale bot

@stale stale bot removed the stale Issue has not had recent activity label Aug 19, 2021
@stale
Copy link

stale bot commented Jan 9, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issue has not had recent activity label Jan 9, 2022
@hh0rva1h
Copy link

@bernatx Please follow up, Code example is given, should be quick to look into.

@stale stale bot removed the stale Issue has not had recent activity label Feb 16, 2022
@stale
Copy link

stale bot commented Apr 17, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issue has not had recent activity label Apr 17, 2022
@hh0rva1h
Copy link

@bernatx Still an issue with 0.9.13, why is it so much slower? This is actually relevant for people doing reinforcement learning and applying settings after each episode: 1 second wait time after each episode can amount to much training time being wasted, especially at the begin of the training when episodes are very short!

@stale stale bot removed the stale Issue has not had recent activity label Apr 29, 2022
@stale
Copy link

stale bot commented Jun 2, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issue has not had recent activity label Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
possible bug stale Issue has not had recent activity
4 participants