Updated on | #ati, #fglrx, #apt-get

Hints for Steam with fglrx and nvidia-current in Ubuntu

Linux has been a strategic goal for Valve, since Microsoft is involved in the gaming sector by publishing the Windows 8 Store. Therefore, Valve is clearly looking to have a "reference" gaming platform for Linux, which is called Steam Machine. So, they developed a native Steam client for Linux, that you can use in Ubuntu. This Steam tutorial is more a problem/solution collection about Steam as well as ATI/Nvidia graphic drivers.

Install Steam

  1. cd /tmp && wget http://repo.steampowered.com/steam/archive/precise/steam_latest.deb
  2. sudo apt-get install libpango1.0-0:i386 libgl1-mesa-glx:i386 gdebi-core -y
  3. sudo gdebi steam_latest.deb

Find libraries

  1. LANG=C LD_LIBRARY_PATH=${HOME}/Steam/ubuntu12_32 ldd ${HOME}/Steam/ubuntu12_32/* | grep 'not found'

Which graphic card is installed?

  1. lspci -nnk | grep -i VGA -A2

Install graphic card drivers

Preparations for the driver installation

  1. Install the kernel header
  1. sudo apt-get install --reinstall linux-headers-generic linux-image-generic
  1. VDPAU (Video Decode and Presentation API for Unix):
  1. sudo apt-get install --reinstall libvdpau1 vdpauinfo libva1 libva-x11-1 vdpau-va-driver xvba-va-driver libva-glx1 libva-egl1 vainfo
  1. Edit the environment file:
  1. sudo nano /etc/environment
* **For Nvidia:**
```txt
LIBVA_DRIVERS_PATH=/usr/lib/x86_64-linux-gnu/dri
LIBVA_DRIVER_NAME=nvidia
```

* **For ATI (FGLRX):**
```txt
LIBVA_DRIVERS_PATH=/usr/lib/dri
LIBVA_DRIVER_NAME=fglrx
```
**Other options for ATI**
```bash
sudo aticonfig --sync-vsync=on
sudo aticonfig --set-pcs-u32=MCIL,HWUVD_H264Level51Support,1
sudo aticonfig --set-pcs-val=MCIL,DigitalHDTVDefaultUnderscan,0
```

ATI

Install FGLRX:

  1. sudo apt-get update
  2.  
  3.     sudo apt-get install --reinstall ppa-purge linux-headers-generic linux-image-generic linux-headers-$(uname -r)
  4.     sudo apt-get install --reinstall xserver-xorg-video-ati xserver-xorg-video-radeon
  5.     sudo apt-get install --reinstall fglrx-updates fglrx-amdcccle-updates fglrx-updates-dev
  6.     sudo aticonfig --initial --input=/etc/X11/xorg.conf --adapter=all --force

Reboot your PC and type in

  1. sudo update-alternatives --set gl_conf /usr/lib/fglrx/ld.so.conf
  2.     sudo update-alternatives --install /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf x86_64-linux-gnu_gl_conf /usr/lib/fglrx/ld.so.conf 100 --slave /usr/lib/x86_64-linux-gnu/xorg/extra-modules x86_64-linux-gnu_xorg_extra_modules /usr/lib/fglrx/xorg/modules/
  3.     sudo /usr/lib/fglrx/switchlibGL amd
  4.  
  5.     sudo ldconfig
  6.     sudo update-initramfs -u
  7.     sudo aticonfig --initial --input=/etc/X11/xorg.conf --adapter=all --force

and reboot again.

Install latest FGLRX (für alte Treiber):

  1. sudo add-apt-repository ppa:makson96/fglrx
  2.     sudo apt-get update
  3.     sudo apt-get upgrade
  1. sudo apt-get install --reinstall ppa-purge linux-headers-generic linux-image-generic linux-headers-$(uname -r)
  2.     sudo apt-get install --reinstall xserver-xorg-video-ati xserver-xorg-video-radeon
  3.     sudo apt-get install --reinstall fglrx-legacy
  4.     sudo update-alternatives --set gl_conf /usr/lib/fglrx/ld.so.conf
  5.     sudo ldconfig
  6.     sudo update-initramfs -u
  7.     sudo aticonfig --initial --input=/etc/X11/xorg.conf --force --adapter=all

Rebuild all DKMS Modules

  1. dkms status | sed s/,//g | awk '{print "-m",$1,"-v",$2}' | while read line; do ls /var/lib/initramfs-tools | xargs -n 1 dkms install $line -k; done

Install latest FGLRX beta:

Prerequisite packages
  1. sudo apt-get install build-essential cdbs dh-make dkms
  2. sudo apt-get install execstack dh-modaliases fakeroot libqtgui4
Use Kanotix script to install latest driver

Go into your TMP-Folder and download the script

  1. cd /tmp
  2.     wget http://kanotix.com/files/install-fglrx-debian.sh
  3.     chmod +x install-fglrx-debian.sh
  4.     sudo ./install-fglrx-debian.sh
Enable new settings
  1. sudo aticonfig --initial --input=/etc/X11/xorg.conf --adapter=all --force
Disable AMD Testing use only
  1. sudo bash -c "echo '9777c589791007f4aeef06c922ad54a2:ae59f5b9572136d99fdd36f0109d358fa643f2bd4a2644d9efbb4fe91a9f6590a145:f612f0b01f2565cd9bd834f8119b309bae11a1ed4a2661c49fdf3fad11986cc4f641f1ba1f2265909a8e34ff1699309bf211a7eb4d7662cd9f8e3faf14986d92f646f1bc' & /etc/ati/signature"

Remove FGLRX:

  1. sudo ppa-purge ppa:andrikos/ppa
  2.     sudo ppa-purge ppa:xorg-edgers/ppa
  3.     sudo apt-get update
  4.     sudo sh /usr/share/ati/fglrx-uninstall.sh
  5.     sudo apt-get remove --purge fglrx fglrx_* fglrx-amdcccle* fglrx-dev* xorg-driver-fglrx -y
  6.     sudo apt-get remove --purge fglrx-updates fglrx-amdcccle-updates -y
  7.     sudo apt-get remove --purge xserver-xorg-video-ati xserver-xorg-video-radeon -y
  8.     sudo dkms -r fglrx --all
  9.     sudo update-alternatives --remove-all x86_64-linux-gnu_gl_conf
  10.     sudo apt-get install xserver-xorg-video-ati -y
  11.     sudo apt-get install --reinstall libgl1-mesa-glx libgl1-mesa-dri xserver-xorg-core -y
  12.     sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
  13.     sudo dpkg-reconfigure xserver-xorg
  14.     sudo rm -R /usr/lib/fglrx
  1. sudo update-alternatives --display gl_conf
  2.     sudo update-alternatives --config gl_conf
  3.     sudo ldconfig
  4.     sudo update-initramfs -u

Test FGLRX:

fglrxinfo
  1. fglrxinfo
    display: :0  screen: 0
    OpenGL vendor string: Advanced Micro Devices, Inc.
    OpenGL renderer string: AMD Radeon HD 7700 Series 
    OpenGL version string: 4.2.11903 Compatibility Profile Context
glxgears
  1. glxgears
    6275 frames in 5.0 seconds = 1254.812 FPS
    6542 frames in 5.0 seconds = 1308.301 FPS
    6495 frames in 5.0 seconds = 1298.938 FPS
vainfo
  1. vainfo
    libva: VA-API version 0.32.0
    libva: User requested driver 'fglrx'
    libva: Trying to open /usr/lib/x86_64-linux-gnu/dri/fglrx_drv_video.so
    libva: va_openDriver() returns 0
    vainfo: VA-API version: 0.32 (libva 1.0.15)
    vainfo: Driver version: Splitted-Desktop Systems XvBA backend for VA-API - 0.7.8
    vainfo: Supported profile and entrypoints
          VAProfileH264High               : VAEntrypointVLD
          VAProfileVC1Advanced            : VAEntrypointVLD

Optimize ATI-Driver

  • Script for High-GPU-Mode
    • Activate High-Performance mode
  1. #!/bin/bash
  2.     sudo aticonfig --px-dgpu
  3.     sudo aticonfig --pplib-cmd "set fanspeed 0 100"
  4.     /* aticonfig --od-setclocks=coreclock,memclock */
  5.     sudo aticonfig --od-enable --odsc=920,1245
  6.     sudo aticonfig --odgc --odgt
