grafana / grafana-image-renderer

A Grafana backend plugin that handles rendering of panels & dashboards to PNGs using headless browser (Chromium/Chrome)
Apache License 2.0
385 stars 156 forks source link

Error loading shared library /usr/lib/chromium/swiftshader/libGLESv2.so #251

Open anuj9196 opened 3 years ago

anuj9196 commented 3 years ago

What happened: Setup renderer as in the demo

version: '3.7'

services:
  grafana:
    image: grafana/grafana:8.0.1
    container_name: grafana
    volumes:
    - grafana_storage:/var/lib/grafana
    environment:
      GF_INSTALL_PLUGINS: 'grafana-synthetic-monitoring-app,grafana-worldmap-panel'
      GF_RENDERING_SERVER_URL: http://renderer:8081/render
      GF_RENDERING_CALLBACK_URL: http://grafana:3000/
      GF_LOG_FILTERS: rendering:debug
    restart: always

  renderer:
    image: grafana/grafana-image-renderer:latest
    container_name: renderer
    ports:
      - 8081
    environment:
      ENABLE_METRICS: 'true'
      RENDERING_DUMPIO: 'true'

volumes:
  caddy_data:

While building the docker container, it produces the error

renderer    | {"collectDefaultMetrics":true,"requestDurationBuckets":"1,5,7,9,11,13,15,20,30","level":"info","message":"Metrics enabled"}
renderer    | {"level":"info","message":"HTTP Server started, listening at http://localhost:8081"}
renderer    | [0613/014350.956606:WARNING:dns_config_service_linux.cc(464)] Failed to read DnsConfig.
renderer    | [0613/014350.961985:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
renderer    | [0613/014350.968960:ERROR:gl_implementation.cc(394)] Failed to load /usr/lib/chromium/swiftshader/libGLESv2.so: Error loading shared library /usr/lib/chromium/swiftshader/libGLESv2.so: No such file or directory
renderer    |
renderer    | DevTools listening on ws://127.0.0.1:39205/devtools/browser/b650696c-18f0-4643-83d6-ee59999ab52b
renderer    | [0613/014351.000009:ERROR:viz_main_impl.cc(160)] Exiting GPU process due to errors during initialization
renderer    | [0613/014351.023270:ERROR:gl_implementation.cc(394)] Failed to load /usr/lib/chromium/swiftshader/libGLESv2.so: Error loading shared library /usr/lib/chromium/swiftshader/libGLESv2.so: No such file or directory
renderer    | [0613/014351.038184:ERROR:viz_main_impl.cc(160)] Exiting GPU process due to errors during initialization
renderer    | [0613/014351.054860:WARNING:vaapi_wrapper.cc(588)] VAAPI video acceleration not available for disabled
renderer    | [0613/014351.054981:ERROR:gpu_init.cc(440)] Passthrough is not supported, GL is disabled

What you expected to happen: The container should be built and image should be created

How to reproduce it (as minimally and precisely as possible): Use the above docker-compose configuration to build and run the container

Anything else we need to know?:

Environment:

AgnesToulet commented 3 years ago

It seems like these are GPU errors. Could you upgrade to the latest version (3.1.0) or add the following env variable to your renderer service: RENDERING_ARGS=--no-sandbox,--disable-gpu to see if it's enough to make all these errors disappear?

Paul-Sorensen-Checkfront commented 3 years ago

I have upgraded to Grafana 8.1.3 and grafana-renderer-3.1.0

% kubectl logs grafana-0 -n prometheus -c grafana-image-renderer         
{"collectDefaultMetrics":true,"requestDurationBuckets":"1,5,7,9,11,13,15,20,30","level":"info","message":"Metrics enabled"}
{"config":{"chromeBin":"/usr/bin/chromium-browser","args":["--no-sandbox","--disable-setuid-sandbox","--disable-dev-shm-usage","--disable-accelerated-2d-canvas","--disable-gpu","--remote-debugging-port=9222"],"ignoresHttpsErrors":false,"acceptLanguage":null,"width":1000,"height":500,"deviceScaleFactor":1,"maxWidth":3080,"maxHeight":3000,"maxDeviceScaleFactor":4,"mode":"default","clustering":{"mode":"browser","maxConcurrency":5},"verboseLogging":true,"dumpio":true,"timingMetrics":false},"level":"debug","message":"Browser initialized"}
{"level":"info","message":"HTTP Server started, listening at http://localhost:8081"}
[0914/183541.582739:WARNING:dns_config_service_linux.cc(470)] Failed to read DnsConfig.
[0914/183541.582853:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory

DevTools listening on ws://127.0.0.1:9222/devtools/browser/4d254f19-d9f5-4ae1-a2f8-b82184d941f7
[0914/183541.612771:ERROR:gl_implementation.cc(407)] Failed to load /usr/lib/chromium/swiftshader/libGLESv2.so: Error loading shared library /usr/lib/chromium/swiftshader/libGLESv2.so: No such file or directory
[0914/183541.613587:ERROR:zygote_host_impl_linux.cc(263)] Failed to adjust OOM score of renderer with pid 38: Permission denied (13)
[0914/183541.624827:ERROR:viz_main_impl.cc(162)] Exiting GPU process due to errors during initialization
[0914/183541.637216:ERROR:zygote_host_impl_linux.cc(263)] Failed to adjust OOM score of renderer with pid 52: Permission denied (13)
[0914/183541.638977:WARNING:vaapi_wrapper.cc(588)] VAAPI video acceleration not available for disabled
[0914/183541.641487:ERROR:gpu_init.cc(441)] Passthrough is not supported, GL is disabled