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

Removed the hard coded HW decoder capability info. #415

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

jeffqjiangNew
Copy link
Contributor

  • We now probe HW decoder capabilities through VA-API from the driver.

 - We now probe HW decoder capabilities through VA-API from the driver.
Copy link
Collaborator

@rrawther rrawther left a 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

api/rocdecode.h Outdated Show resolved Hide resolved
} else {
return ROCDEC_NOT_SUPPORTED;
rocDecStatus ProbeHwDecodeCapabilities() {
std::string drm_node = "/dev/dri/renderD128"; // look at device_id 0
Copy link
Member

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

Copy link
Contributor Author

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.

return ROCDEC_DEVICE_INVALID;
}
int major_version = 0, minor_version = 0;
CHECK_VAAPI(vaInitialize(va_display, &major_version, &minor_version));
Copy link
Member

@AryanSalmanpour AryanSalmanpour Sep 4, 2024

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

Copy link
Contributor Author

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.

for (int k = 0; k < attr_count; k++) {
switch (attr_list[k].type) {
case VASurfaceAttribPixelFormat:
{
Copy link
Member

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;
Copy link
Member

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.

Copy link
Contributor Author

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_) {
Copy link
Member

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.

Copy link
Contributor Author

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.

@AryanSalmanpour AryanSalmanpour added the ci:precheckin run mainline precheckin CI job label Sep 4, 2024
@kiritigowda kiritigowda mentioned this pull request Sep 16, 2024
@kiritigowda
Copy link
Collaborator

@jeffqjiangNew needs merge conflicts resolved to run CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix ci:precheckin run mainline precheckin CI job
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants