bazel build_opt_gpu failed according to "How to Run Offline Perception LowCost Visualizer (Apollo 2.5)"
First I setup docker environment and ros platform, then build apollo. Second, reference the document "How to Run Offline Perception LowCost Visualizer (Apollo 2.5)" to run " bazel build_opt_gpu", the result is as follows:
root@in_dev_docker:/apollo# bazel build_opt_gpu INFO: Reading 'startup' options from /apollo/tools/bazel.rc: --batch_cpu_scheduling WARNING: ignoring http_proxy in environment. Command 'build_opt_gpu' not found. Try 'bazel help'.
As the hint I tried "bazel help", there is no "build_opt_gpu" command in bazel. Did I miss any steps?
@fatqi that's a good catch! you are right. "build_opt_gpu" is an build option of apollo.sh instead. We fixed this doc. Please try again. Thank you for supporting Apollo!
@jmtao , I use "./apollo.sh build_opt_gpu" instead, it seems worked. But after I execute every steps following the "How to Run Offline Perception LowCost Visualizer (Apollo 2.5)", the result I got is not exactly as the doc introduced. At the last paragraph of the doc says "Now you will see a pop-up window showing the perception result with images frame-by-frame. ". I can see the bag run through http://localhost:8888, but no "pop-up window" displayed on my linux PC. What is the "pop-up window" looks like?
@fatqi The issue is fixed in #4014 , and the doc is updated a little bit with clearer explanation. Thanks!
I am in the same issue. Perception Visualizer don't execute , because glfwcreatewindow() in glfw_fusion_viewer.cc hangs. I guess that it is caused by VisualizationSubnode not being created in main thread.
Hi,
Running GUI tool with GL inside docker is related to GPU driver, so 2 things we can do to solve this:
-
Please run
nvidia-smiinside apollo docker and see if a CUDA enabled GPU driver and device are there on host. Also, it requires the host and docker have the same nvidia driver version. Just install 375.39 on host or reinstall both following this how-to. -
After running those perception 2.5 script with visualization, there should be some warning logs in
data/logsfor perception. You can post those here, and we can take a look
Thanks
I am having the same issue that @fatqi describes.
nvidia-smi seems to work fine. and I have 375.79 installed on host and docker.
I run ./scripts/perception_lowcost_vis.sh
and it seems to run fine, but no pop up window / visualizer appears...
am I supposed to hit "camera sensor" in dreamviewer... when I do that a small empty window appears
these are the only warnings in percetion.warning
W0703 18:35:07.705402 2706 visualization_subnode.cc:170] Failed to find radar_event_id_: vis_driven_event_id:1008;camera_event_id:1008 W0703 18:35:07.705411 2706 visualization_subnode.cc:178] Failed to find fusion_event_id_: vis_driven_event_id:1008;camera_event_id:1008 W0703 18:35:07.705416 2706 visualization_subnode.cc:186] Failed to find cipv_event_id_: vis_driven_event_id:1008;camera_event_id:1008 W0703 18:35:07.705421 2706 visualization_subnode.cc:194] Failed to find motion_event_id_: vis_driven_event_id:1008;camera_event_id:1008 W0703 18:35:07.705425 2706 visualization_subnode.cc:202] Failed to find lane_event_id_: vis_driven_event_id:1008;camera_event_id:1008
@fatqi @poutyface
you guys figure out how to show the visualizer at all?
@fatqi @poutyface @eugenegx
I solved my issues with these. I had a couple. Posting for other people
First, there seems to be a bug in launching the perception module, it never initializes the gl frame viewer. I did some debugging... and found a fix.
this is a quick trace
visualization_subnode.cc ProcEvents() hangs on line 374: ---> if (!SubscribeEvents(event_meta, &events)) {
which causes it to never reach the important line 400: --->frame_visualizer_->init();
The SubscribeEvents function hangs on line 219: ---> while (event_manager_->Subscribe(event_meta.event_id, &event, true)) {
moving over to event_manager.cc function Subscribe on line 83.
This function creates an EventQueue, which seems to be defined in event_manger.h and seems to implement class ConcurrentQueue in modules/perception/lib/base/concurrent_queue.h
I am not sure if its a problem with the class or a glitch with the event manager..
But anyways, the first time the subscribe Queue is called the queue size is 0... (seems odd it should be 1, for the current item??)
but this results in -->queue->pop(event); being called when the queue is empty... which causes it to just stall.
!!TLDR: I fixed this problem by simply adding these lines in event_manager.cc:
--> if (queue->size() == 0) --> return true;
before -->queue->pop(event);
This seems to make the gl visualizer initialize now, but I am worried I am doing other harm.
After this, I still had tons of problems getting the frame visualizer to launch, but atleast I could see the errors which I found to be related to fragile nvidia graphics driver issues. That was a long battle, but found that it is necessary that when installing the Nvidia drivers
./NVIDIA.......etc...
it is necessary to use the --no-opengl-files flag, when installing on both the host and on the docker container...
This readme: https://github.com/ApolloAuto/apollo/blob/master/docs/quickstart/apollo_2_5_hardware_system_installation_guide_v1.md#installing-the-software-for-the-ipc
Should say to include the --no-opengl-files flag
After getting that all sorted out I now have the lowcost perception module running on my computer and can see the visualizer.
I do have one more smaller issue which I posted here: https://github.com/ApolloAuto/apollo/issues/4872