1 |
On Thu, Oct 08, 2020 at 11:57:52AM +0000, Jonathan Yong wrote: |
2 |
> I am getting AVX2 related compile errors in 32bit media-libs/opencv-4.4.0, |
3 |
> there are some internet text mentioning not all AVX2 instructions are |
4 |
> supported on 32bit x86. |
5 |
> |
6 |
> For now, I have set -abi_x86_32 since I don't need it now. |
7 |
> |
8 |
> Any plans to support ABI specific USE masking/setting? |
9 |
|
10 |
Do you mean that you want to install the 32-bit and 64-bit version of a package, |
11 |
enabling one set of flags on one, and another set on the other? |
12 |
|
13 |
The problem you will face is that the CPU_FLAGS_X86 option, which allows you to |
14 |
disable AVX(2) instructions, amongst many other processor extensions [1], |
15 |
applies to both x86 and amd64 architectures, and from reading the according wiki |
16 |
page [2], I don't think it's possible to discriminate between those two; it is |
17 |
the responsibility of the package to test whether a particular AVX function |
18 |
should be employed or not. |
19 |
|
20 |
Can you post the output of `cpuid2cpuflags` (from app-portage/cpuid2cpuflags)? |
21 |
If this list includes "avx2", and the compilation is still failing, this is a |
22 |
BUG and should be reported as such. I think it's known to the Gentoo community |
23 |
already, although it seems to be an issue with upstream [3]. Analogous issues |
24 |
exist in other packages [4]. |
25 |
|
26 |
The problem in upstream is probably caused by this call to _mm256_extract_epi64 |
27 |
[5], introduced quite a while ago (the nature of this function, being exclusive |
28 |
to 64-bit processors, was even noted in the commit message [6]). |
29 |
|
30 |
It will probably be fixed soon. No need to worry since you don't need the 32-bit |
31 |
binary interface anyway. |
32 |
|
33 |
[1] https://gitweb.gentoo.org/repo/gentoo.git/plain/profiles/desc/cpu_flags_x86.desc |
34 |
[2] https://wiki.gentoo.org/wiki/CPU_FLAGS_X86#Configuration |
35 |
[3] https://bugs.gentoo.org/747163 |
36 |
[4] https://github.com/pytorch/pytorch/issues/17901 |
37 |
[5] https://github.com/opencv/opencv/blame/152e6476d9a270e6ce35d3f1b200a303654e576e/modules/core/include/opencv2/core/hal/intrin_avx.hpp#L130 |
38 |
[6] https://github.com/opencv/opencv/commit/75315fb297a010153d3acab8111ebb87d909cdcf |
39 |
|
40 |
-- |
41 |
|
42 |
Ashley Dixon |
43 |
suugaku.co.uk |
44 |
|
45 |
2A9A 4117 |
46 |
DA96 D18A |
47 |
8A7B B0D2 |
48 |
A30E BF25 |
49 |
F290 A8AA |