-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Compilation with target POWER8 fails in AIX 7.2 #1997
Comments
What does |
We are using AIX native assembler & linker and not GNU assembler and linker. And i am thinking most likely nobody would have tried AIX build (with TARGET=POWER8). |
Heh, sorry, did not recognise you right away. I suspect we never hit this in #1803 as TeejIBM kept building for POWER5 |
Yes, that's right. |
Could this be similar to #1699 (AIX native tools apparently not accepting register names "vs") ? |
That issue mainly targets the problem with XLC compiler. From a high level view, it looks like the error seems to be coming from gcc compiler (and not from the assembler itself) . But may be it's internally related ? |
If it was gcc then I think @quickwritereader would have encountered the problem already(?). |
I don't have any idea of that issue. gcc 7.2 did not complain when I used it.
If anyone have an idea here are constraints
|
@martin-frbg There is no idamax.c & idamin.c inside kernel/arm. |
Indeed these are ../arm/iamax.c and ../arm/iamin.c , sorry. |
With the above mentioned changes, compilation proceeded further and finally stops with an assembler error. Debugging the error reveals that this instruction "xxswapd" is not understandable by AIX assembler. After some searching , it appears to me that this instruction is used to convert BIG-ENDIAN word format to LITTLE-ENDIAN format. And AIX being a BIG-ENDIAN , it may not need this. So i am thinking to remove this line from all the files. |
This could point to a bigger problem unfortunately. Actually I am not sure about the status of Power8BE support - I suspect all the recent work by quickwritereader was done on and for LITTLE-ENDIAN systems. |
Actually looking at the code, the "xxswapd" instruction is used only in the older Power8 kernels written by wernsaar and only some of them have any |
Okay. Not sure why AIX assembler couldn't able to recognize "xxswapd" . May be the implementation is not there ? Will check with the AIX assembler guys. |
Try to prepend gnu binutils in path. Or if you have idea about other assembler(s) around. |
@brada4 he mentioned above that he is not using gnu assembler on purpose, as it still has problems on AIX. Also the problem appears to be with wernsaar's handcoded assembly files, so code generation by gcc is probably not involved. Also note that he works for IBM (and IIRC on the team that ports open source software to AIX). |
But it is worth mentioning IF gas works in this context, i.e if assemblies are completely wrong for modern AIX, or need small improvement to be more usable. |
"xxswapd" implementation is not there in AIX according to the AIX assembler team. They mentioned it's an extended mnemonic and one can use" xxpermdi" (with proper args) as an alternative. @brada4 We can't use gas (GNU assembler) right now in AIX. Some time long back binutils is ported to AIX but not properly. Still the XCOFF object files created by gas is not recognizable by GNU linker (or AIX native linker). So we are broken. I will try to use the alternative mnemonic "xxpermdi" but as @martin-frbg pointed out that the work is done for little-endian systems , i may encounter runtime issues in AIX (which is big-endian). |
Actually I am still unclear about the implementation status - the presence of |
Perhaps the quickest approach is to simply comment out all occurences of xxswapd on the assumption that they appear in LE-specific code. At the very least this would allow other syntax problems to show, |
@martin-frbg Right. That is what i am going to do now. |
Any progress ? If the presence of |
I took a different approach. OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 ./dblat3 < ./dblat3.dat Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: Then i tried TARGET=POWER7 which fall back to POWER6 and the build is successful. It ran openblas_utest as part of the build and all tests passed. I tried the same on AIX and the build is successful but openblas_utest is not running as part of the build. Manually invoking it , i don't see any tests run. Any idea on this ? |
I am not sure if I understand the inner workings of ctest.h, but I see nothing specific to or against AIX there. openblas_utest not running at all during the build should only happen when the build system is |
Okay. I see CROSS is set to 1 during AIX build and that is the reason the main BLAS tests are not running. But still i see openblas_utest is not getting properly executed. You told to build utest_main2.c manually. But i see the binary is made by multiple object files. Let me dig more on this. |
utest_main2.c has all the tests included, so something like this should work: |
It worked. Earlier i was checking on utest_main.c instead of utest_main2.c. My mistake. |
That does look encouraging, so at least POWER6 appears to be working for AIX. (The check for cross-compilation in c_check makes some doubtful assumptions based on the presence of dashes in the compiler name and path if I remember correctly) |
So it seems like with TARGET=POWER6 , the code is working in Power Big-Endian as well. |
@martin-frbg Thanks for all your support. |
I am trying to create a shared object in AIX using the library archive "libopenblas_power6p-r0.3.5.a" . |
Aix ld manual says it defaults to linking in all unique symbols from command line archives unless told otherwise. It is in local manual page just like in one ifound on the internet. |
FYI, there is a similar segfault error as reported above
FYI, there is a similar segfault with linux gnu compiler for ppc64(BE) as reported with openSUSE |
Checked the bugzilla . The stack trace looks similar. |
the stack traces need function names. I can just guess 0x1 are program and 0x3f are something else, like vdso style stub or libc or kernel. |
I now remember that PPC64BE failure was also mentioned in passing in #1469 (RedHat/Fedora), I understood they normally build for POWER6 as least common denominator. This should probably be made the default in the build system for big-endian until the current power8 kernels are modified to work on big endian as well. (Can I rely on |
In AIX , uname -m shows Machine ID number. So not a good option. Checking on more generic options. |
How about this ? But this will support only gcc installed systems. |
Sorry, I assume in AIX Big Endian is a given, so this would matter "only" for Linux (and perhaps any BSD) ? |
Okay. In that case , i think "uname -m" would be sufficient. Not sure about BSD though. |
It is somewhere else like sysctl hw |
I checked it and did some testing. It never worked. It always requires a export file if one needs to create a shared object from an archive containing object files in AIX. If no export file is given, then no symbols are exported. Even checked with the AIX linker team here. |
Because of the above situation, i have to depend on scripts like "CreateExportList" to create the export file before in hand. And the AIX specific asm syntax in file common_power.h needs some changes for which i will create a PR. |
This should be fixed now with kavanabhat's #2338 |
I am trying to compile OpenBLAS (develop branch) in AIX 7.2 with TARGET=POWER8.
GCC compiler used is 8.1.0 version.
#oslevel -s
7200-03-00-0000
#prtconf
System Model: IBM,8286-42A
Machine Serial Number: 1005CEV
Processor Type: PowerPC_POWER8
Processor Implementation Mode: POWER 8
#make BINARY=64 CC="gcc -maix64" FC="gfortran -maix64" CXX="g++ -maix64" TARGET=POWER8
......
......
gcc -maix64 -c -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp -DMAX_STACK_ALLOC=2048 -fopenmp -Wall -DF_INTERFACE_GFORT
-fPIC -DSMP_SERVER -DUSE_OPENMP -DNO_WARMUP -DMAX_CPU_NUMBER=2 -DMAX_PARALLEL_NUMBER=1 -DVERSION="0.3.6.dev" -mpowerpc64 -maix64 -DASMNAME=idamax_k -DASMFNAME=i
damax_k_ -DNAME=idamax_k_ -DCNAME=idamax_k -DCHAR_NAME="idamax_k_" -DCHAR_CNAME="idamax_k" -DNO_AFFINITY -I.. -DDOUBLE -UCOMPLEX -UCOMPLEX -DDOUBLE -DUSE_ABS
-UUSE_MIN ../kernel/power/idamax.c -o idamax_k.o
gcc -maix64 -c -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp -DMAX_STACK_ALLOC=2048 -fopenmp -Wall -DF_INTERFACE_GFORT
-fPIC -DSMP_SERVER -DUSE_OPENMP -DNO_WARMUP -DMAX_CPU_NUMBER=2 -DMAX_PARALLEL_NUMBER=1 -DVERSION="0.3.6.dev" -mpowerpc64 -maix64 -DASMNAME=idamin_k -DASMFNAME=i
damin_k_ -DNAME=idamin_k_ -DCNAME=idamin_k -DCHAR_NAME="idamin_k_" -DCHAR_CNAME="idamin_k" -DNO_AFFINITY -I.. -DDOUBLE -UCOMPLEX -UCOMPLEX -DDOUBLE -DUSE_ABS
-DUSE_MIN ../kernel/power/idamin.c -o idamin_k.o
../kernel/power/idamin.c: In function 'idamin_k':
../kernel/power/idamin.c:52:5: error: 'asm' operand has impossible constraints
asm(
^~~~~~~
../kernel/power/idamax.c: In function 'idamax_k':
../kernel/power/idamax.c:52:5: error: 'asm' operand has impossible constraints
asm(
^~~~~~~
make[1]: *** [Makefile.L1:564: idamax_k.o] Error 1
There is something inside the asm code which is not valid for AIX it seems.
The text was updated successfully, but these errors were encountered: