Steam for Linux on Optimus enabled computer running Ubuntu 12.04 64bits

steam-linux

Install Bumblebee

First step is to make Optimus work. We will use a Software called Bumblebee for that.

1) Install Bumblebee and the nVidia propietary driver

sudo add-apt-repository ppa:bumblebee/stable
sudo add-apt-repository ppa:ubuntu-x-swat/x-updates
sudo apt-get update
sudo apt-get install bumblebee bumblebee-nvidia

Commands explained:

  • Add Bumblebee PPA (Personal Package Archive) to Ubuntu so you can download Bumblebee.
  • Add the drivers updates PPA so you can download the lastest nVidia driver.
  • Update the repository index with the two newly added sources.
  • Install Bumblebee and the package to support nVidia Optimus using the proprietary nVidia driver.

2) Reboot

Seriously.

3) Test Bumblebee

glxspheres

You should get something like this:

OpenGL Renderer: Mesa DRI Intel(R) Sandybridge Mobile
58.335930 frames/sec - 56.737059 Mpixels/sec
57.184303 frames/sec - 55.616995 Mpixels/sec

That is, you are rendering some graphics using the low power video card. Now:

optirun glxspheres

You should get something like this:

OpenGL Renderer: GeForce GT 525M/PCIe/SSE2
108.236036 frames/sec - 105.269502 Mpixels/sec
111.096688 frames/sec - 108.051750 Mpixels/sec
115.719165 frames/sec - 112.547535 Mpixels/sec

That is, you are now rendering some graphics using the high power video card.

Install Primus

The problem with optirun is the use of VirtualGL. VirtualGL has a huge overhead and thus impact on the performance. For a more technical description check this link: http://www.webupd8.org/2012/11/primus-better-performance-and-less.html

There is another alternative: Primus. Primus runs on top of Bumblebee and improves performance a lot.

1) Install Primus

sudo add-apt-repository ppa:zhurikhin/primus
sudo apt-get update
sudo apt-get install primus

Commands explained:

  • Add Primus PPA (Personal Package Archive) to Ubuntu so you can download it.
  • Update the repository index with the newly added sources.
  • Install Primus.

2) Test Primus

vblank_mode=0 primusrun glxspheres

You should get something like this:

OpenGL Renderer: GeForce GT 525M/PCIe/SSE2
214.447849 frames/sec - 208.570262 Mpixels/sec
220.159208 frames/sec - 214.125085 Mpixels/sec
220.226968 frames/sec - 214.190987 Mpixels/sec

Yeah. That’s a huge performance boost.

(Optional) Install nVidia experimental drivers 310

This are supposed to even double the performance of the nVidia card.

1) Install new driver

sudo apt-get install nvidia-experimental-310 nvidia-settings-experimental-310

2) Configure Bumblebee and Primus

Just follow the instructions here:

http://www.webupd8.org/2012/12/use-nvidia-experimental-drivers-310.html

When finished, RESTART. Seriously, you need to restart the X Window server.

3) Test new driver

vblank_mode=0 primusrun glxspheres

You should get something like this:

OpenGL Renderer: GeForce GT 525M/PCIe/SSE2
272.052255 frames/sec - 264.595847 Mpixels/sec
270.377649 frames/sec - 262.967139 Mpixels/sec
270.206138 frames/sec - 262.800328 Mpixels/sec

Yeah. That’s another huge performance boost.

Install Steam

1) Install Downloader

wget http://media.steampowered.com/client/installer/steam.deb
sudo apt-get install gdebi-core
sudo gdebi steam.deb

Commands explained:

  • Download oficial Steam downloader package.
  • Install GDebi to handle dependencies of local Debian packages.
  • Install the Steam downloader.

2) Run Steam

Well, do that. Steam will download and install the real Steam client in the
folder ~/.local/share/Steam.

3) Temporaly fix bug #312 “Failed to load steamui.so”

steam-error

This seem to happen on every 64bits OS. Full bug report here:

https://github.com/ValveSoftware/steam-for-linux/issues/321

Solution:

sudo nano /etc/ld.so.conf.d/steam.conf

