carla-simulator / carla

Open-source simulator for autonomous driving research.
http://carla.org
MIT License
11.28k stars 3.65k forks source link

How to disable rendering in CARLA server? #286

Closed GokulNC closed 6 years ago

GokulNC commented 6 years ago

So when the CARLA server is run by using the script CarlaUE4.sh to launch it, is there any way to disable the rendering of the game window?

I use a camera in the simulator to get the current FoV from that camera. So just reading the image by CarlaClient.read_data() is enough for me to process things. I feel that I can increase my FPS by reducing the processing overhead to render the game using Unreal Engine.

I tried using the flag -carla-no-hud as suggested in the docs, but still the rendering is taking place.

So is there anyway to do this? Or it's not just possible or it doesn't matter not to render? Thanks :)

marcgpuig commented 6 years ago

Hi @GokulNC,

First of all -carla-no-hud disables the left-bottom text output from the server:

cbb50b6e874c0e3a3ec15cc9a5cc4c36

Currently is no possible to disable the render and I have the feeling that it will doesn't matter anyways, because regardless you see the render or not, it must be done anyway.

GokulNC commented 6 years ago

Thanks @marcgpuig .

Eventhough the computations need to occur, I feel rendering it at a certain FPS (say 15) is quite resource-intensive.

Though there is no way to disable rendering as of now, can this issue be considered as a feature-request?

I will close this issue if this feature is implemented, or if there's an strong assertion that disabling rendering doesn't matter much.

Regards :)

marcgpuig commented 6 years ago

Please try adding these commands:

-windowed -ResX=8 -ResY=8

So it will run on a 8x8 pixels window. It's a workaround but I hope you can win some extra fps. 😉

Another solution is work without an actual screen, see our documentation.

For sure I'm going to add the feature-request tag because it is something that can improve the performance. But we are currently working on other more critical optimizations, so do not expect big focus on this one.

Since it's more an Unreal Engine issue, I'm adding the Good issue for first-time contributors too, so the community can make a good-and-easy contribution 😄

Regards!

simmates commented 6 years ago

Is it also possible to disable the HUD in the Editor?

simmates commented 6 years ago

Ok it is possible in the console with showHUD 0

juaxix commented 6 years ago

You can also set

r.ScreenPercentage 0

using the unreal console

marcgpuig commented 6 years ago

Is this topic solved?

juaxix commented 6 years ago

@marcpuig I think we should add a command for this, to disable the rendering in the viewport like this

ULocalPlayer* player = GEngine->GetGamePlayer(GetWorld(), 0);
player->ViewportClient->bDisableWorldRendering = true;
marcgpuig commented 6 years ago

@juaxix Yeah looks good to me!

GokulNC commented 6 years ago

@juaxix Yeah, that might help IDK :)

But as an end user like me, it would be better if there's a command-line flag or an option in CarlaSetting.ini or something like that to disable it easily, without needing to recompile from scratch. We're more comfortable with using the release ones.

Thanks :)

juaxix commented 6 years ago

Ok, the feature has been implemented in the branch issue-286, you can wait for it to be merged into main and it will be added in CARLA 0.8.3. Screenshot showing the result, no rendering but you can get info from the game

In CarlaSettings.ini, the new flag is inside the [Server] section, and it's called: DisableRendering, by default is false, Ah, it will hide the hud too if set to true. And the new command for the executable is called "-disable-rendering".

Cheers.

stale[bot] commented 6 years ago

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.

JunningHuang commented 5 years ago

I have added the "-disable-rendering" to arguments when I running the Carla.sh script, but it didn't worked. However changing the "DisableRendering" to true in the Carla.ini file worked.

aayushARM commented 5 years ago

I have added the "-disable-rendering" to arguments when I running the Carla.sh script, but it didn't worked. However changing the "DisableRendering" to true in the Carla.ini file worked.

None of them are working now. :/ Also, the Carla Settings section has been removed in newer documentation(0.9.4) and it seems CarlaSettings.ini file is simply ignored now.

geekhut commented 5 years ago

Is it also possible to disable the HUD in the Editor?

Hi have you solved this? I would like to know how.. thanks

DongChen06 commented 5 years ago

Hi, @aayushARM , have you solved this problem and how to run the code without rendering?

tojimahammatov commented 4 years ago

Hi all. I am using Carla 0.9.6 now, and the following are working without any problem:

./CarlaUE4.sh --no-rendering

And in order to check, you can run _no_renderingmode.py inside PythonAPI/examples folder

pirate-lofy commented 4 years ago

In linux, just write this command... SDL_VIDEODRIVER=offscreen ./CarlaUE4.sh

siposcsaba89 commented 4 years ago

Hello,

I am trying to disable rendering in carla, version 0.9.9.4 on windows 10. I have already tried with the config script:

./config.py --no-rendering

After that carla window turns to black, but the gpu usage still very high and if I start

./no_rendering_mode.py

Carla windows start to display the rendered view again. Does anyone have similar issues? Or solutions? Should it work on windows? Thanks in adavance.

mkhansenbot commented 1 year ago

I see the same problem in version 0.9.12. There isn't a CarlaSettings.ini file anywhere and the -disable-rendering flag does nothing. If anyone knows how to disable rendering at startup, please update.

TzabarDolev commented 1 year ago

Hi, I wrote a blog post about this issue on the CarlaSimBlog, including a code tutorial for off screen rendering. https://carlasimblog.wordpress.com/2023/10/04/rendering-images-off-screen-in-the-carla-simulator/