-
Notifications
You must be signed in to change notification settings - Fork 17
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
Removed the hard coded HW decoder capability info. #415
base: develop
Are you sure you want to change the base?
Conversation
jeffqjiangNew
commented
Aug 29, 2024
- We now probe HW decoder capabilities through VA-API from the driver.
- We now probe HW decoder capabilities through VA-API from the driver.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeffqjiangNew : let us meet to go over these changes sometime
} else { | ||
return ROCDEC_NOT_SUPPORTED; | ||
rocDecStatus ProbeHwDecodeCapabilities() { | ||
std::string drm_node = "/dev/dri/renderD128"; // look at device_id 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hardcoding the drm_node
to "/dev/dri/renderD128"
breaks the multi-GPU support. Instead, you can use the pdc->device_id
to construct the drm_node
. You can use a similar approach that is used here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. I wanted to discuss this further.
src/rocdecode/roc_decoder_caps.h
Outdated
return ROCDEC_DEVICE_INVALID; | ||
} | ||
int major_version = 0, minor_version = 0; | ||
CHECK_VAAPI(vaInitialize(va_display, &major_version, &minor_version)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
call vaSetInfoCallback(va_display, NULL, NULL);
before calling the vaInitialize
to silence the VA-API for printing out the below messages when running any test.
libva info: VA-API version 1.16.0
libva info: Trying to open /opt/amdgpu/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_16
libva info: va_openDriver() returns 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the above messages. But will add to make sure.
src/rocdecode/roc_decoder_caps.h
Outdated
for (int k = 0; k < attr_count; k++) { | ||
switch (attr_list[k].type) { | ||
case VASurfaceAttribPixelFormat: | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move {
to the previous line.
} | ||
} | ||
|
||
initialized_ = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
call vaDestroyConfig(va_display, va_config_id)
; and vaTerminate(va_display);
at the end of this function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep thanks for catching this. Was going to add but somehow forgot.
return ROCDEC_SUCCESS; | ||
} | ||
rocDecStatus GetDecoderCaps(RocdecDecodeCaps *pdc) { | ||
if (!initialized_) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the initialized
variable to call ProbeHwDecodeCapabilities()
only once is not correct, as it disrupts the Multi-GPU support when multiple GPUs with different capabilities are present in a system. As previously mentioned, you can use the pdc->device_id
to construct the drm_node
within the ProbeHwDecodeCapabilities()
function. If consecutive calls of the GetDecoderCaps
use the same pdc->device_id
, you can skip calling the ProbeHwDecodeCapabilities()
. On the other hand, if the consecutive calls use different pdc->device_id
, then it's necessary to call ProbeHwDecodeCapabilities()
to obtain the correct capability of each device.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup same discussion point on the device_id. Let's discuss.
@jeffqjiangNew needs merge conflicts resolved to run CI |