What is the best way to start a Steam game on a NVIDIA Optimus laptop with Ubuntu 12.04 installed and the latest version of bumblebee installed?

If I call Steam with optirun steam and then choose the game I want to play, I get the following error:

The program 'hl2_linux' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadDrawable (invalid Pixmap or Window parameter)'.
  (Details: serial 125 error_code 9 request_code 14 minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
Missing shutdown function for DevShotGenerator_Init() : DevShotGenerator_Shutdown()
Missing shutdown function for MapReslistGenerator_Init() : MapReslistGenerator_Shutdown()
Missing shutdown function for COM_InitFilesystem( m_StartupInfo.m_pInitialMod ) : COM_ShutdownFileSystem()
Missing shutdown function for Steam3Client().Activate() : Steam3Client().Shutdown()
/home/user/.local/share/Steam/SteamApps/user/Team Fortress 2/hl2.sh: line 72: 20567 Segmentation fault      (core dumped) ${GAME_DEBUGGER} "${GAMEROOT}"/${GAMEEXE} "$@"
Game removed: AppID 440 "Team Fortress 2", ProcID 20567 
saving roaming config store to 'sharedconfig.vdf'
roaming config store 2 saved successfully
^C[68042.116376] [WARN]Received Interrupt signal.

If I run steam without the optirun option, I can go a little further into running the game, hearing the starting music on a black screen, but still fails later on in the process.

Should I call the game I want to play with a special optirun command instead of optirun steam?


Valve recommends using primusrun for running Steam games on the NVIDIA GPU.

See the following guide for help on doing so:


  • Thanks, primusrun steam worked wonderfully. – 719016 Feb 16 '13 at 3:53

Check these links - You need to change game properties as shown below

  • Right click on TF2 in your library
  • Click Properties
  • Click Set Launch Options
  • If you only have optirun, enter: optirun %command%

The above did not work for me and I had to set the launch options as

LD_PRELOAD="libpthread.so.0 libGL.so.1" __GL_THREADED_OPTIMIZATIONS=1 optirun %command% 

Check these discussions:

If this does not work download the hl2-optirun.sh to below location and run it.

/home/user/Steam/SteamApps/'account_name'/Team Fortress 2/
  • The LD_PRELOAD… options works for me, as does hl2-optirun.sh. Neither of the official options work. (I'm using a Dell XPS 17 L702X.) – Sparhawk Mar 11 '13 at 23:42
  • 1
    Your second command worked for me too (with Dota 2). Thank you! – Salvatorelab Sep 16 '13 at 19:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.