openucx / ucx

Unified Communication X (mailing list - https://elist.ornl.gov/mailman/listinfo/ucx-group)
http://www.openucx.org
Other
1.15k stars 427 forks source link

UCS/ARCH/BITOPS: gcc 12.3.0 fails to build x86_64 ucs_ffs32 #9774

Open tvegas1 opened 7 months ago

tvegas1 commented 7 months ago

Describe the bug

Issue to track that gcc fails to build UCX due to ucs_ffs32() in uct_dc_mlx5_ep_dci_release_progress():

make[1]: Entering directory '/maia/ucx/src/uct/ib'
  CC       dc/libuct_ib_la-dc_mlx5_ep.lo
<inline asm>:1:7: error: invalid operand for instruction
        bsfl %al,%eax
             ^~~

Steps to Reproduce

./contrib/configure-devel --prefix=$(pwd)/rfs
make -j && make install

Setup and versions

COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/12/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 12.3.0-1ubuntu1~22.04' --with-bugurl=file:///usr/share/doc/gcc-12/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-12 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-12-ALHxjy/gcc-12-12.3.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-12-ALHxjy/gcc-12-12.3.0/debian/tmp-gcn/usr --enable-offload-defaulted --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.3.0 (Ubuntu 12.3.0-1ubuntu1~22.04)
chunyulin commented 1 week ago

I encountered exactly the same error message but using nvhpc/24.7 after branch v1.16.x -- no compilation problem for v1.15.x. And GCC 8.5 works fine for all branches on my x86_64 machine. My OS is RHEL 8.9.

The minimal step to repro the issue on my machine is CC=nvc CXX=nvc++ ./configure; make. Here is the config report:

=========================================================
configure: UCX build configuration:
configure:         Build prefix:   /usr
configure:    Configuration dir:   /etc/ucx
configure:   Preprocessor flags:   -DCPU_FLAGS="" -I${abs_top_srcdir}/src -I${abs_top_builddir} -I${abs_top_builddir}/src
configure:           C compiler:   nvc -O3 -g -Wall -Werror --display_error_number --diag_suppress 1 --diag_suppress 68 --diag_suppress 111 --diag_suppress 167 --diag_suppress 181 --diag_suppress 188 --diag_suppress 381 --diag_suppress 1215 --diag_suppress 1901 --diag_suppress 1902 -Wno-unused-parameter -Wno-long-long -Wno-sign-compare -Wno-deprecated-declarations -Wnested-externs -Wshadow -Werror=declaration-after-statement
configure:         C++ compiler:   nvc++ -O3 -g -Wall -Werror --display_error_number --diag_suppress 1 --diag_suppress 68 --diag_suppress 111 --diag_suppress 167 --diag_suppress 181 --diag_suppress 188 --diag_suppress 381 --diag_suppress 1215 --diag_suppress 1901 --diag_suppress 1902 -Wno-unused-parameter -Wno-long-long -Wno-sign-compare -Wno-deprecated-declarations
configure:         Multi-thread:   disabled
configure:            MPI tests:   disabled
configure:          VFS support:   no
configure:        Devel headers:   no
configure: io_demo CUDA support:   no
configure:             Bindings:   < >
configure:          UCS modules:   < >
configure:          UCT modules:   < ib rdmacm cma knem xpmem >
configure:         CUDA modules:   < gdrcopy >
configure:         ROCM modules:   < >
configure:           IB modules:   < >
configure:          UCM modules:   < >
configure:         Perf modules:   < >
====================================================
tvegas1 commented 1 week ago

Do you have steps to repro the issue, maybe using docker container?