- **Power-Saving mode**  
  1. #!/bin/bash
  2.     sudo aticonfig --od-restoredefaultclocks --od-disable --px-igpu
  3.     sudo aticonfig --od-getclocks --odgt
  4.     sudo restart lightdm
- **Show current GPU-Mode**  
  1. #!/bin/bash
  2.     aticonfig --od-getclocks --pxl --odgt

ATI Problems

  • Rescue Ubuntu Standard Environment
  1. sudo apt-get update
  2.     sudo apt-get install ubuntu-desktop
  3.     sudo dpkg-reconfigure ubuntu-desktop
  • VDPAU Symlink
  1. cd /usr/lib/dri; sudo ln -s /usr/lib/va/drivers/fglrx_drv_video.so fglrx_drv_video.so

Nvidia

> Links: * https://wiki.archlinux.org/index.php/NVIDIA

> Install:

  1. sudo apt-add-repository ppa:xorg-edgers/ppa
  2.     sudo apt-get update
  3.  
  4.     sudo apt-get install --reinstall nvidia-current mesa-utils
  5.     update-alternatives --display nvidia_settings_conf

Alternative:

  1. sudo ppa-purge ppa:xorg-edgers/ppa
  2.     sudo apt-get install linux-source
  3.     sudo apt-get install linux
  4.     sudo apt-get autoremove nvidia-current
  5.     sudo apt-get install --reinstall xserver-xorg xserver-xorg-video-all
  6.  
  7.     sudo apt-add-repository ppa:noobslab/nvidia-quantal
  8.     sudo apt-get update
  9.     sudo apt-get install nvidia-current
  10.     sudo reboot

