title: Why do OpenGL-based VTK targets in drake executed via `bazel test` sometimes fail on Linux?
body: <p>While a binary works with <code>bazel run</code>, when I run a test using <code>bazel test</code>, such as:</p>
  
  <pre><code>$ bazel test //systems/sensors:rgbd_camera_test
  </code></pre>
  
  <p>I encounter a slew of errors from VTK / OpenGL:</p>
  
  <pre><code>ERROR: In /vtk/Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx, line 820
  vtkXOpenGLRenderWindow (0x55880715b760): failed to create offscreen window
  
  ERROR: In /vtk/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 816
  vtkXOpenGLRenderWindow (0x55880715b760): GLEW could not be initialized.
  
  ERROR: In /vtk/Rendering/OpenGL2/vtkShaderProgram.cxx, line 453
  vtkShaderProgram (0x5588071d5aa0): Shader object was not initialized, cannot attach it.
  
  ERROR: In /vtk/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 1858
  vtkXOpenGLRenderWindow (0x55880715b760): Hardware does not support the number of textures defined.
  </code></pre>
  
  <p>May I ask why this happens?</p>
  
  <p>(Note: This post is a means to migrate from <a href="http://drake.mit.edu/faq.html" rel="nofollow noreferrer">http://drake.mit.edu/faq.html</a> to StackOverflow for user-based questions.)</p>