FedoraForum.org - Fedora Support Forums and Community
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2017
    Location
    United Kingdom
    Posts
    1

    Using VAAPI on a headless server

    Hello,

    This is my first time posting a question. Usually I am able to figure things out after a couple of days of searching around but I am stuck on this one. Hopefully someone can help me!

    I have a headless server and added an NVIDIA GPU. I blacklisted nouveau and install the NVIDIA driver. Then I dragged a monitor to the server, everything seems to be working. Both vainfo and vdpauinfo are super happy and I can encode with ffmpeg.

    Now I take the monitor away and login via SSH. Nothing seems to work. I have posted the command I tried below. I understand that there is no X server but I don't really understand how that stops the commands from finding the driver.

    Hopefully someone that understand the architecture of this thing can give me a hint to get this working.

    Many thanks!

    # vainfo

    error: XDG_RUNTIME_DIR not set in the environment.
    error: can't connect to X server!
    libva info: VA-API version 0.39.4
    libva info: va_getDriverName() returns -1
    libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)
    vaInitialize failed with error code -1 (unknown libva error),exit

    # vdpauinfo

    vdpauinfo: cannot connect to X server

    # ffmpeg -loglevel debug -vaapi_device /dev/dri/renderD128 -i "input.mkv" -vf 'format=nv12,hwupload' -map 0:0 -map 0:1 -threads 8 -aspect 16:9 -y -f matroska -acodec copy -vcodec h264_vaapi -qp 19 -bf 2 "output"

    [AVHWDeviceContext @ 0x565421cb0360] Opened VA display via DRM device /dev/dri/renderD128.
    libva info: VA-API version 0.39.4
    libva info: va_getDriverName() returns -1
    libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)
    [AVHWDeviceContext @ 0x565421cb0360] Failed to initialise VAAPI connection: -1 (unknown libva error).
    [vaapi @ 0x5654214fe0f0] Failed to create a VAAPI device

  2. #2
    Join Date
    Oct 2010
    Location
    Canberra
    Posts
    2,708

    Re: Using VAAPI on a headless server

    Found this page which has a nice diagram of the architecture - which explains why the library needs an X server.
    https://en.wikipedia.org/wiki/Video_Acceleration_API

  3. #3
    Join Date
    Mar 2012
    Location
    München, Deutschland
    Posts
    897

    Talking Re: Using VAAPI on a headless server

    In the nutshell, what I understood looking into:

    [1] Architecture:



    [2] Reading the following:

    Software architecture[edit]

    Video Acceleration API (VA API) interface architecture
    The current interface is window system independent, so that it can potentially be used with graphics sub-systems other than the DRI (Direct Rendering Infrastructure) in X Window System, such as direct with framebuffer, and it can work with third-party DRM (Direct Rendering Manager) libraries. In a nutshell, it is a scheme to pass various types of data buffers from the application to the GPU for decoding or encoding a compressed bit-stream.
    YES, your VA-API is independent, considering the following:

    "The main motivation for VA-API (Video Acceleration API) is to enable hardware accelerated video decode/encode at various entry-points (VLD, IDCT, Motion Compensation etc.) for the prevailing coding standards today (MPEG-2, MPEG-4 ASP/H.263, MPEG-4 AVC/H.264, H.265/HEVC and VC-1/VMW3)." http://www.freedesktop.org/wiki/Software/vaapi
    In other words, VA-API is INDEPENDENT of X11 Server just to manipulate the video streaming (coding/decoding), nothing more.

    But for your DP and screen to work, you HAVE TO HAVE X11 Server -> Compositor (to move several/many Xwindows around and show them on the screen).
    _______

    Let me throw wild guess why, after you removed the monitor, these VA-API I/Fs do not work: probably they need/require (?) monitor's EDID (basic video sync timings for your monitor), so if you return monitor, and reboot, everything (probably) will behave correctly (in regards to VA-APIs), as before.

    The trick here is, if monitor's EDID not provided via DDC/CI interface, VA-API is going to (probably ) ask X11 Server to provide back generic EDID.

    _nobody_
    Last edited by nobody; 20th June 2017 at 08:06 AM. Reason: Adding some thoughts for more complete picture

  4. #4
    Join Date
    Mar 2012
    Location
    München, Deutschland
    Posts
    897

    Question Re: Using VAAPI on a headless server

    Quote Originally Posted by Manouk
    Now I take the monitor away and login via SSH. Nothing seems to work. I have posted the command I tried below. I understand that there is no X server but I don't really understand how that stops the commands from finding the driver.

    Hopefully someone that understand the architecture of this thing can give me a hint to get this working.
    Any updates after my previous post?

    _nobody_

Similar Threads

  1. Headless Server
    By glennzo in forum Hardware & Laptops
    Replies: 21
    Last Post: 15th September 2008, 04:49 PM
  2. Headless Media Server
    By slycker in forum Linux Chat
    Replies: 0
    Last Post: 16th November 2007, 01:57 AM
  3. Convert Server to Headless
    By turpintti in forum Servers & Networking
    Replies: 2
    Last Post: 17th January 2007, 02:19 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •