disable avx + avx2 in chromium

582 views
Skip to first unread message

Toan Pham

unread,
Dec 20, 2017, 7:32:31 PM12/20/17
to Chromium-dev




Hi,

I am building chromium from within qt-5.10.0, and that I am having trouble disabling avx and avx2 in chromium.
I've managed to get libvpx not to use avx+avx2, but then I running into an issue with libyuv always try to use avx instructions.  I haven't figured out how to disable libyuv completely or tell libyuv not to use AVX+AVX2. 

Would someone kindly tell me if it is possible to completely disable AVX+AVX2 when building chromium, if so, how?


thank you.



Reference:  Error i've been getting when using a compiler that's optimized for pentium4 (obviously no avx2 support).


/TOOLCHAIN/build/nicebox-9.0-trunk-nicebox-x86-pentium4-linux/TOOLCHAIN/tools.chroot/wrapper/g++ -MMD -MF obj/third_party/libyuv/libyuv_internal/scale_gcc.o.d -DHAVE_JPEG -DV8_DEPRECATION_WARNINGS -DUSE_UDEV -DUSE
_AURA=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DNO_TCMALLOC -DDISABLE_NACL -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED -DTOOLKIT_QT -D_FILE_OFFSET_BITS=6
4 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -Igen -I../../3rdparty/chromium -I../../3rdparty/chromium/third_part
y/libyuv/include -I../../3rdparty/chromium/third_party/libjpeg_turbo -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -funwind-
tables -fPIC -pipe -pthread -m32 -msse2 -mfpmath=sse -mmmx -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-unused-parameter -fom
it-frame-pointer -g0 -fvisibility=hidden -O2 -fno-ident -fdata-sections -ffunction-sections -std=gnu++11 -Wno-narrowing -fno-rtti -fno-exceptions -fvisibility-inlines-hidden -c ../../3rdparty/chromium/third_party/
libyuv/source/scale_gcc.cc -o obj/third_party/libyuv/libyuv_internal/scale_gcc.o
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Inappropriate ioctl for device
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Inappropriate ioctl for device
../../3rdparty/chromium/third_party/libyuv/source/scale_gcc.cc: Assembler messages:
../../3rdparty/chromium/third_party/libyuv/source/scale_gcc.cc:222: Error: operand type mismatch for `vpsrlw'
../../3rdparty/chromium/third_party/libyuv/source/scale_gcc.cc:223: Error: operand type mismatch for `vpsrlw'
../../3rdparty/chromium/third_party/libyuv/source/scale_gcc.cc:224: Error: operand type mismatch for `vpackuswb'
../../3rdparty/chromium/third_party/libyuv/source/scale_gcc.cc:225: Error: no such instruction: `vpermq $0xd8,%ymm0,%ymm0'
../../3rdparty/chromium/third_party/libyuv/source/scale_gcc.cc:252: Error: operand type mismatch for `vpcmpeqb'
../../3rdparty/chromium/third_party/libyuv/source/scale_gcc.cc:253: Error: operand type mismatch for `vpsrlw'
../../3rdparty/chromium/third_party/libyuv/source/scale_gcc.cc:254: Error: operand type mismatch for `vpackuswb'
../../3rdparty/chromium/third_party/libyuv/source/scale_gcc.cc:255: Error: operand type mismatch for `vpxor'
../../3rdparty/chromium/third_party/libyuv/source/scale_gcc.cc:260: Error: operand type mismatch for `vpmaddubsw'
../../3rdparty/chromium/third_party/libyuv/source/scale_gcc.cc:261: Error: operand type mismatch for `vpmaddubsw'
../../3rdparty/chromium/third_party/libyuv/source/scale_gcc.cc:262: Error: operand type mismatch for `vpavgw'
../../3rdparty/chromium/third_party/libyuv/source/scale_gcc.cc:263: Error: operand type mismatch for `vpavgw'
../../3rdparty/chromium/third_party/libyuv/source/scale_gcc.cc:264: Error: operand type mismatch for `vpackuswb'
../../3rdparty/chromium/third_party/libyuv/source/scale_gcc.cc:265: Error: no such instruction: `vpermq $0xd8,%ymm0,%ymm0'
../../3rdparty/chromium/third_party/libyuv/source/scale_gcc.cc:295: Error: operand type mismatch for `vpcmpeqb'
../../3rdparty/chromium/third_party/libyuv/source/scale_gcc.cc:296: Error: operand type mismatch for `vpsrlw'
../../3rdparty/chromium/third_party/libyuv/source/scale_gcc.cc:297: Error: operand type mismatch for `vpackuswb'
../../3rdparty/chromium/third_party/libyuv/source/scale_gcc.cc:298: Error: operand type mismatch for `vpxor'
../../3rdparty/chromium/third_party/libyuv/source/scale_gcc.cc:305: Error: operand type mismatch for `vpmaddubsw'
../../3rdparty/chromium/third_party/libyuv/source/scale_gcc.cc:306: Error: operand type mismatch for `vpmaddubsw'
../../3rdparty/chromium/third_party/libyuv/source/scale_gcc.cc:307: Error: operand type mismatch for `vpmaddubsw'




Toan Pham

unread,
Dec 20, 2017, 8:51:36 PM12/20/17
to Chromium-dev


Hi,

I found a solution to disable AVX and AVX2 in libyu.

Comment out this line

#define GCC_HAS_AVX2 1

in libyuv/include/row.h and libuyv/include/scale_row.h


It would be nice if there is a configuration to disable the feature (at config time), instead of hacking the header file.


TP




--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/9c42e4e7-da09-4606-bbb8-3885e897f40e%40chromium.org.

Reply all
Reply to author
Forward
0 new messages