Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vaDeriveImage returns VA_STATUS_ERROR_OPERATION_FAILED #296

Open
joeyes86 opened this issue Dec 2, 2022 · 2 comments
Open

vaDeriveImage returns VA_STATUS_ERROR_OPERATION_FAILED #296

joeyes86 opened this issue Dec 2, 2022 · 2 comments

Comments

@joeyes86
Copy link

joeyes86 commented Dec 2, 2022

It's a kind of weird situation. I wrote small sample code

#include <va/va.h>
#include <va/va_x11.h>
#include <stdio.h>

void main()
{   
    int major_ver;
    int minor_ver;

    Display* x11_display = XOpenDisplay(NULL);
    VADisplay va_dpy = vaGetDisplay(x11_display);

    VAStatus va_status = vaInitialize(va_dpy, &major_ver, &minor_ver);

    VASurfaceID surfaces[4];
    vaCreateSurfaces(va_dpy, VA_RT_FORMAT_YUV420, 1920, 1088, &surfaces[0], 4, NULL, 0);
    for (int i = 0; i < 4; i++) {
        VAImage surface_image;
        VAStatus va_status = vaDeriveImage(va_dpy, surfaces[i], &surface_image);
        printf("surface %d: vaDeriveImage returns %d\n", i, va_status);
    }
}

build command is gcc h264encode.c -lva -lva-x11 -lX11

Output:

libva info: VA-API version 1.14.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
surface 0: vaDeriveImage returns 1
surface 1: vaDeriveImage returns 1
surface 2: vaDeriveImage returns 1
surface 3: vaDeriveImage returns 1

The same code at the very beginning of the https://github.com/intel/libva-utils/blob/master/encode/h264encode.c main fuction works fine and vaDeriveImage returns 0.
What I'm missing for?

@joeyes86
Copy link
Author

joeyes86 commented Dec 2, 2022

I trying it on machine with AMD Ryzen 5 5300u

@vitaly-castLabs
Copy link

Apparently it's a commonly appearing issue AMD devs trying to fix for years, here are the latest reports (even though it was supposed to work since Mesa 20.3.0 released two years ago): https://gitlab.freedesktop.org/mesa/mesa/-/issues/1193

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants