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

probems with you vaapi patch for chromium #2

Closed
sl1pkn07 opened this issue Jun 28, 2016 · 131 comments
Closed

probems with you vaapi patch for chromium #2

sl1pkn07 opened this issue Jun 28, 2016 · 131 comments

Comments

@sl1pkn07
Copy link

sl1pkn07 commented Jun 28, 2016

Hi. i'm the maintainer of the chromium-dev package in Archlinux AUR user repository

https://aur.archlinux.org/packages/chromium-dev

i want to use you patch https://github.com/saiarcot895/chromium-ubuntu-build/blob/master/debian/patches/enable_vaapi_on_linux.diff in my package

in older version, i use you patch from launchpad repository, but because I'am not coder, that patch don't work well

for example, this https://aur.archlinux.org/cgit/aur.git/tree/enable_vaapi_on_linux-r13.diff?h=chromium-dev

is more or less sync with your older patch, but now, i want sync with your latest patch (with little changes in some paths for adapt for chromium build with GYP_DEFINES)

for example:

+#if !defined(__arm__)
+// Auto-generated for dlopen libva libraries
+#include "out/Release/gen/va/media/gpu/va_stubs.h"
+#endif
+

and

+#if !defined(__arm__)
+using media_gpu::kModuleVa;
+using media_gpu::kModuleVa_x11;
+#if defined(USE_OZONE)
+using media_gpu::kModuleVa_drm;
+#endif
+using media_gpu::InitializeStubs;
+using media_gpu::StubPathMap;
+#endif
+

all build ok, except the last build rule: (linker)

obj/media/gpu/media_gpu.vaapi_video_decode_accelerator.o: In function `media::VaapiVideoDecodeAccelerator::VaapiH264Accelerator::~VaapiH264Accelerator()':
vaapi_video_decode_accelerator.cc:(.text._ZN5media27VaapiVideoDecodeAccelerator20VaapiH264AcceleratorD2Ev+0xb): undefined reference to `media::H264Decoder::H264Accelerator::~H264Accelerator()'
obj/media/gpu/media_gpu.vaapi_video_decode_accelerator.o: In function `media::VaapiVideoDecodeAccelerator::VaapiH264Accelerator::~VaapiH264Accelerator()':
vaapi_video_decode_accelerator.cc:(.text._ZN5media27VaapiVideoDecodeAccelerator20VaapiH264AcceleratorD0Ev+0xf): undefined reference to `media::H264Decoder::H264Accelerator::~H264Accelerator()'
obj/media/gpu/media_gpu.vaapi_video_decode_accelerator.o: In function `media::VaapiVideoDecodeAccelerator::VaapiVP8Accelerator::~VaapiVP8Accelerator()':
vaapi_video_decode_accelerator.cc:(.text._ZN5media27VaapiVideoDecodeAccelerator19VaapiVP8AcceleratorD2Ev+0xb): undefined reference to `media::VP8Decoder::VP8Accelerator::~VP8Accelerator()'
obj/media/gpu/media_gpu.vaapi_video_decode_accelerator.o: In function `media::VaapiVideoDecodeAccelerator::VaapiVP8Accelerator::~VaapiVP8Accelerator()':
vaapi_video_decode_accelerator.cc:(.text._ZN5media27VaapiVideoDecodeAccelerator19VaapiVP8AcceleratorD0Ev+0xf): undefined reference to `media::VP8Decoder::VP8Accelerator::~VP8Accelerator()'
obj/media/gpu/media_gpu.vaapi_video_decode_accelerator.o: In function `media::VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::~VaapiVP9Accelerator()':
vaapi_video_decode_accelerator.cc:(.text._ZN5media27VaapiVideoDecodeAccelerator19VaapiVP9AcceleratorD2Ev+0xb): undefined reference to `media::VP9Decoder::VP9Accelerator::~VP9Accelerator()'
obj/media/gpu/media_gpu.vaapi_video_decode_accelerator.o: In function `media::VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::~VaapiVP9Accelerator()':
vaapi_video_decode_accelerator.cc:(.text._ZN5media27VaapiVideoDecodeAccelerator19VaapiVP9AcceleratorD0Ev+0xf): undefined reference to `media::VP9Decoder::VP9Accelerator::~VP9Accelerator()'
obj/media/gpu/media_gpu.vaapi_video_decode_accelerator.o: In function `media::VaapiVideoDecodeAccelerator::Initialize(media::VideoDecodeAccelerator::Config const&, media::VideoDecodeAccelerator::Client*) [clone .part.153]':
vaapi_video_decode_accelerator.cc:(.text._ZN5media27VaapiVideoDecodeAccelerator10InitializeERKNS_22VideoDecodeAccelerator6ConfigEPNS1_6ClientE.part.153+0x399): undefined reference to `media::VP9Decoder::VP9Accelerator::VP9Accelerator()'
vaapi_video_decode_accelerator.cc:(.text._ZN5media27VaapiVideoDecodeAccelerator10InitializeERKNS_22VideoDecodeAccelerator6ConfigEPNS1_6ClientE.part.153+0x3e4): undefined reference to `media::VP9Decoder::VP9Decoder(media::VP9Decoder::VP9Accelerator*)'
vaapi_video_decode_accelerator.cc:(.text._ZN5media27VaapiVideoDecodeAccelerator10InitializeERKNS_22VideoDecodeAccelerator6ConfigEPNS1_6ClientE.part.153+0x491): undefined reference to `media::H264Decoder::H264Accelerator::H264Accelerator()'
vaapi_video_decode_accelerator.cc:(.text._ZN5media27VaapiVideoDecodeAccelerator10InitializeERKNS_22VideoDecodeAccelerator6ConfigEPNS1_6ClientE.part.153+0x4dc): undefined reference to `media::H264Decoder::H264Decoder(media::H264Decoder::H264Accelerator*)'
vaapi_video_decode_accelerator.cc:(.text._ZN5media27VaapiVideoDecodeAccelerator10InitializeERKNS_22VideoDecodeAccelerator6ConfigEPNS1_6ClientE.part.153+0x551): undefined reference to `media::VP8Decoder::VP8Accelerator::VP8Accelerator()'
vaapi_video_decode_accelerator.cc:(.text._ZN5media27VaapiVideoDecodeAccelerator10InitializeERKNS_22VideoDecodeAccelerator6ConfigEPNS1_6ClientE.part.153+0x59c): undefined reference to `media::VP8Decoder::VP8Decoder(media::VP8Decoder::VP8Accelerator*)'
obj/media/gpu/media_gpu.vaapi_video_decode_accelerator.o: In function `media::VaapiH264Picture::~VaapiH264Picture()':
vaapi_video_decode_accelerator.cc:(.text._ZN5media16VaapiH264PictureD2Ev+0x35): undefined reference to `media::H264Picture::~H264Picture()'
vaapi_video_decode_accelerator.cc:(.text._ZN5media16VaapiH264PictureD2Ev+0x5a): undefined reference to `media::H264Picture::~H264Picture()'
obj/media/gpu/media_gpu.vaapi_video_decode_accelerator.o: In function `media::VaapiVP8Picture::~VaapiVP8Picture()':
vaapi_video_decode_accelerator.cc:(.text._ZN5media15VaapiVP8PictureD2Ev+0x32): undefined reference to `media::VP8Picture::~VP8Picture()'
vaapi_video_decode_accelerator.cc:(.text._ZN5media15VaapiVP8PictureD2Ev+0x5a): undefined reference to `media::VP8Picture::~VP8Picture()'
obj/media/gpu/media_gpu.vaapi_video_decode_accelerator.o: In function `media::VaapiVP9Picture::~VaapiVP9Picture()':
vaapi_video_decode_accelerator.cc:(.text._ZN5media15VaapiVP9PictureD2Ev+0x32): undefined reference to `media::VP9Picture::~VP9Picture()'
vaapi_video_decode_accelerator.cc:(.text._ZN5media15VaapiVP9PictureD2Ev+0x5a): undefined reference to `media::VP9Picture::~VP9Picture()'
obj/media/gpu/media_gpu.vaapi_video_decode_accelerator.o: In function `media::VaapiH264Picture::VaapiH264Picture(scoped_refptr<media::VaapiVideoDecodeAccelerator::VaapiDecodeSurface> const&)':
vaapi_video_decode_accelerator.cc:(.text._ZN5media16VaapiH264PictureC2ERK13scoped_refptrINS_27VaapiVideoDecodeAccelerator18VaapiDecodeSurfaceEE+0xd): undefined reference to `media::H264Picture::H264Picture()'
obj/media/gpu/media_gpu.vaapi_video_decode_accelerator.o: In function `media::VaapiVP8Picture::VaapiVP8Picture(scoped_refptr<media::VaapiVideoDecodeAccelerator::VaapiDecodeSurface> const&)':
vaapi_video_decode_accelerator.cc:(.text._ZN5media15VaapiVP8PictureC2ERK13scoped_refptrINS_27VaapiVideoDecodeAccelerator18VaapiDecodeSurfaceEE+0xd): undefined reference to `media::VP8Picture::VP8Picture()'
obj/media/gpu/media_gpu.vaapi_video_decode_accelerator.o: In function `media::VaapiVP9Picture::VaapiVP9Picture(scoped_refptr<media::VaapiVideoDecodeAccelerator::VaapiDecodeSurface> const&)':
vaapi_video_decode_accelerator.cc:(.text._ZN5media15VaapiVP9PictureC2ERK13scoped_refptrINS_27VaapiVideoDecodeAccelerator18VaapiDecodeSurfaceEE+0xd): undefined reference to `media::VP9Picture::VP9Picture()'
obj/media/gpu/media_gpu.vaapi_video_decode_accelerator.o:(.data.rel.ro._ZTVN5media16VaapiH264PictureE[_ZTVN5media16VaapiH264PictureE]+0x10): undefined reference to `media::H264Picture::AsV4L2H264Picture()'
obj/media/gpu/media_gpu.vaapi_video_decode_accelerator.o:(.data.rel.ro._ZTVN5media15VaapiVP8PictureE[_ZTVN5media15VaapiVP8PictureE]+0x10): undefined reference to `media::VP8Picture::AsV4L2VP8Picture()'
obj/media/gpu/media_gpu.vaapi_video_decode_accelerator.o:(.data.rel.ro._ZTVN5media15VaapiVP9PictureE[_ZTVN5media15VaapiVP9PictureE]+0x10): undefined reference to `media::VP9Picture::AsV4L2VP9Picture()'

(complete log of the last rule: https://sl1pkn07.wtf/chromium_log.log)

can you help me?

this is my complete build script: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=chromium-dev

greetings

@saiarcot895
Copy link
Owner

saiarcot895 commented Jun 28, 2016

Part of the problem might be that I've switched to using gn, and haven't been updating the gyp files. I'll take a look shortly.

@saiarcot895
Copy link
Owner

Can you confirm that the following files are being compiled? It looks like they should based on the patch you're using:

media/gpu/h264_dpb.cc
media/gpu/vp8_decoder.cc
media/gpu/vp9_decoder.cc

@sl1pkn07
Copy link
Author

yes. with my patch these files it has been builded, but with you patch no

sorry for the late

greetings

@saiarcot895
Copy link
Owner

Ah, I see what you mean. I'll need to add back in the part of the patch that modifies the gyp files as well.

@saiarcot895
Copy link
Owner

I've updated the patch, but it may or may not work yet (I can't check as I've switched to using GN). Can you test it and see if it works?

@sl1pkn07
Copy link
Author

sl1pkn07 commented Jul 1, 2016

gyp: Undefined variable output_root in /tmp/makepkg/chromium-dev/src/chromium-53.0.2783.2/content/content.gyp

@saiarcot895
Copy link
Owner

Updated again, can you check now?

@sl1pkn07
Copy link
Author

sl1pkn07 commented Jul 1, 2016

gyp: /tmp/makepkg/chromium-dev/src/build/linux/system.gyp not found (cwd: /tmp/makepkg/chromium-dev/src/chromium-53.0.2783.2)

@saiarcot895
Copy link
Owner

Fixed again.

@sl1pkn07
Copy link
Author

sl1pkn07 commented Jul 1, 2016

in build process!

@sl1pkn07
Copy link
Author

sl1pkn07 commented Jul 1, 2016

Builded OK. but vaapi not work :(

libva info: VA-API version 0.39.2
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/dri/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_0_35
libva info: va_openDriver() returns 0
libva info: VA-API version 0.39.2
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/dri/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_0_35
Received signal 8 FPE_INTDIV 7f6ff47e92da
#0 0x55bdc515433e <unknown>
#1 0x55bdc5154729 <unknown>
#2 0x7f700ff8cf00 <unknown>
#3 0x7f6ff47e92da <unknown>
#4 0x7f6ff47ec1e8 <unknown>
#5 0x7f6ff47ec236 <unknown>
#6 0x7f6ff47ec40c <unknown>
#7 0x7f6ff47ed1e0 <unknown>
#8 0x7f700301b3ae <unknown>
#9 0x7f700301c2d7 vaInitialize
#10 0x55bdc9861dfe <unknown>
#11 0x55bdc9863c17 <unknown>
#12 0x55bdc9863e01 <unknown>
#13 0x55bdc986429f <unknown>
#14 0x55bdca3c9a1d <unknown>
#15 0x55bdca3c552d <unknown>
#16 0x55bdc9e80b1d <unknown>
#17 0x55bdc93ccaf3 <unknown>
#18 0x55bdc93cd49a <unknown>
#19 0x55bdc9def135 <unknown>
#20 0x55bdc93cc9b1 <unknown>
#21 0x55bdc5c60a03 <unknown>
#22 0x55bdc51c490d <unknown>
#23 0x55bdc5173c5a <unknown>
#24 0x55bdc517484d <unknown>
#25 0x55bdc5174b38 <unknown>
#26 0x55bdc51c30a9 <unknown>
#27 0x55bdc51c30ed <unknown>
#28 0x7f700f658dd7 g_main_context_dispatch
#29 0x7f700f659040 <unknown>
#30 0x7f700f6590ec g_main_context_iteration
#31 0x55bdc51c2dfa <unknown>
#32 0x55bdc518e124 <unknown>
#33 0x55bdc5172965 <unknown>
#34 0x55bdc93c913a <unknown>
#35 0x55bdc512145f <unknown>
#36 0x55bdc5120691 <unknown>
#37 0x55bdc4c9c1da ChromeMain
#38 0x7f7005dcd741 __libc_start_main
#39 0x55bdc4c9c089 _start
  r8: 0000000000000000  r9: 0000000000000000 r10: ffffe04c5e5b970d r11: 00007f700d6074d0
 r12: 0000000000000000 r13: 00007ffe7eef3ae4 r14: 00007f6ff47f708c r15: 00001fb10c57c500
  di: 00001fb10c57c650  si: 0000000000000000  bp: 0000000000000000  bx: 00001fb10c57c650
  dx: 0000000000000000  ax: 0000000000000000  cx: 0000000000000000  sp: 00007ffe7eef3ac0
  ip: 00007f6ff47e92da efl: 0000000000010246 cgf: 002b000000000033 erf: 0000000000000000
 trp: 0000000000000000 msk: 0000000000000000 cr2: 0000000000000000
[end of stack trace]
[2813:2839:0701/214532:ERROR:browser_gpu_channel_host_factory.cc(119)] Failed to launch GPU process.

same as my r13 patch on older version of chromium :(

i'm not sure if is a problem of GYP build system

need time for update my script to adapt to GN (and i no sure if all of my "hacks" works ok wit GN)

using nvidia 367.27 with libglvnd by nvidia package

greetings

@saiarcot895
Copy link
Owner

saiarcot895 commented Jul 1, 2016

There's another user reporting Nvidia drivers not working, and I don't know why that is. I don't think I can figure out why the error is occurring, as the main error appears to be in driver-specific code.

@nihil-2019
Copy link

@saiarcot895 I am using latest version of chromium-dev from @sl1pkn07 with your patch & I can confirm that VAAPI doesn't work, it crashes with the same error that he had. Not only that, but it breaks the entire GPU process. chrome://gpu reports "GPU process was unable to boot: GPU access is disabled in chrome://settings."

@saiarcot895
Copy link
Owner

@sl1pkn07 Can you make a build with debugging symbols included (at least -g1) and run that? Hopefully, some of the function names there will be filled in.

@sl1pkn07
Copy link
Author

sl1pkn07 commented Jul 4, 2016

roger

-g1 is ninja option, right?

@saiarcot895
Copy link
Owner

GYP option, I think. You should be able to add it into the CFLAGS.

@sl1pkn07
Copy link
Author

sl1pkn07 commented Jul 4, 2016

okere

@sl1pkn07
Copy link
Author

sl1pkn07 commented Jul 5, 2016

FAILED: chromedriver 
/tmp/makepkg/chromium-dev/src/chromium-53.0.2783.2/third_party/llvm-build/Release+Asserts/bin/clang++ -Qunused-arguments -Wl,-O1,--sort-common,--as-needed,-z,relro -Wl,-z,now -Wl,-z,relro -Wl,-z,defs -pthread -Wl,-z,noexecstack -fPIC -L. -L. -Wl,-uIsHeapProfilerRunning,-uProfilerStart -Wl,-u_Z21InitialMallocHook_NewPKvj,-u_Z22InitialMallocHook_MMapPKvS0_jiiix,-u_Z22InitialMallocHook_SbrkPKvi -Wl,-u_Z21InitialMallocHook_NewPKvm,-u_Z22InitialMallocHook_MMapPKvS0_miiil,-u_Z22InitialMallocHook_SbrkPKvl -Wl,-u_ZN15HeapLeakChecker12IgnoreObjectEPKv,-u_ZN15HeapLeakChecker14UnIgnoreObjectEPKv -Wl,--export-dynamic -pthread -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -m64 -o chromedriver -Wl,--start-group obj/chrome/test/chromedriver/server/chromedriver.chromedriver_server.o obj/chrome/libchromedriver_lib.a obj/chrome/libautomation_client_lib.a obj/base/libbase.a obj/base/allocator/liballocator.a obj/base/third_party/dynamic_annotations/libdynamic_annotations.a obj/base/libbase_static.a obj/third_party/modp_b64/libmodp_b64.a obj/base/libsymbolize.a obj/base/libxdg_mime.a obj/base/third_party/libevent/libevent.a obj/base/allocator/libunified_allocator_shim.a obj/net/libnet.a obj/url/liburl_lib.a obj/third_party/icu/libicui18n.a obj/third_party/icu/libicuuc.a obj/crypto/libcrcrypto.a obj/third_party/boringssl/libboringssl.a obj/third_party/boringssl/libboringssl_asm.a obj/sdch/libsdch.a obj/third_party/protobuf/libprotobuf_lite.a obj/net/libnet_quic_proto.a obj/base/libbase_i18n.a obj/third_party/brotli/libbrotli.a obj/ui/accessibility/libax_gen.a obj/tools/json_schema_compiler/libapi_gen_util.a obj/ui/base/libui_base.a obj/ui/base/libui_data_pack.a obj/skia/libskia_library.a obj/skia/libskia_opts.a obj/skia/libskia_opts_ssse3.a obj/skia/libskia_opts_sse41.a obj/skia/libskia_opts_sse42.a obj/skia/libskia_opts_avx.a obj/skia/libskia_opts_avx2.a obj/third_party/sfntly/libsfntly.a obj/skia/libskia_chrome.a obj/ui/display/libdisplay.a obj/ui/gfx/libgfx.a obj/third_party/libpng/libpng.a obj/ui/gfx/libgfx_geometry.a obj/ui/gfx/libgfx_range.a obj/third_party/libjpeg_turbo/libjpeg_turbo.a obj/ui/gfx/x/libgfx_x11.a obj/ui/display/libdisplay_util.a obj/ui/events/platform/libevents_platform.a obj/ui/events/libevents.a obj/ui/events/libdom_keycode_converter.a obj/ui/events/libevents_base.a obj/ui/events/keycodes/libkeycodes_x11.a obj/ui/events/keycodes/libkeycodes_xkb.a obj/ui/events/libgesture_detection.a obj/ui/events/devices/libevents_devices.a obj/ui/events/devices/x11/libevents_devices_x11.a obj/ui/events/x/libevents_x.a obj/ui/events/platform/x11/libx11_events_platform.a obj/ui/base/x/libui_base_x.a obj/net/libhttp_server.a obj/third_party/zlib/google/libzip.a obj/ui/events/ozone/libevents_ozone_layout.a -Wl,--end-group  -lrt -ldl -latomic -lgmodule-2.0 -lgobject-2.0 -lgthread-2.0 -lglib-2.0 -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -lz -lresolv -lminizip -lfontconfig -lfreetype -lexpat -lpangocairo-1.0 -lpango-1.0 -lcairo -lharfbuzz-icu -lharfbuzz -lX11 -lXi -lXrandr -lXext -lXcursor -lXfixes -lXrender -lXss -lxkbcommon
obj/net/http/net.http_auth_gssapi_posix.o: In function `net::GSSAPISharedLibrary::BindMethods(void*)':
/tmp/makepkg/chromium-dev/src/chromium-53.0.2783.2/out/Debug/../../net/http/http_auth_gssapi_posix.cc:483: undefined reference to `gss_inquire_context'
/tmp/makepkg/chromium-dev/src/chromium-53.0.2783.2/out/Debug/../../net/http/http_auth_gssapi_posix.cc:483: undefined reference to `gss_delete_sec_context'
/tmp/makepkg/chromium-dev/src/chromium-53.0.2783.2/out/Debug/../../net/http/http_auth_gssapi_posix.cc:483: undefined reference to `gss_wrap_size_limit'
/tmp/makepkg/chromium-dev/src/chromium-53.0.2783.2/out/Debug/../../net/http/http_auth_gssapi_posix.cc:483: undefined reference to `gss_init_sec_context'
/tmp/makepkg/chromium-dev/src/chromium-53.0.2783.2/out/Debug/../../net/http/http_auth_gssapi_posix.cc:483: undefined reference to `gss_display_status'
/tmp/makepkg/chromium-dev/src/chromium-53.0.2783.2/out/Debug/../../net/http/http_auth_gssapi_posix.cc:483: undefined reference to `gss_display_name'
/tmp/makepkg/chromium-dev/src/chromium-53.0.2783.2/out/Debug/../../net/http/http_auth_gssapi_posix.cc:483: undefined reference to `gss_release_buffer'
/tmp/makepkg/chromium-dev/src/chromium-53.0.2783.2/out/Debug/../../net/http/http_auth_gssapi_posix.cc:483: undefined reference to `gss_release_name'
/tmp/makepkg/chromium-dev/src/chromium-53.0.2783.2/out/Debug/../../net/http/http_auth_gssapi_posix.cc:483: undefined reference to `gss_import_name'
clang-3.9: error: linker command failed with exit code 1 (use -v to see invocation)

:(

@saiarcot895
Copy link
Owner

That's...odd. Building with debugging symbols shouldn't cause a linker error.

On another note, it looks like you're building the Debug configuration; I'm not sure if that's intentional or not. It is possible to get debugging symbols without doing a Debug build. I think adding -Drelease_extra_cflags=-g1 -Dlinux_strip_binary=0 (you have -Dlinux_strip_binary=1 in your config) should work.

@sl1pkn07
Copy link
Author

sl1pkn07 commented Jul 5, 2016

tnx for the sugestion (I knew I forgot something :( )

in this run also now added '-Gconfig=Debug' (http://zurlinux.com/?p=180)

@sl1pkn07
Copy link
Author

sl1pkn07 commented Jul 5, 2016

nope. same error with -Dlinux_strip_binary=0, -Dremove_webcore_debug_symbols=0 and -Gconfig=Debug . makepkg (archlinux packager) adds '-g -fvar-tracking-assignments' into CFLAGS/CXXFLAGS when set options=('debug') (actived in both attempts)

the changes: https://sl1pkn07.wtf/paste/view/f20a3175

@saiarcot895
Copy link
Owner

Can you verify that a Release build still works with the changes made?

Also, what is export CPPFLAGS="${CPPFLAGS/2/0}" for?

@sl1pkn07
Copy link
Author

sl1pkn07 commented Jul 6, 2016

I change the cpp flags because if not spaw a tons message like

In file included from /usr/include/stdio.h:27:0,
                 from ../../third_party/re2/src/util/util.h:9,
                 from ../../third_party/re2/src/re2/prog.h:12,
                 from ../../third_party/re2/src/re2/bitstate.cc:20:
/usr/include/features.h:331:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
 #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
    ^~~~~~~
└───╼  cat /etc/makepkg.conf |grep FLAGS
# ARCHITECTURE, COMPILE FLAGS
CPPFLAGS="-D_FORTIFY_SOURCE=2"
CFLAGS="-march=native -O2 -pipe -fstack-protector-strong"
CXXFLAGS="-march=native -O2 -pipe -fstack-protector-strong"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro"
MAKEFLAGS="-j24"
DEBUG_CFLAGS="-g -fvar-tracking-assignments"
DEBUG_CXXFLAGS="-g -fvar-tracking-assignments"
#-- If using DistCC, your MAKEFLAGS will also need modification. In addition,

(DEBUG_ is active when set options=('debug'))

@sl1pkn07
Copy link
Author

sl1pkn07 commented Jul 6, 2016

nope

with active debug in makepkg, -Gconfig=Release, -Dremove_webcore_debug_symbols=0, -Dlinux_strip_binary=0, export CPPFLAGS="${CPPFLAGS/2/0}"

clang-3.9: error: unknown argument: '-fvar-tracking-assignments'

all cases, include avobe test, used a bundled clang (builded, not binaries)

@saiarcot895
Copy link
Owner

That error means that the clang binary they are using doesn't support the -fvar-tracking-assignments flag. Can you try it with makepkg in release mode (so that it uses CFLAGS and CXXFLAGS instead of the debug variables)?

Also, I don't know if the -Gconfig flag has any impact, because when I was using GYP, I was able to get debugging symbols without using that flag.

@sl1pkn07
Copy link
Author

@sjnewbury
Copy link

@saiarcot895 That's all fine, I'll take a look at merging your changes back into my version.

@sl1pkn07
Copy link
Author

sl1pkn07 commented Oct 15, 2016

@saiarcot895

with you patch (https://github.com/saiarcot895/chromium-ubuntu-build/blob/master/debian/patches/enable_vaapi_on_linux.diff) (with fix paths for my distro)

[19406:19406:1015/154308:ERROR:vaapi_wrapper.cc(476)] vaQuerySurfaceAttributes failed VA error: invalid parameter
[19406:19406:1015/154308:ERROR:vaapi_wrapper.cc(337)] GetMaxResolution failed for va_profile 0 and entrypoint 1
[19406:19406:1015/154308:ERROR:vaapi_wrapper.cc(476)] vaQuerySurfaceAttributes failed VA error: invalid parameter
[19406:19406:1015/154308:ERROR:vaapi_wrapper.cc(337)] GetMaxResolution failed for va_profile 1 and entrypoint 1
[19406:19406:1015/154308:ERROR:vaapi_wrapper.cc(476)] vaQuerySurfaceAttributes failed VA error: invalid parameter
[19406:19406:1015/154308:ERROR:vaapi_wrapper.cc(337)] GetMaxResolution failed for va_profile 2 and entrypoint 1
[19406:19406:1015/154308:ERROR:vaapi_wrapper.cc(476)] vaQuerySurfaceAttributes failed VA error: invalid parameter
[19406:19406:1015/154308:ERROR:vaapi_wrapper.cc(337)] GetMaxResolution failed for va_profile 3 and entrypoint 1
[19406:19406:1015/154308:ERROR:vaapi_wrapper.cc(476)] vaQuerySurfaceAttributes failed VA error: invalid parameter
[19406:19406:1015/154308:ERROR:vaapi_wrapper.cc(337)] GetMaxResolution failed for va_profile 5 and entrypoint 1
[19406:19406:1015/154308:ERROR:vaapi_wrapper.cc(476)] vaQuerySurfaceAttributes failed VA error: invalid parameter
[19406:19406:1015/154308:ERROR:vaapi_wrapper.cc(337)] GetMaxResolution failed for va_profile 6 and entrypoint 1
[19406:19406:1015/154308:ERROR:vaapi_wrapper.cc(476)] vaQuerySurfaceAttributes failed VA error: invalid parameter
[19406:19406:1015/154308:ERROR:vaapi_wrapper.cc(337)] GetMaxResolution failed for va_profile 7 and entrypoint 1
[19406:19406:1015/154308:ERROR:vaapi_wrapper.cc(476)] vaQuerySurfaceAttributes failed VA error: invalid parameter
[19406:19406:1015/154308:ERROR:vaapi_wrapper.cc(337)] GetMaxResolution failed for va_profile 8 and entrypoint 1
[19406:19406:1015/154308:ERROR:vaapi_wrapper.cc(476)] vaQuerySurfaceAttributes failed VA error: invalid parameter
[19406:19406:1015/154308:ERROR:vaapi_wrapper.cc(337)] GetMaxResolution failed for va_profile 9 and entrypoint 1
[19406:19406:1015/154308:ERROR:vaapi_wrapper.cc(476)] vaQuerySurfaceAttributes failed VA error: invalid parameter
[19406:19406:1015/154308:ERROR:vaapi_wrapper.cc(337)] GetMaxResolution failed for va_profile 10 and entrypoint 1

https://github.com/saiarcot895/chromium-ubuntu-build/blob/master/debian/patches/specify-max-resolution.patch is only for 1920x1088. my screen is 4K. is fixable?

@saiarcot895
Copy link
Owner

@sl1pkn07 Is the output you pasted with the second patch? Both are needed.

As for the screen size, yes, you can change the max resolution there. I don't know what impact it'll have on hardware that doesn't support 4K decoding.

@sl1pkn07
Copy link
Author

only with first (why is not merged in one?)

mm that last patch is only for i965(as i understand in https://cgit.freedesktop.org/vaapi/intel-driver/commit/?id=9a20d6c34cb65e5b85dd16d6c8b3a215c5972b18), exist equivalent for libva-vdpau-driver?

how can get the max libva resolution I can handle?

@saiarcot895
Copy link
Owner

saiarcot895 commented Oct 15, 2016

I have the two parts separated because the second isn't an issue with Chromium itself, and it has been fixed in vaapi. You'll need both patches.

I'm not sure if the libva-vdpau-driver needs a similar change to properly get the maximum resolution that can be decoded. For now, this maximum resolution will need to be hardcoded in Chromium.

@samcv
Copy link

samcv commented Oct 18, 2016

With @sjnewbury patch for 55, applying to 54, I get this error on launching chromium. Even if I use my old version of bpf_gpu_policy_linux.cc it still causes this error. I have a feeling it's crashing before the VAAPI drivers are even dlopened. I am seeing this on Radeon and Intel.

[22612:22612:1018/000506:ERROR:sandbox_linux.cc(343)] InitializeSandbox() called with multiple threads in process gpu-process. Received signal 11 SEGV_MAPERR 000000000000 #0 0x5576f039795e <unknown> #1 0x5576f0397d19 <unknown> #2 0x7f6f21658080 <unknown> r8: 00005576f6e4c410 r9: 0000000000000000 r10: 0000000000000036 r11: 00007f6f071cc2cc r12: 00007ffef4a4fef0 r13: 00005576f6e4c410 r14: 00005576f6ce88ed r15: 00007ffef4a50640 di: 00005576f836cc00 si: 0000000000000000 bp: 00005576f6e4c408 bx: 00005576f6e4c408 dx: 0000000000000001 ax: 00005576f836cc00 cx: 0000000000000000 sp: 00007ffef4a4fa48 ip: 0000000000000000 efl: 0000000000010206 cgf: 002b000000000033 erf: 0000000000000014 trp: 000000000000000e msk: 0000000000000000 cr2: 0000000000000000 [end of stack trace] [22506:22525:1018/000506:ERROR:browser_gpu_channel_host_factory.cc(113)] Failed to launch GPU process.

@sl1pkn07
Copy link
Author

sl1pkn07 commented Oct 19, 2016

@sjnewbury is not a ffmpeg glich, because for eaxple fail with all GIF/videos in twitter. without patch all runs fine

steps:

close all chromium process
open chromium in console
go to twitter (if you have a account and have twits with gif/videos)

libva info: VA-API version 0.39.3
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/dri/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_0_39
Failed to create dedicated X11 display!                                                                                                                                                                                                                                                                                      
libva info: va_openDriver() returns 0                                                                                                                                                                                                                                                                                        
[7885:7885:1019/161011:ERROR:vaapi_tfp_picture.cc(57)] Failed creating a GLX Pixmap for TFP                                                                                                                                                                                                                                  
[7885:7885:1019/161011:ERROR:vaapi_video_decode_accelerator.cc(817)] Failed to allocate memory for a VaapiPicture                                                                                                                                                                                                            
[7885:7885:1019/161011:ERROR:vaapi_video_decode_accelerator.cc(288)] Notifying of error 4                                                                                                                                                                                                                                    
[170:215:1019/161011:ERROR:ffmpeg_video_decoder.cc(323)] Error decoding video: timestamp: 4190000 duration: 1770000 size: 1044 side_data_size: 0 is_key_frame: 0 encrypted: 0 discard_padding (ms): (0, 0)                                                                                                                   
[170:170:1019/161011:ERROR:render_media_log.cc(25)] MediaEvent: PIPELINE_ERROR pipeline: decode error 

without patch, the messages and warnings gone, but the GIF/videos on twitter playback fine

(apply both patches ( https://github.com/saiarcot895/chromium-ubuntu-build/blob/master/debian/patches/enable_vaapi_on_linux.diff and https://github.com/saiarcot895/chromium-ubuntu-build/blob/master/debian/patches/specify-max-resolution.patch. both untouched except change the paths of libav drivers on bpf_gpu_policy_linux.cc)

@zepto88
Copy link

zepto88 commented Oct 24, 2016

Ive managed to apply patch https://aur.archlinux.org/packages/chromium-vaapi/ onto chromium 53.0.2785.116 and it runs fine. My issue is playback of 4k h264 files, they stutter a lot. device specification is fine, runs same 4k video smooth in mpv with vaapi hwdec. What could be the issue? I noticed the cpu load dropped by alot after the patch so it runs with the va drivers and decodes with vaapi.

@sjnewbury
Copy link

On Mon, 2016-10-17 at 17:49 -0700, samcv wrote:

With @sjnewbury patch for 55, applying to 54, I get this error on
launching chromium. Even if I use my old version of
bpf_gpu_policy_linux.cc it still causes this error. I have a feeling
it's crashing before the VAAPI drivers are even dlopened. I am seeing
this on Radeon and Intel.
[22612:22612:1018/000506:ERROR:sandbox_linux.cc(343)]
InitializeSandbox() called with multiple threads in process gpu-
process. 
Received signal 11 SEGV_MAPERR 000000000000
#0 0x5576f039795e
#1 0x5576f0397d19
#2 0x7f6f21658080
r8: 00005576f6e4c410 r9: 0000000000000000 r10: 0000000000000036 r11:
00007f6f071cc2cc
r12: 00007ffef4a4fef0 r13: 00005576f6e4c410 r14: 00005576f6ce88ed
r15: 00007ffef4a50640
di: 00005576f836cc00 si: 0000000000000000 bp: 00005576f6e4c408 bx:
00005576f6e4c408
dx: 0000000000000001 ax: 00005576f836cc00 cx: 0000000000000000 sp:
00007ffef4a4fa48
ip: 0000000000000000 efl: 0000000000010206 cgf: 002b000000000033 erf:
0000000000000014
trp: 000000000000000e msk: 0000000000000000 cr2: 0000000000000000
[end of stack trace]
[22506:22525:1018/000506:ERROR:browser_gpu_channel_host_factory.cc(11
3)] Failed to launch GPU process.
I did have an earlier version built against 53 and 54.  In the end I
just concentrated on 55 since it otherwise just worked much better.

I'll see if I can update my 54 patch with the changes saiarcot895 made.

@sjnewbury
Copy link

On Mon, 2016-10-24 at 11:38 -0700, zepto88 wrote:

Ive managed to apply patch https://aur.archlinux.org/packages/chromiu
m-vaapi/ onto chromium 53.0.2785.116 and it runs fine. My issue is
playback of 4k h264 files, they stutter a lot. device specification
is fine, runs same 4k video smooth in mpv with vaapi hwdec. What
could be the issue? I noticed the cpu load dropped by alot after the
patch so it runs with the va drivers and decodes with vaapi.
 
There is probably more overhead with Chromium/VAAPI than mpv/VAAPI due
to more buffer copies.  Whether that's the reason..??  Hopefully
GpuMemoryBuffers will be possible on Linux soon.

@sjnewbury
Copy link

On Wed, 2016-10-19 at 07:16 -0700, Gustavo Alvarez wrote:

@sjnewbury is not a ffmpeg glich, because for eaxple fail with all
GIF/videos in twitter. without patch all runs fine
steps:
close all chromium process
open chromium
go to twitter (if you have a account and have twits with gif/videos)
libva info: VA-API version 0.39.3
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/dri/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_0_39
Failed to create dedicated X11
display!                                                             
                                                                     
                                                                     
                                                                     
          
libva info: va_openDriver() returns
0                                                                    
                                                                     
                                                                     
                                                                     
     
[7885:7885:1019/161011:ERROR:vaapi_tfp_picture.cc(57)] Failed
creating a GLX Pixmap for
TFP                                                                  
                                                                     
                                                                     
                      
[7885:7885:1019/161011:ERROR:vaapi_video_decode_accelerator.cc(817)]
Failed to allocate memory for a
VaapiPicture                                                         
                                                                     
                                                                     
         
[7885:7885:1019/161011:ERROR:vaapi_video_decode_accelerator.cc(288)]
Notifying of error
4                                                                    
                                                                     
                                                                     
                      
[170:215:1019/161011:ERROR:ffmpeg_video_decoder.cc(323)] Error
decoding video: timestamp: 4190000 duration: 1770000 size: 1044
side_data_size: 0 is_key_frame: 0 encrypted: 0 discard_padding (ms):
(0,
0)                                                                   
                                                
[170:170:1019/161011:ERROR:render_media_log.cc(25)] MediaEvent:
PIPELINE_ERROR pipeline: decode error 
without patch, the messages and warnings gone, but the GIF/videos on
twitter playback fine
 
I suspect it's a Chromium "bug" rather than one in ffmpeg.  I put that
in quotes because it's likely specific to the aged VDPAU VA driver
since it works fine with at least i965.  Has anybody tested it with the
Nouveau or Radeon VAAPI drivers?  It really needs to be looked at by
someone more familiar with the code.

@zepto88
Copy link

zepto88 commented Oct 27, 2016

I found my problem, obviously i thought the problem was inside chromium but instead it was the window manager. When i turned off the compositor i have a steady 30 fps :)

@piotrasd
Copy link

piotrasd commented Dec 15, 2016

@saiarcot895 please ping on my email, big thx ! please ? :)

@bugz8unny69
Copy link

Hello,

Through the thread, I've seen work only being done for Intel iGPU and Nvidia VDPAU. How about AMD GPUs? Is there any working VAAPI patch for ArchLinux on AMD hardware?

@andersrh
Copy link

@zepto88 saiarcot895 mentioned earlier that there is some maximum resolution in the patch which specifies what resolution can be decoded. It is set to 1920x1080 I think. Maybe that should be changed in the builds? I have the same issue with 4K videos.

@saiarcot895
Copy link
Owner

Everyone subscribed to this thread,

Note that there's been a change in the hardware video decoding patch. An Intel contributor is working on committing a patch to compile in hardware video decoding by default. I've taken his patch and am using it instead of the current patch. Currently, the dev PPA has a build (for Ubuntu 16.04 and newer) with the new patch included, and the beta PPA will have a build soon.

What this will mean for you is that you will need to manually enable hardware video decoding from the about:flags page. Otherwise, it will not be used.

Additionally, there's been a report of this working for AMD as well, so @LHorace, you may want to try this.

@sl1pkn07
Copy link
Author

sl1pkn07 commented Aug 17, 2017

not for me (nvidia with privative drivers). i'm not sure if with nouveau works

libva info: VA-API version 0.40.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/dri/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_0_35
libva info: va_openDriver() returns 0
[23274:23274:0815/121039.684356:ERROR:vaapi_wrapper.cc(464)] vaQuerySurfaceAttributes failed VA error: invalid parameter
[23274:23274:0815/121039.684397:ERROR:vaapi_wrapper.cc(334)] GetMaxResolution failed for va_profile 0 and entrypoint 1
[23274:23274:0815/121039.684407:ERROR:vaapi_wrapper.cc(464)] vaQuerySurfaceAttributes failed VA error: invalid parameter
[23274:23274:0815/121039.684411:ERROR:vaapi_wrapper.cc(334)] GetMaxResolution failed for va_profile 1 and entrypoint 1
[23274:23274:0815/121039.684423:ERROR:vaapi_wrapper.cc(464)] vaQuerySurfaceAttributes failed VA error: invalid parameter
[23274:23274:0815/121039.684429:ERROR:vaapi_wrapper.cc(334)] GetMaxResolution failed for va_profile 2 and entrypoint 1
[23274:23274:0815/121039.684443:ERROR:vaapi_wrapper.cc(464)] vaQuerySurfaceAttributes failed VA error: invalid parameter
[23274:23274:0815/121039.684454:ERROR:vaapi_wrapper.cc(334)] GetMaxResolution failed for va_profile 3 and entrypoint 1
[23274:23274:0815/121039.684464:ERROR:vaapi_wrapper.cc(464)] vaQuerySurfaceAttributes failed VA error: invalid parameter
[23274:23274:0815/121039.684475:ERROR:vaapi_wrapper.cc(334)] GetMaxResolution failed for va_profile 5 and entrypoint 1
[23274:23274:0815/121039.684489:ERROR:vaapi_wrapper.cc(464)] vaQuerySurfaceAttributes failed VA error: invalid parameter
[23274:23274:0815/121039.684502:ERROR:vaapi_wrapper.cc(334)] GetMaxResolution failed for va_profile 6 and entrypoint 1
[23274:23274:0815/121039.684517:ERROR:vaapi_wrapper.cc(464)] vaQuerySurfaceAttributes failed VA error: invalid parameter
[23274:23274:0815/121039.684528:ERROR:vaapi_wrapper.cc(334)] GetMaxResolution failed for va_profile 7 and entrypoint 1
[23274:23274:0815/121039.684544:ERROR:vaapi_wrapper.cc(464)] vaQuerySurfaceAttributes failed VA error: invalid parameter
[23274:23274:0815/121039.684554:ERROR:vaapi_wrapper.cc(334)] GetMaxResolution failed for va_profile 8 and entrypoint 1
[23274:23274:0815/121039.684570:ERROR:vaapi_wrapper.cc(464)] vaQuerySurfaceAttributes failed VA error: invalid parameter
[23274:23274:0815/121039.684582:ERROR:vaapi_wrapper.cc(334)] GetMaxResolution failed for va_profile 9 and entrypoint 1
[23274:23274:0815/121039.684595:ERROR:vaapi_wrapper.cc(464)] vaQuerySurfaceAttributes failed VA error: invalid parameter
[23274:23274:0815/121039.684605:ERROR:vaapi_wrapper.cc(334)] GetMaxResolution failed for va_profile 10 and entrypoint 1
vdpau_video: vaTerminate(): config ID 0x01000000 is still allocated, destroying
vdpau_video: vaTerminate(): config ID 0x01000001 is still allocated, destroying
vdpau_video: vaTerminate(): config ID 0x01000002 is still allocated, destroying
vdpau_video: vaTerminate(): config ID 0x01000003 is still allocated, destroying
vdpau_video: vaTerminate(): config ID 0x01000004 is still allocated, destroying
vdpau_video: vaTerminate(): config ID 0x01000005 is still allocated, destroying
vdpau_video: vaTerminate(): config ID 0x01000006 is still allocated, destroying
vdpau_video: vaTerminate(): config ID 0x01000007 is still allocated, destroying
vdpau_video: vaTerminate(): config ID 0x01000008 is still allocated, destroying
vdpau_video: vaTerminate(): config ID 0x01000009 is still allocated, destroying

one question. with that patch, the "libva-vdpau-driver-chromium" from @sjnewbury is still needed?

greetings

@sjnewbury
Copy link

sjnewbury commented Aug 24, 2017 via email

@bugz8unny69
Copy link

Great! Although I am not quite sure if it's working? I am on chromium-dev 62.0.3192.0-1 and I did enable the two flags. At first glance, don't appear to be any change in CPU usage, watching a youtube video? No crash and/or video artifacts.

@saiarcot895
Copy link
Owner

There is no build of 62.0.3192.0 yet; you probably mean 62.0.3178.0.

It seemed to be working for me, at least based on the VAAPI library info being printed out to the console.

@dagraver
Copy link

@LHorace @saiarcot895 I just found out it appears video acceleration has been disabled by default. I actually had to use '--enable-accelerated-video' on the command line (or you could enable it in chrome://flags) to actually activate hardware decoding, despite positive va-stuff being printed. CPU usage was high before I enabled it.

You can easily check this, because with every hw-accelerated video started the chromium would output an additional (at least is does on mine).

libva info: VA-API version 0.39.4
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0

@bugz8unny69
Copy link

bugz8unny69 commented Aug 28, 2017

@saiarcot895 Copy & paste bud, maybe ArchLinux have the version mixed up, not on Linux atm. Wait, I just remembered, I am using archlinuxcn. Chromium Dev 62.0.3192.0-1. I also see he has, chromium dev-vaapi 61.0.3141.7-1. I'll give that one a shot too.

@dagraver Actually, I did see --enable-accelerate-video in my process list after I enabled the two flags. One thing for sure, at least for now, I don't seem to be experiencing any screen tearing. I'll check if I see that information next time I run chromium!

@sjnewbury
Copy link

I've updated my Gentoo chromium ebuild to use the new in-development patch.

@saiarcot895
Copy link
Owner

Closing this issue.

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