Add next two lines to file:

/usr/lib32
/usr/lib/i386-linux-gnu/mesa

Then execute:

sudo ldconfig

Now you should be able to run Steam. Login with your account, confirm the new computer, etc, etc. Close Steam: Steam > Exit.

Install Flash for Steam

  1. Make sure you have libxt6:i386 installed.
  2. Go to your Home folder, unhide hidden files (Ctrl-H) and go to .local/share/Steam/ubuntu12_32/.
  3. Create a folder called “plugins”.
  4. Download Flash player plugin for Linux 32bits from:
    http://get.adobe.com/flashplayer/otherversions/
  5. Select the “.tar.gz” download. Open the downloaded file and extract file called libflashplayer.so to the plugins folder created before.

This will make Flash movies in the store work, but slow as hell in some situations.

In commands:

sudo apt-get install libxt6:i386
mkdir -p ~/.local/share/Steam/ubuntu12_32/plugins
wget -qO- https://get.adobe.com/de/flashplayer/completion/?installer=Flash_Player_11.2_for_other_Linux_%28.tar.gz%29_32-bit | awk -F\' '/location.href/{print $2}'| sed s/http:/https:/ | wget -i- -qO- | tar zxvC ~/.local/share/Steam/ubuntu12_32/plugins libflashplayer.so

(Thanks to user Kano from the Steam forums and Alessio Gaeta for those commands).

Test that videos are working. Again close Steam: Steam > Exit.

(Optional) Move Steam library to another partition/HD

If like me you have a hard drive or partition specific for Steam or multimedia, you can move your Steam installation and games to that drive. To do so:

Move the library and installation folder

mv ~/.local/share/Steam /media/<your-device>/Steam

In my case:

mv ~/.local/share/Steam /media/Black/GNU-Linux/Steam
cd ~/.local/share/
ln -s /media/<your-device>/Steam/ .

Now try restarting Steam.

(Optinal) Configure NTFS partition

If you want to have the Steam library on a NTFS partition make sure that the volume is being mounted with your uid and gid AND files needs to be executable by you or your group, if not, Steam will not even start, and if starts, some games will not work.

If you are getting the dialog that Steam cannot find the library and you have an NTFS partition this should be the main cause.

Note: If setting the execution bit for all the files is too much for you, you can configure the NTFS partition to allow POSIX permissions like ext2/3/4. Is much more advanced (not that much), for more information about this option see:

For removable devices

To configure those settings to ONLY that drive and partition, install the utility udisks-glue and configure it:

sudo apt-get install udisks-glue
nano ~/.udisks-glue.conf

And put:

filter steam {
    optical = false
    partition_table = false
    usage = filesystem
    type = ntfs
    uuid = 40DC5EC613CFD8EB
}

match steam {
    automount = true
    automount_options = { 'dmask=000', 'fmask=000' }
}

Change the uuid token with the UUID of your drive. To know it type once is mounted:

sudo blkid

Finally make udisks-glue to start when the user logs in:

nano ~/.config/autostart/udisks-glue.desktop

And put:

[Desktop Entry]
Type=Application
Name=udisks-glue
Exec=udisks-glue
Comment=udisks-glue is a daemon that can perform user-configurable actions when a certain udisks event is detected
X-GNOME-Autostart-enabled=true

Note: Thas was tested on a NTFS USB 3.0 attached 7200rpm/32MB 3Gbps 1TB drive. My laptop has a 256GB internal SSD.

For static devices

Just edit the file /etc/fstab like this:

UUID=40DC5EC613CFD8EB /media/Black ntfs-3g defaults,uid=1000,gid=1000,dmask=000,fmask=000 0 0

Change the UUID and the mount point. To know them type once is mounted:

sudo blkid

Run Steam games using Primus

As you may have deducted, when you run Steam you’re running it with the low power graphics card. You can launch Steam with your high power graphic card using primusrun:

primusrun steam

This is only useful if you’re planning to use the Big Picture Mode. If not, don’t, is not necessary at all. What is absoluty necessary is to run some games with your high power nVidia graphics card. To do so, do the following.

(Relatively official instructions from http://steamcommunity.com/app/221410/discussions/6/846939854395110175/)

1) Add the OPTIMUS_PREFIX variable to your environment

sudo sh -c 'echo OPTIMUS_PREFIX=\"primusrun\" >> /etc/environment'

2) Logout and login from you session

Seriously. Desktop session, not Steam session. Steam is closed.

3) Configure each game you want

For each game you want to launch using you high powered nVidia card do:

  1. Select a game from the Library page of the Steam client, right-click, and
    select Properties.
  2. Click the SET LAUNCH OPTIONS button and specify $OPTIMUS_PREFIX %command%
    for the command line.
  3. Save your changes.

Post created using Nested: http://nestededitor.sourceforge.net/

Etiquetado , , , ,

28 thoughts on “Steam for Linux on Optimus enabled computer running Ubuntu 12.04 64bits

  1. Great post, thanks! Even though installing flashplayer 32 bit on 64 bit systems doesn’t ever work. You may need to install libxt6:i386 (I had on Xubuntu 12.10):

    $ sudo apt-get install libxt6:i386

    You can track missing dependencies running:

    $ ldd ~/.local/share/Steam/ubuntu12_32/plugins/libflashplayer.so

    Thanks again!

  2. mid-kid dice:

    bookmark’d and shared :D awesome post

  3. This guide is amazing. I was planning on installing Linux Mint 14 on my computer though. I believe that is based off of Ubuntu 12.10, do you think I would have similar results? Or would I be better off going with LM 13, which is based off of Ubuntu 12.04

    • cjenkins dice:

      No way I can answer your question. Just try, and post your results here or any problem you might encounter. I would first that you analyse what’s the difference in Software between 12.04-12.10. I don’t use Unity, I use Gnome, so for me there is no real advantage or new thing in 12.10, and I like LTS versions.

  4. I’ve run into a couple issues getting Bumble bee going, at first it was saying it could not access gpu or something similar when I ran optirun glxspheres, now I get

    Polygons in scene: 62464
    Error: nConfigOptions (16) does not match the actual number of options in
    __driConfigOptions (10).
    Visual ID of window: 0x20
    Context is Direct
    OpenGL Renderer: Gallium 0.4 on llvmpipe (LLVM 3.2, 256 bits)
    X Error of failed request: BadMatch (invalid parameter attributes)
    Major opcode of failed request: 72 (X_PutImage)
    Serial number of failed request: 33
    Current serial number in output stream: 51

    at the same time the screen gets all pixelated and broken for about 10-15 seconds. I assume I’m getting warmer lol, hoping I’m only a tweak or 2 away from success, just not sure what I need to do next

    • cjenkins dice:

      “OpenGL Renderer: Gallium 0.4 on llvmpipe” means you’re using the free Software nouveau drivers, not the nvidia propietary ones. That’s why you are having trouble. This tutorial is for propietary video drivers, so I cannot help you. Try to unistall the nouveau drives and then follow this guide.

  5. Carl dice:

    Thanks for this! The NTFS Library issue was giving me hell and I was going mad trying to find a solution in the steam git or in the steam forums. Now I found this and I am very happy!

    Thank you very much!

  6. Thank you SO MUCH!! Perfect!

  7. Toxic Noodles dice:

    cjenkins, can you help me? When i’m testing Primus, my shown videocard is Intel Sandybridge-something. When I was testing Bumblebee with optirun, There was NVidia. Any suggestions?

    P. S. Sorry for my English.

  8. […] my graphics card is an optimus enabled, I followed this wonderful post (http://cjenkins.wordpress.com/2013/01/01/steam-for-linux-on-optimus-enabled-computer-running-ubuntu-&#8230 ;) in which this guy explains how to use your discrete nvidia card to run steam for linux. He states […]

  9. Luiz Augusto dice:

    So, I tried to run Trine 2 in my computer dell xps l502x and it was very slow, do you know what I did worng?

  10. skarmiglione dice:

    Why optirun work with nvidia driver and primusrun no?

    optirun glxspheres
    Polygons in scene: 62464
    Visual ID of window: 0x21
    Context is Direct
    OpenGL Renderer: GeForce GT 520M/PCIe/SSE2
    112.903552 frames/sec – 109.192186 Mpixels/sec
    119.953827 frames/sec – 116.010704 Mpixels/sec
    123.161521 frames/sec – 119.112956 Mpixels/sec
    122.260190 frames/sec – 118.241253 Mpixels/sec
    122.287805 frames/sec – 118.267960 Mpixels/sec
    ^C[16698.681479] [WARN]Received Interrupt signal.

    $ primusrun glxspheres
    Polygons in scene: 62464
    Visual ID of window: 0x21
    Context is Direct
    OpenGL Renderer: Mesa DRI Intel(R) Sandybridge Mobile
    59.503774 frames/sec – 57.547766 Mpixels/sec

    i dont understand, when i edit primusrun i read there are configure with driver nvidia… dont understand what happen here.

    • cjenkins dice:

      Please re-read the primusrun section of the article. Command is:

      vblank_mode=0 primusrun glxspheres

      The vblank is important because it set the synchronization with the screen refresh rate off. Your screen is 60Hz, that’s why you get ~60Hz frame rate.

      • skarmiglione dice:

        vblank_mode=0 primusrun glxspheres
        Polygons in scene: 62464
        ATTENTION: default value of option vblank_mode overridden by environment.
        ATTENTION: default value of option vblank_mode overridden by environment.
        Visual ID of window: 0x20
        Context is Direct
        OpenGL Renderer: Mesa DRI Intel(R) Sandybridge Mobile
        196.329126 frames/sec – 219.103304 Mpixels/sec
        183.515517 frames/sec – 204.803317 Mpixels/sec
        185.700660 frames/sec – 207.241937 Mpixels/sec
        181.653826 frames/sec – 202.725670 Mpixels/sec

        why it say are sandybridge mobile? i need nvidia OpenGL Renderer: GeForce GT 520M/PCIe/SSE2

        sorry my english

      • cjenkins dice:

        I need to update this entry, but current way to test optimus using primus is:

        vblank_mode=0 optirun -b primus glxspheres

        Try that and tell me. If do you still have problems I suggests you to ask the developers on GitHub:

        https://github.com/amonakov/primus

    • skarmiglione dice:

      vblank_mode=0 optirun -b primus glxspheres
      Polygons in scene: 62464
      ATTENTION: default value of option vblank_mode overridden by environment.
      ATTENTION: default value of option vblank_mode overridden by environment.
      Visual ID of window: 0x20
      Context is Direct
      OpenGL Renderer: GeForce GT 520M/PCIe/SSE2
      ATTENTION: default value of option vblank_mode overridden by environment.
      ATTENTION: default value of option vblank_mode overridden by environment.
      131.175385 frames/sec – 146.391729 Mpixels/sec
      137.314684 frames/sec – 153.243188 Mpixels/sec

  11. 10 dice:

    I can’t input anything in the steam ,please help me

  12. Siddharth dice:

    [ 213.568492] [ERROR]The Bumblebee daemon has not been started yet or the socket path /var/run/bumblebee.socket was incorrect.
    [ 213.568602] [ERROR]Could not connect to bumblebee daemon – is it running?

  13. Siddharth dice:

    this error occurs when i try to run “optirun glxspheres64″
    “glxspheres64″ is running fine.

    [ 213.568492] [ERROR]The Bumblebee daemon has not been started yet or the socket path /var/run/bumblebee.socket was incorrect.
    [ 213.568602] [ERROR]Could not connect to bumblebee daemon – is it running?

  14. markus dice:

    Thank you very much for this guide!

  15. sistyN dice:

    Thank you for this guide, but I have a problem, I want to change steam library to my external HD, I followed your guide, But it doesn’t work. It still show me “New steam library folder must be on a filesystem mounted with execute permission.”
    I even restarted OS but nothing changed.

Deja un comentario

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s

Seguir

Recibe cada nueva publicación en tu buzón de correo electrónico.

%d personas les gusta esto: