How can I enable hardware acceleration for an ATI Radeon HD?

When playing high definition video (720p and 1080p) the CPU reaches 100% and freezes the image at regular intervals.

According to the manufacturer this accelerator is capable of hardware acceleration for HD video.

Clearly something is not right.

This is the output of vainfo:

ivan@ivan-NT-A2400-NT-A3500:~$ vainfo
libva: libva version 0.32.0
Xlib:  extension "XFree86-DRI" missing on display ":0.0".
libva: va_getDriverName() returns 0
libva: Trying to open /usr/lib/dri/fglrx_drv_video.so
libva: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

Thanks for the help.

Here you have the information of vainfo:

ivan@ivan-NT-A2400-NT-A3500:~$ vainfo
libva: libva version 0.32.0
Xlib:  extension "XFree86-DRI" missing on display ":0.0".
libva: va_getDriverName() returns 0
libva: Trying to open /usr/lib/dri/fglrx_drv_video.so
libva: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

I have not yet installed / uninstalled anything in the system. This PC came with the system preinstalled. ATI drivers are installed.

Here I have picture with info on X:

enter image description here


Sorry:

This image shows vainfo information and drivers of my system.

enter image description here


Tested for Ubuntu 11.10 and any supported card ATI card using binary driver (only cards that support UDV2, radeon hd 4000 or higher)

Hardware video acceleration is only enabled if you are using the binaries from ATI, either install them using the Additional Driver tool or manually from the ATI site, the last method is preferred since the current package in the Additional Driver tool is quite buggy.

This post contains all the information needed to install/switch/remove drivers for ATI cards.

After this is done you still need a way to connect the media player to the hardware acceleration feature present in your new drivers.

To do that by installing xvba-va-driver, libva-glx1 and vainfo. Open a terminal and use this command, or look for the packages using the Ubuntu Software Center

sudo apt-get install xvba-va-driver libva-glx1 vainfo

After the packages are installed open a terminal (if not using it) and type vainfo, you should get an output like the following

 libva: libva version 0.32.0
 Xlib:  extension "XFree86-DRI" missing on display ":0.0".
 libva: va_getDriverName() returns 0
 libva: Trying to open /usr/lib/dri/fglrx_drv_video.so
 libva: va_openDriver() returns 0
 vainfo: VA API version: 0.32
 vainfo: Driver version: Splitted-Desktop Systems XvBA backend for VA-API - 0.7.8
 vainfo: Supported profile and entrypoints
 VAProfileH264High               :  VAEntrypointVLD
 VAProfileVC1Advanced            :  VAEntrypointVLD

If not something is wrong (drop a comment for more help).

If you get a similar output your drivers are installed and any video player with hardware decoding capabilities should pick it up automatically or allow you to enable this in the player's settings.

For a list of player capable of using hardware video decoding have a look here, the list is not as complete as I wanted but its a good starting point for information.


On top of Bruno's suggestion (which worked for me) you may also need to do the following:

  1. Add the following lines to your /etc/environment (and reboot):

    LIBVA_DRIVER_NAME=xvba LIBVA_DRIVERS_PATH=/usr/lib/va/drivers

  2. Then to test, run vlc from the command line as follows:

    vlc --ffmpeg-hw

  3. Also 'Preferences -> Show Settings ALL -> Input / Codecs -> Video Codecs -> FFmpeg -> Hardware Decoding' TICK! (same as the above, but permanent - can be set from .config/vlc as well).

See: http://wiki.videolan.org/VLC_VAAPI