사용자 도구

사이트 도구


linux:vaapi

문서의 이전 판입니다!


Linux VAAPI/VDPAU

vainfo

sudo apt install vainfo
 
vainfo
 
# 해당 기기의 가속 가능한 코덱 정보 출력
libva info: VA-API version 1.8.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_8
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.8 (libva 2.8.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 20.2.0 ()
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileVP8Version0_3          : VAEntrypointVLD

Intel

  • Ubuntu Intel Graphic Card 에서는 libva-intel-vaapi-driver i965-va-driver 설치
sudo apt install intel-gpu-tools
 
# intel gpu 사용상황 확인 - Video 항목의 % 가 올라가면 GPU Video Encoding 을 사용하는 것이다.
sudo intel_gpu_top

AMD Radeon

  • fglrx 드라이버 설치. fglrx-updatesfglrx중 잘 안되는게 있을 수 있으므로 번갈아 해 볼 것.
  • vaapi로 선택.
  • xvba-va-driver 설치

NVidia

MPlayer

  • 기본 MPlayer는 vdpau를 지원하고 있으므로 특별한 작업 불필요.
  • VAAPI는 VAAPI용으로 컴파일된 MPlayer 필요 - 더이상 개발안되고 있음
    sudo add-apt-repository ppa:sander-vangrieken/vaapi
    sudo apt-get update
    sudo apt-get install mplayer-vaapi
  • -vo vaapi 혹은 -vo vdpau옵션을 지정한다.
  • Linux SMPlayer 등에서 설정할 때 성능 → 디코딩 thread = 1로 두고 Screenshot을 비활성화해야 한다. 그렇지 않으면 vaapi 가 작동하지 않았다.

VLC

  • VLC PPA 등에서 2.1 이상 버전을 받아서 설치하고
    • 환경설정 → 입력 & 코덱설정 → 하드웨어 가속 디코딩에서 적합한 드라이버 선택.

mpv

  • mpv, mpv-handler로 브라우저 H/W 가속 가능.

Browser

Google Chrome 91 이상 버전 / Ubuntu / Intel GPU

  • Linux Nvidia Graphic Card / Intel Dual graphic 일 경우에도 intel 로 잘 작동하는 것으로 보임.
  • Intel CPU Gen 8 이상
sudo apt install intel-media-va-driver-non-free libva-drm2 libva-x11-2
  • Intel CPU Gen 7 이하
sudo apt install i965-va-driver-shaders libva-drm2 libva-x11-2
  • Chrome 91 이상 버전에서 GPU Acceleration 활성화 해서 실행
# X11 은 --use-gl=desktop, Wayland 는 --use-gl=egl --ozone-platform=wayland 라고함.
google-chrome-stable --use-gl=desktop --enable-features=VaapiVideoDecoder
# 위 옵션 주기 말고, 설정파일로 하기도 가능
  • chrome://gpu 로 작동여부 확인. 아래와 같은 항목이 나옴.
Video Decode: Hardware accelerated

Firefox

Browser GPU 가속여부 확인

  • Intel : intel_gpu_top 명령에서 Video 항목이 증가하는지 확인
  • Nvidia : nvidia-smi -q -g 0 -d UTILIZATION -l 1 에서 Decoder 항목이 증가하는지 확인.
linux/vaapi.1641096082.txt.gz · 마지막으로 수정됨: 2022/01/02 13:01 저자 kwon37xi