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

[Bug]: Fails to build on gcc-4.9 (seems specific to GEN12) #1551

Closed
th0ma7 opened this issue Nov 19, 2022 · 8 comments
Closed

[Bug]: Fails to build on gcc-4.9 (seems specific to GEN12) #1551

th0ma7 opened this issue Nov 19, 2022 · 8 comments
Assignees
Labels
Build Cmake, build option related Decode video decode related Need Info Need more information from submitter

Comments

@th0ma7
Copy link

th0ma7 commented Nov 19, 2022

Which component impacted?

Not sure

Is it regression? Good in old configuration?

No response

What happened?

Synocommunity release of the driver: SynoCommunity/spksrc#5495
Using latest official: 22.5.4

Able to circumvent the build error using conjunction of the following cmake options:

#CMAKE_ARGS += -DGEN11=OFF
#CMAKE_ARGS += -DGEN12=OFF
CMAKE_ARGS += -DDG2=OFF
CMAKE_ARGS += -DPVC=OFF
CMAKE_ARGS += -DXE_LPG=OFF
CMAKE_ARGS += -DXEHP_SDV=OFF
CMAKE_ARGS += -DXe_M_plus=OFF
CMAKE_ARGS += -DMTL=OFF

What's the usage scenario when you are seeing the problem?

Others

What impacted?

n/a

Debug Information

Build error output:
build-x64-6.1.log

Do you want to contribute a patch to fix the issue?

No response

@dvrogozh
Copy link
Contributor

Please, check top level readme of media driver: https://github.com/intel/media-driver#known-issues-and-limitations

Quoting: "Intel(R) Media Driver for VAAPI is recommended to be built against gcc compiler v6.1 or later, which officially supported C++11."

media-driver (and VPL RT and MSDK) should be built using gcc version 6 or later. Earlier versions do not fully and officially support C++11 (they have only experimental support). Moreover, media driver is known to have functional issues if built with earlier versions of gcc:. Please, consider to update your compiler per media-driver build requirements.

As per above this is not a bug if not reproduced on gcc version 6 or later. Can this issue be reproduced on these gcc versions?

@Jexu Jexu added the Build Cmake, build option related label Nov 22, 2022
@cqian2 cqian2 added the VP Video Processing label Nov 30, 2022
@cqian2 cqian2 removed their assignment Nov 30, 2022
@LhGu LhGu removed their assignment Nov 30, 2022
@LhGu LhGu added Decode video decode related and removed VP Video Processing labels Nov 30, 2022
@LhGu
Copy link
Member

LhGu commented Nov 30, 2022

mhw_vdbox_avp_impl.h compile error

@Jexu Jexu added the Need Info Need more information from submitter label Dec 5, 2022
@Jexu
Copy link
Contributor

Jexu commented Dec 5, 2022

As @dvrogozh mentioned, media driver introduces C++11 which requires newer version of gcc support. So could you try to upgrade gcc to check if it is gone?

@th0ma7
Copy link
Author

th0ma7 commented Dec 5, 2022

There are two things to consider:

  1. I cannot upgrade the gcc compiler suite as I'm using Synology's default toolchain that comes with DSM 6.x release (they did upgrade to gcc-7.5 for DSM 7.x but that cannot be used to compile for older OS release)
  2. gcc-4.9 does support c++11 while c++1y (e.g. c++14) was partial.

EDIT: I want to point out that it does get much farther using c++1y (is the code really c++11 compliant?) Still, now getting an error which seems similar in nature to #1545 :

/home/spksrc/rustc_non-priv-user/spksrc/cross/intel-media-driver/work-x64-6.1/media-driver-intel-media-22.5.4/media_softlet/agnostic/common/hw/vdbox/mhw_vdbox_avp_impl.h:536:49: error: too many initializers for ‘const uint8_t [2][2] {aka const unsigned char [2][2]}
/home/spksrc/rustc_non-priv-user/spksrc/cross/intel-media-driver/work-x64-6.1/media-driver-intel-media-22.5.4/media_softlet/agnostic/common/hw/vdbox/mhw_vdbox_avp_impl.h:536:49: error: array must be initialized with a brace-enclosed initializer

@dvrogozh
Copy link
Contributor

dvrogozh commented Dec 5, 2022

gcc-4.9 does support c++11

No, it has only experimental support for C++11. Read documentation here: https://gcc.gnu.org/onlinedocs/gcc-4.9.4/gcc/Standards.html#Standards. Quoting (C++ section): "GCC supports the original ISO C++ standard (1998) and contains experimental support for the second ISO C++ standard (2011)." Same for gcc-5. Only gcc-6 has declared non-experimental support for c++11. In practice "experimental" support means that if you will find a compiler bug in gcc-4.9 for c++11 it won't be fixed in this compiler version.

The chance you have to proceed with this issue is to either reproduce same issue you have with other compiler which officially supports c++11 (for gcc that's gcc-6 or later), or convince that a faulty statement does not follow the standard despite compilers with official support can handle it, or to suggest a refactor for the code which will simplify the place out.

they did upgrade to gcc-7.5 for DSM 7.x but that cannot be used to compile for older OS release

Consider to switch to newer release. It's better than make something buildable with unsupported compiler version and step later in non-fixable compiler bugs which would show as runtime errors or segmentation faults.

@bkuhls
Copy link
Contributor

bkuhls commented Dec 5, 2022

Moreover, media driver is known to have functional issues if built with earlier versions of gcc:. Please, consider to update your compiler per media-driver build requirements.

Hi,

sitting in the same boat with a gcc-4.9 system which, due to various reasons, I can not update I accept your recommendation but for my use case (Kodi decoding videos with a gen12 cpu) mediadriver-2.6.3 it works flawlessly.

To accomplish this I am patching mediadriver and use some configure options to disable problematic parts:
bkuhls/buildroot@fe71590

patch 0002-gcc49.patch is available as #1545
patch 0004-gcc49.patch is an ugly hack ;)

@Jexu
Copy link
Contributor

Jexu commented Dec 6, 2022

Fix similar with #1545 could temporarily solve the issue, but i think it is not necessary. Media dirver has allowed developpers to use newer c++, especially in newly released driver. It cannot guarantee similar build issues by older compiler will not exist again in the future.
So, if you really cannot upgrade the compiler, manual patch may help.

@Jexu
Copy link
Contributor

Jexu commented Dec 20, 2022

So far, I will close this issue now and please re-open it again if you still have any concerns. Thanks,

@Jexu Jexu closed this as completed Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Cmake, build option related Decode video decode related Need Info Need more information from submitter
Projects
None yet
Development

No branches or pull requests

8 participants