apollo icon indicating copy to clipboard operation
apollo copied to clipboard

GLFWwindow does not pop up with CameraProcessSubnode and VisualizationSubnode

Open wardenLL opened this issue 7 years ago • 7 comments

System information

  • OS Platform: Linux Ubuntu 16.04:
  • Apollo installed from source:
  • Apollo version 3.0:

Steps to reproduce the issue:

  • Host machine and docker both install Nvidia driver: 415.27 GPU: Quadro M2000M already checked with nvidia-smi
  • in apollo/docker/scripts: ./dev_start.sh -l -t local_dev
  • in apollo/docker/scripts: ./dev_into.sh
  • in /apollo:(in docker) ./apollo.sh build_opt_gpu
  • in and out docker, update the glfw lib to version 3.2.1
  • **add glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API); according to the official doc
  • finished build successfully
  • ** subnode_config { subnodes { id: 3 name: "CameraProcessSubnode" reserve: "device_id:camera;pb_obj:1;pb_ln_msk_:0;" type: SUBNODE_IN } subnodes { id: 41 name: "VisualizationSubnode" reserve: "vis_driven_event_id:1008;camera_event_id:1008" } } edge_config { edges { id: 108 from_node: 3 to_node: 41 events { id: 1008 name: "camera_visualization" } } } data_config { datas { id: 5 name: "CameraObjectData" } datas { id: 7 name: "CameraSharedData" } }

**

  • modules/perception/obstacle/camera/visualizer/glfw_fusion_viewer.cc: in GLFWFusionViewer::window_init(): window_ = glfwCreateWindow(win_width_, win_height_, "gl_camera_visualizer", nullptr, nullptr); if (window_ == nullptr) { AERROR << "Failed to create glfw window!"<<std::endl; glfwTerminate(); return false; }

Supporting materials (screenshots, command lines, code/script snippets):

wardenLL avatar Mar 05 '19 12:03 wardenLL

@wardenLL have you tried running this guide. It should resolve your error. Let me know if you still see it.

natashadsouza avatar Mar 05 '19 22:03 natashadsouza

@natashadsouza I have tried the guide you mentioned. But still see the issue. #1832 May be this issue is similar to mine. So I would like to know the root cause of it. Can anyone help me?

wardenLL avatar Mar 06 '19 00:03 wardenLL

I add the glfw error handling code as this GLFW error handling

void glfw_error_callback(int error, const char* description){
    std::string s(description);
    AERROR<<s<<std::endl;
}
glfwSetErrorCallback(glfw_error_callback);

The error code is :

EGL: Library not found

So How can I find the EGL library Here is a reference : EGL problem As our docker seems not an official nvidia-release one, the solution in it seems don't work for me.

wozaiqufu avatar Mar 06 '19 09:03 wozaiqufu

@wardenLL please try @wozaiqufu suggestion. Also try reinstalling drivers with --no-opengl-files. Let me know if it still does not work out.

natashadsouza avatar Mar 11 '19 23:03 natashadsouza

Hi, I think the problem is you didn't install the glfw correctly, since the official doc is really simple, it doesn't give many details regarding how to install glfw in apollo docker. Here is what you need to do(all the steps below are taken in apollo docker environment):

  1. Remove the old version of glfw(sudo apt-get remove libglfw3), then do: ldconfig To check if you remove it or not, use ldconfig -p | grep glfw*, if there is no output, it means you remove it correctly.
  2. Install glfw using source code with BUILD_SHARED_LIBS is ON: Download glfw and put it in /apollo, cd glfw and: modify the CMakeList file to change BUILD_SHARED_LIBS from OFF to ON; mkdir glfw-build sudo cmake ../ sudo make sudo make install sudo ldconfig Then use "ldconfig -p | grep glfw*" to check if it is installed correctly.
  3. Change the code of glfw_.cc(can't remember the exact name of file, check official help), you may also need to change the directory of glfw header file in glfw_.h to make it compile
  4. Then: ./apollo.sh clean ./apollo.sh build_gpu It's all done, I think it'll work.

hzdsdhr avatar Mar 14 '19 00:03 hzdsdhr

@hzdsdhr thank you so much for the steps. We will include it in our documentation should that be okay with you :) Fee; free to make a Pull request too.

natashadsouza avatar Mar 15 '19 23:03 natashadsouza

@wozaiqufu Hi I think I've found the solution for your problem. It's a libGL link problem, you need to make sure the libGL linked to correct .so file. You can do below: 1.Install nvidia-384-dev in docker(sudo apt-get install nvidia-384-dev(or whatever version you install for GPU). 2. Check libGL link using: sudo ldconfig -p | grep libGL(make sure libGL linked to correct .so file in gpu driver directory). 3. Reinstall GPU driver following official docs: how_to_run_perception_on_local_computer in docker. That's all. Then you'll see the pop out window.

hzdsdhr avatar Apr 08 '19 03:04 hzdsdhr