Nvidia X11 Options

  1. sudo gedit /etc/X11/xorg.conf
  1. Option "Coolbits" "1"   # GPU-Takt manipulieren
  2.     Option "Coolbits" "4"   # Enable Fan Control
  3.     Option "TripleBuffer" "True"    # Allocate less memory buffers to 2D playback (and more to 3D)

Uninstall

  1. sudo ppa-purge ppa:andrikos/ppa
  2.     sudo ppa-purge ppa:xorg-edgers/ppa
  3.     sudo apt-get update && sudo apt-get autoremove && sudo apt-get clean
  4.     sudo dkms remove nvidia
  5.  
  6.     sudo apt-get remove --purge nvidia-experimental-* nvidia-current nvidia-common nvidia-settings-experimental-* nvidia-*
  7.     sudo update-alternatives --remove-all x86_64-linux-gnu_gl_conf
  8.     sudo update-alternatives --remove-all i386-linux-gnu_gl_conf
  9.  
  10.     sudo apt-get install --reinstall xserver-xorg-video-nouveau
  11.     sudo dpkg-reconfigure xserver-xorg

Nvidia Errors

> overlay-scrollbar: Scrollbar overlay
> overlay-scrollbar-gtk2: GTK 2 module for overlay scrollbars
> overlay-scrollbar-gtk3: GTK 3 module for overlay scrollbars

  1. gsettings reset com.canonical.desktop.interface scrollbar-mode
  2.     gsettings set com.canonical.desktop.interface scrollbar-mode normal
  • Get OpenGL Version
  1. glxinfo | grep "OpenGL version"
  • Get installed nvidia drivers
  1. dpkg -l | grep nvidia | grep "^i"
  • Get the amount of VRAM currently in use (nvidia/ubuntu)
  1. nvidia-smi -a | grep Used
  2.     grep -i --color memory /var/log/Xorg.0.log
  • Get Direct Rendering Status
  1. glxinfo | grep direct
  • LIBVA - vainfo
  1. LIBVA_DRIVERS_PATH=/usr/lib/x86_64-linux-gnu/dri
  2.     LIBVA_DRIVER_NAME=nvidia
  3.     UNITY_FORCE_START=1
  1. vainfo
  2.     vdpauinfo
  • Steam
  1. LD_PRELOAD="libpthread.so.0 libGL.so.1 /home/thomas/Steam/ubuntu12_32/gameoverlayrenderer.so" __GL_THREADED_OPTIMIZATIONS=1 steam
  • Get Error: FATAL: Could not load /lib/modules/3.7.0-7-generic/modules.dep: No such file or directory
  1. sudo update-initramfs -d -k 3.7.0-7-generic

Unity

fglrx is working but Unity Panel is missing

I got this error. You can test if your fglrx renderer is working with:

  1. fglrxinfo
display: :0  screen: 0
OpenGL vendor string: Advanced Micro Devices, Inc.
OpenGL renderer string: AMD Radeon HD 7700 Series   
OpenGL version string: 4.3.12798 Compatibility Profile Context 13.35.1005
  1. glxinfo | grep renderer

OpenGL renderer string: AMD Radeon HD 7700 Series

The renderer is working but Unity don't wants to show it's panel. So, open a shell and check if compiz and opengl is working.

  1. compiz --replace &
compiz (core) - Info: Loading plugin: core
compiz (core) - Info: Starting plugin: core
compiz (core) - Info: Loading plugin: ccp
compiz (core) - Info: Starting plugin: ccp
compizconfig - Info: Backend : gsettings
compizconfig - Info: Integration : true
compizconfig - Info: Profile : unity
compiz (core) - Info: Loading plugin: composite
compiz (core) - Info: Starting plugin: composite
compiz (core) - Error: Plugin 'opengl' not loaded.

If you get this output, there could be a problem with your cache. At first you have to check the unity compatibility with:

  1. /usr/lib/nux/unity_support_test -p
OpenGL vendor string:   ATI Technologies Inc.
OpenGL renderer string: AMD Radeon HD 7700 Series   
OpenGL version string:  4.3.12798 Compatibility Profile Context 13.35.1005

Not software rendered:    yes
Not blacklisted:          yes
GLX fbconfig:             yes
GLX texture from pixmap:  yes
GL npot or rect textures: yes
GL vertex program:        yes
GL fragment program:      yes
GL vertex buffer object:  yes
GL framebuffer object:    yes
GL version is 1.4+:       yes

Unity 3D supported:       yes

At this point in time we know that the renderer as well as unity is working. Furthermore, we know that compiz is not initialize OpenGL. In this case, you have to reset unity by using

  1. gsettings reset-recursively org.compiz

and

  1. setsid unity
  2. unity --reset-icons

If this is working, you have finish your session (logout) and to login again. Now, it should be work.

Find Low-Profile and Single Slot graphic cards