Closed rgu01 closed 9 months ago
Do you try creating a soft link for swrast_dri.so?
Do you try creating a soft link for swrast_dri.so?
No, I did not try any fix. I thought it was a problem with the tool as I just followed the instructions in a new Ubuntu VM and did nothing complex. Do you mean add "/usr/lib/x86_64-linux-gnu/dri/swrast_dri.so" in the PATH variable?
No, I mean you can do ln -s /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so /usr/lib/dri/swrast_dri.so
, which will create a soft copy for the missing .so
We didn't run MetaDrive in a Virtual machine before... I think the virtual machine has poor support for GPU, so the rendering could be slow. If you are playing Ubuntu on windows platform, maybe you can try WSL2
, which provides native support for linux on windows.
Switched to my M2 chip MacBook Pro. Created a new conda environment. Installed MetaDrive from zero in the new environment. Run "python -m metadrive.examples.verify_headless_installation" and get the following issues:
[INFO] Environment: MetaDriveEnv
[INFO] MetaDrive version: 0.4.2.3
[INFO] Sensors: [lidar: Lidar(), side_detector: SideDetector(), lane_line_detector: LaneLineDetector()]
[INFO] Render Mode: none
[INFO] Horizon (Max steps per agent): None
[INFO] Assets version: 0.4.2.3
[INFO] Known Pipes: CocoaGraphicsPipe
[INFO] Start Scenario Index: 0, Num Scenarios : 1
[INFO] Episode ended! Scenario Index: 0 Reason: out_of_road.
Bullet physics world is launched successfully!
[INFO] Environment: MetaDriveEnv
[INFO] MetaDrive version: 0.4.2.3
[INFO] Sensors: [lidar: Lidar(), side_detector: SideDetector(), lane_line_detector: LaneLineDetector(), rgb_camera: RGBCamera(256, 256), depth_camera: DepthCamera(256, 256)]
[INFO] Render Mode: offscreen
[INFO] Horizon (Max steps per agent): None
Traceback (most recent call last):
File "
File "/Users/rgu01/Library/CloudStorage/OneDrive-Mälardalensuniversitet/Documents/Programs/scenarionet/metadrive/metadrive/utils/config.py", line 226, in __getitem__
self._check_and_raise_key_error(item)
File "/Users/rgu01/Library/CloudStorage/OneDrive-Mälardalensuniversitet/Documents/Programs/scenarionet/metadrive/metadrive/utils/config.py", line 212, in _check_and_raise_key_error
raise KeyError(
KeyError: "'main_camera' does not exist in existing config. Please use config.update(...) to update the config. Existing keys: dict_keys(['lidar', 'side_detector', 'lane_line_detector', 'rgb_camera', 'depth_camera'])."
Do you install from pip
? The PR I merged just now should solve this if you are installing from github... Also, Mac with M chips can not do 3D rendering as the OpenGL is deprecated on MacOS
Yes, pip install -e . I can run "python -m metadrive.examples.profile_metadrive" with no problem. However, neither "python -m metadrive.examples.drive_in_single_agent_env" nor "python -m metadrive.examples.verify_headless_installation" is working.
Do you pull the latest main in the metadrive repo? The latest git log message should be " Fix example (#657)" with commit number "c326ae5f6b409ed90d2bcda8b5bc12689c8c03b5"
Yes, I pulled the latest code, but I did not run "pip install" again. Now the problem is an exception in "Showcase.py", cannot open the window. The detail is as below:
After running "python -m metadrive.examples.drive_in_single_agent_env", I got
[INFO] Environment: MetaDriveEnv
[INFO] MetaDrive version: 0.4.2.3
[INFO] Sensors: [lidar: Lidar(), side_detector: SideDetector(), lane_line_detector: LaneLineDetector(), main_camera: MainCamera(1200, 900), dashboard: DashBoard()]
[INFO] Render Mode: onscreen
[INFO] Horizon (Max steps per agent): None
[INFO] Assets version: 0.4.2.3
:ShowBase(warning): Unable to open 'onscreen' window.
Traceback (most recent call last):
File "
Could it be a MacBook Pro problem?
Yes. As I said before, Mac with M chips can not do 3D rendering for MetaDrive as OpenGL is deprecated on MacOS
Thanks. Is there a way to disable the 3D rendering and keep using the rest of MetaDrive? Now, I simply want to run some examples but have not managed once.
Of course. You can still use the2D renderer. All examples in our documentation are generated with 2D renderer: https://metadrive-simulator.readthedocs.io/ All examples can run on both colab and local machines. They also show you how to use this 2D renderer as well.
Of course. You can still use the2D renderer. All examples in our documentation are generated with 2D renderer: https://metadrive-simulator.readthedocs.io/ All examples can run on both colab and local machines. They also show you how to use this 2D renderer as well.
Perfect. I meant turning on/off the 3D render in your examples, such as python -m metadrive.examples.drive_in_single_agent_env. Anyway, I am running the 2D codes locally on my own laptop. Thanks for the help.
OS: Linux Ubuntu 22.04.3 LTS Processor: Intel® Core™ i5-8250U CPU @ 1.60GHz × 4 Graphics: llvmpipe (LLVM 15.0.7, 256 bits) Virtual machine: Oracle VirtualBox Version 7.0.10 r158379 Environment: miniconda3 Issue: After strictly following the installation steps, running "python -m metadrive.examples.drive_in_single_agent_env" generates the following the errors:
[INFO] Environment: MetaDriveEnv [INFO] MetaDrive version: 0.4.2.3 [INFO] Sensors: [lidar: Lidar(), side_detector: SideDetector(), lane_line_detector: LaneLineDetector(), main_camera: MainCamera(1200, 900), dashboard: DashBoard()] [INFO] Render Mode: onscreen [INFO] Horizon (Max steps per agent): None [INFO] Assets version: 0.4.2.3 Xlib: extension "XFree86-DGA" missing on display ":0". libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
Running the following command can obtain the path of swrast_dri.so in my system: find / -name swrast_dri.so 2>/dev/null Result: /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
"Search paths" seem include the path of swrast_dri.so in my system, but it cannot find the file?