-
Notifications
You must be signed in to change notification settings - Fork 111
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
some issues about verify_image_on_cuda.py #334
Comments
Hi,
This error is caused by Panda3D graphics pipeline which doesn't support headless rendering in the official distribution. You have to compile panda3d on your headless machine and install it in your conda env. For more details, see: https://metadrive-simulator.readthedocs.io/en/latest/install.html#install-metadrive-with-headless-rendering Besides,
Generally, textures on the graphics card will be scaled up/down to power-2 size, like 256, 512, etc. In this case, you are not allowed to set random image size as your camera observation, but only power-2 size image observation can be returned correctly. To remove this limit, we set However, we have to say that we didn't test the headless pipeline for a long time, and thus you may encounter other problems beyond the documentation. Let's stay in touch. Besides, could you provide more information about your platform like your os, GPU, driver, and CUDA? Running |
Thanks for your reply. " NVIDIA-SMI 470.161.03 Driver Version: 470.161.03 CUDA Version: 11.4 " |
According to our doc, you don't need to specify the jpeg path. All you need is to specify your python path in the following command:
|
Also, I found several rendering-related problems, see #336. I will fix them ASAP |
Thanks for your help. I recompile the panda and a new error. I'm sure the same problems with you. I put my results as follows: "Successfully registered the following environments: ['MetaDrive-validation-v0', 'MetaDrive-10env-v0', 'MetaDrive-100envs-v0', 'MetaDrive-1000envs-v0', 'SafeMetaDrive-validation-v0', 'SafeMetaDrive-10env-v0', 'SafeMetaDrive-100envs-v0', 'SafeMetaDrive-1000envs-v0', 'MARLTollgate-v0', 'MARLBottleneck-v0', 'MARLRoundabout-v0', 'MARLIntersection-v0', 'MARLParkingLot-v0', 'MARLMetaDrive-v0']. |
Hi, I create a new PR #337, which can successfully run on my headless machine without compiling Panda3D and any further actions. Could you help me test it? Just switch to
Note: donot use the compiled panda3d, the officially distributed one is fine. I already tested it. The script will generate Three pairs of images to examples directory, one from agent observation, the other from panda3d internal rendering buffer. Please fetch and check those images from the cluster or server to ensure MetaDrive can draw scenes and capture images correctly. |
Thanks a lot for your quick update. This branch can obtain complete visual images & depth images. Besides, the RLLib is still not friendly to new comers. Turning into Stable Baseline 3 (SB3) might be more pythonic solution. Hope the anthors give more training examples. |
Good idea on sb3 example. We actually have that code. Thanks for bringing it up.Best,ZhenghaoOn Mar 15, 2023, at 21:18, siaoliu ***@***.***> wrote:
Thanks a lot for your quick update. This branch can obtain complete visual images & depth images.
I noticed that this testing file uses some constant hyper-parameters to test this feature, and it may be unable to generate visual observations with CUDA right now. Looking forward to your update.
Besides, the RLLib is still not friendly to new comers. Turning into Stable Baseline 3 (SB3) might be more pythonic solution. Hope the anthors give more training examples.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
@siaoliu I updated the script, now you can use Besides, I noticed that your machine's cuda is < 12.0 which may not support you to use the cuda pipeline. Consider updating it and enjoy! |
I just merged this PR to |
Thanks, I would update my CUDA version soon. |
cuda 12 is compatible with torch even you install cudatoolkit=11.7 following torch installation guide. Best,ZhenghaoOn Mar 17, 2023, at 21:56, siaoliu ***@***.***> wrote:
Thanks, I would update my CUDA version soon.
I'm not sure the CUDA12 is whether be incompatible with the torch version (I remember torch may run with a inherent toolkit).
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Perhaps off-heading envs still invokes the display device? "Bullet physics world is launched successfully! |
If the rendered image is ok, just ignore this error. It is something raised when closing the environment and the game engine, so won't affect the application. And yes, the offscreen rendering still looks for the display device, while stopping sending rendered image to the screen if can not find one. This is what we called the As for the cuda version. 12.0 is for the cuda runtime, which is the cuda in your system and can be checked by |
@pengzhenghao Can you provide a simple training example (like SAC or PPO (sb3)) as a baseline on basic MetaDriveEnv. Maybe due to some error hyper-parameters, it is hard for me to reproduce the accuracy obtained in the paper. Looking forward your help !!! |
Hi, I am running the software on 4x NVIDIA Tesla V100 32GB GPU. Hence, the difference may be I must run the software headless. I had also followed the steps you mentioned to make panda. However, the issue still persists.
Can I ask if there is any remedy or precedent to run Metadrive headless on V100 servers? |
Hi @leejiahe I think no special treatment is required now. I remember that the doc's installation section has already been updated. It says now only a line of Quanyi |
Dear @QuanyiLi , Thank you for your fast reply. I had created a new conda environment and followed the installation instructions which contains the three lines of code (that includes
Thank you so much for your help |
It must be caused by interactions between OpenGL and GPU. I tried it again on a new A5000 GPU cluster. Everything works fine. My output message after running the same script is:
I guess it is due to some wrong settings of Let's just wait for their feedback! |
Hi, Jiahe @leejiahe According to the reply here: https://discourse.panda3d.org/t/got-nothing-returned-when-calling-rendersceneinto-in-headless-mode/29253, one possible reason is that virtual framebuffer can't be created on your Linux. Could you try: Besides, have you tried other offscreen rendering simulators on your machine? Especially, those rendering scenes via OpenGL. They will also fail due to the lack of this function. Quanyi |
Dear @QuanyiLi , Thank you for your help. I had tried installing the libraries, as you suggested, but the problem still persists. It still does not create a visual frame buffer. Actually, I had tried installing DonkeyCar and AirSim, but I also faced the same issue, where I can't render virtually. I chanced upon this just now, is there something equivalent for MetaDrive? |
@leejiahe Thanks for sharing. But I don't believe that Panda3D supports SDL, so the GPU selection has nothing to do with your problem. I wish I could help more, but sorry about it. Maybe you could try looking through some topics with the keywords: headless x-11 server/OpenGL headless to see if you can get some hints. Besides, I guess some remote desktop services can not be launched on your machine due to the same problem. Thus related topics are worth reading. |
Dear @QuanyiLi , Perfectly understandable. Thank you for your help! |
@AHPUymhd |
Thank you for this wonderful work!!!!
Unfortunately, when running this program (verify_image_on_cuda.py) with a screenless remote server (Ubuntu 18.04), I got the some errors. Further, I define the env = MetaDriveEnv(dict(environment_num=1000, start_seed=1010, image_on_cuda=True, traffic_density=0.05,)), I get the similar errors. I want to know how to use cuda_version Env in a remote server without screens.
"Known pipe types:
glxGraphicsPipe
(1 aux display modules not yet loaded.)
:display:x11display(error): Could not open display ":0.0".
:display(error): The 'textures_power_2' configuration is set to 'none', meaning
that non-power-of-two texture support is required, but the video
driver I'm trying to use does not support non-power-of-two textures.
:device(warning): /dev/input/event2 is not readable, some features will be unavailable.
Traceback (most recent call last):
File "verify_image_on_cuda.py", line 57, in
_test_rgb_camera_as_obs(args.render, image_on_cuda=not args.native)
File "verify_image_on_cuda.py", line 28, in _test_rgb_camera_as_obs
env.reset()
File "/home/vehicle/meta/metadrive/envs/base_env.py", line 372, in reset
self.lazy_init() # it only works the first time when reset() is called to avoid the error when render
File "/home/vehicle/meta/metadrive/envs/base_env.py", line 259, in lazy_init
engine = initialize_engine(self.config)
File "/home/vehicle/meta/metadrive/engine/engine_utils.py", line 12, in initialize_engine
cls.singleton = cls(env_global_config)
File "/home/vehicle/meta/metadrive/engine/base_engine.py", line 29, in init
EngineCore.init(self, global_config)
File "/home/siao/vehicle/meta/metadrive/engine/core/engine_core.py", line 243, in init
use_occlusion_maps=False
File "/home/vehicle/meta/metadrive/engine/core/our_pbr.py", line 51, in init
use_occlusion_maps=use_occlusion_maps
File "/home/miniconda3/envs/md/lib/python3.7/site-packages/simplepbr/init.py", line 136, in init
self._setup_tonemapping()
File "/home/miniconda3/envs/md/lib/python3.7/site-packages/simplepbr/init.py", line 264, in _setup_tonemapping
self.tonemap_quad.set_shader(tonemap_shader)
AttributeError: 'NoneType' object has no attribute 'set_shader'"
The text was updated successfully, but these errors were encountered: