Trying to get rocm running on my system (amd ryzen 2700/amd rx 6700 xt), compilation fails at this step. Reproducible: Always Steps to Reproduce: emerge -avt =sci-libs/rocBLAS-5.1.3 Actual Results: FAILED: library/src/CMakeFiles/rocblas.dir/blas2/rocblas_gemv_kernels.cpp.o /usr/sbin/hipcc -DBUILD_WITH_TENSILE=1 -DROCBLAS_INTERNAL_API -DROCM_USE_FLOAT16 -DTENSILE_DEFAULT_SERIALIZATION -DTENSILE_MSGPACK=1 -DTENSILE_USE_HIP -D__HIP_PLATFORM_AMD__=1 -D__HIP_PLATFORM_HCC__=1 -Drocblas_EXPORTS -I/var/tmp/portage/sci-libs/rocBLAS-5.1.3/work/rocBLAS-rocm-5.1.3/library/include -I/var/tmp/portage/sci-libs/rocBLAS-5.1.3/work/rocBLAS-rocm-5.1.3/library/include/internal -I/var/tmp/portage/sci-libs/rocBLAS-5.1.3/work/rocBLAS-rocm-5.1.3/library/src/include -I/var/tmp/portage/sci-libs/rocBLAS-5.1.3/work/rocBLAS-rocm-5.1.3_build/include/internal -I/var/tmp/portage/sci-libs/rocBLAS-5.1.3/work/rocBLAS-rocm-5.1.3/library/src/blas3/Tensile -I/var/tmp/portage/sci-libs/rocBLAS-5.1.3/work/rocBLAS-rocm-5.1.3_build/include -I/usr/share/Tensile/Source/lib/include -O2 -pipe -march=znver1 -D__HIP_HCC_COMPAT_MODE__=1 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wno-unused-command-line-argument -Wno-unused-result -mf16c -Werror=vla -x hip --hip-device-lib-path=/usr/lib/amdgcn/bitcode --offload-arch=gfx1010 -std=c++17 -MD -MT library/src/CMakeFiles/rocblas.dir/blas2/rocblas_gemv_kernels.cpp.o -MF library/src/CMakeFiles/rocblas.dir/blas2/rocblas_gemv_kernels.cpp.o.d -o library/src/CMakeFiles/rocblas.dir/blas2/rocblas_gemv_kernels.cpp.o -c /var/tmp/portage/sci-libs/rocBLAS-5.1.3/work/rocBLAS-rocm-5.1.3/library/src/blas2/rocblas_gemv_kernels.cpp fatal error: error in backend: Cannot select: 0x55756dea2098: i64 = FrameIndex<0> In function: _Z15gemvt_sn_kernelILb0ELi256ELi4Ei19rocblas_complex_numIdEPKS1_S1_EviiT4_lPKT5_lT2_lS7_lilPT3_ clang-15: error: clang frontend command failed with exit code 70 (use -v to see invocation) clang version 15.0.6 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/lib/llvm/15/bin Configuration file: /etc/clang/clang++.cfg clang-15: note: diagnostic msg: Error generating preprocessed source(s). Expected Results: successful compilation emerge --info: Portage 3.0.43 (python 3.10.9-final-0, default/linux/amd64/17.1/desktop/systemd/merged-usr, gcc-12, glibc-2.36-r6, 6.1.1-gentoo x86_64) ================================================================= System Settings ================================================================= System uname: Linux-6.1.1-gentoo-x86_64-AMD_Ryzen_7_2700X_Eight-Core_Processor-with-glibc2.36 KiB Mem: 32771188 total, 16030560 free KiB Swap: 0 total, 0 free Timestamp of repository gentoo: Wed, 11 Jan 2023 00:02:21 +0000 Head commit of repository gentoo: 11a540910df07b7e727efe12b46adca4af8bdda3 Timestamp of repository brave-overlay: Tue, 10 Jan 2023 17:17:03 +0000 Head commit of repository brave-overlay: 8ed71c3e3a1de4e49a1032e7ee0780adf5a3d44a Timestamp of repository guru: Tue, 10 Jan 2023 17:47:55 +0000 Head commit of repository guru: 6456e2be58cffe0aed94194363065c241d156ed2 Head commit of repository kindletool: c53817c98637fce14aa7a6037470cf6e3659593f Timestamp of repository menelkir: Tue, 10 Jan 2023 17:47:56 +0000 Head commit of repository menelkir: dd6f112fb3627779aa5d919ce0af6c46ee315110 Timestamp of repository musl: Tue, 10 Jan 2023 17:47:42 +0000 Head commit of repository musl: 5c2be20ff529c865e619130250a132f7898b5c5b Timestamp of repository pentoo: Tue, 10 Jan 2023 17:47:42 +0000 Head commit of repository pentoo: 991b7fe639c75ec0931bb8a94d4f429d64529c6a Timestamp of repository steam-overlay: Tue, 10 Jan 2023 17:47:44 +0000 Head commit of repository steam-overlay: 03e78314c4c6343b9fe7aab35b4538b0a3aba524 Timestamp of repository stha09: Tue, 10 Jan 2023 17:48:00 +0000 Head commit of repository stha09: 9a4001602d125726b1173ccec79b572f7fe2e26c sh bash 5.2_p15 ld GNU ld (Gentoo 2.39 p5) 2.39.0 ccache version 4.7.4 [disabled] app-misc/pax-utils: 1.3.6::gentoo app-shells/bash: 5.2_p15::gentoo dev-java/java-config: 2.3.1::gentoo dev-lang/perl: 5.36.0-r1::gentoo dev-lang/python: 2.7.18_p16::gentoo, 3.10.9::gentoo, 3.11.1::gentoo dev-lang/rust: 1.66.0::gentoo dev-util/ccache: 4.7.4::gentoo dev-util/cmake: 3.25.1::gentoo dev-util/meson: 1.0.0::gentoo sys-apps/baselayout: 2.9::gentoo sys-apps/sandbox: 2.30-r1::gentoo sys-apps/systemd: 252.4::gentoo sys-devel/autoconf: 2.71-r5::gentoo sys-devel/automake: 1.16.5::gentoo sys-devel/binutils: 2.39-r4::gentoo sys-devel/binutils-config: 5.5::gentoo sys-devel/clang: 15.0.6-r1::gentoo sys-devel/gcc: 12.2.1_p20221231::gentoo sys-devel/gcc-config: 2.10::gentoo sys-devel/libtool: 2.4.7-r1::gentoo sys-devel/lld: 15.0.6::gentoo sys-devel/llvm: 15.0.6-r1::gentoo sys-devel/make: 4.4::gentoo sys-kernel/linux-headers: 6.1::gentoo (virtual/os-headers) sys-libs/glibc: 2.36-r6::gentoo Repositories: gentoo location: /var/db/repos/gentoo sync-type: git sync-uri: https://github.com/gentoo-mirror/gentoo.git priority: -1000 volatile: True brave-overlay location: /var/db/repos/brave-overlay sync-type: git sync-uri: https://github.com/gentoo-mirror/brave-overlay.git masters: gentoo volatile: True crossdev location: /var/db/repos/crossdev masters: gentoo volatile: True guru location: /var/db/repos/guru sync-type: git sync-uri: https://github.com/gentoo-mirror/guru.git masters: gentoo volatile: True hanetzer location: /var/db/repos/hanetzer masters: gentoo volatile: True kindletool location: /var/db/repos/kindletool sync-type: git sync-uri: https://github.com/NiLuJe/gentoo-kindletool.git masters: gentoo volatile: True menelkir location: /var/db/repos/menelkir sync-type: git sync-uri: https://github.com/gentoo-mirror/menelkir.git masters: gentoo volatile: True musl location: /var/db/repos/musl sync-type: git sync-uri: https://github.com/gentoo-mirror/musl.git masters: gentoo volatile: True pentoo location: /var/db/repos/pentoo sync-type: git sync-uri: https://github.com/gentoo-mirror/pentoo.git masters: gentoo volatile: True steam-overlay location: /var/db/repos/steam-overlay sync-type: git sync-uri: https://github.com/gentoo-mirror/steam-overlay.git masters: gentoo volatile: True stha09 location: /var/db/repos/stha09 sync-type: git sync-uri: https://github.com/gentoo-mirror/stha09.git masters: gentoo volatile: True ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="@FREE free-noncomm grass-ipafonts Kermit MagentaMgOpen Mojang Snes9x unRAR vba" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe -march=znver1" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php8.2/ext-active/ /etc/php/cgi-php8.2/ext-active/ /etc/php/cli-php8.2/ext-active/ /etc/php/fpm-php8.2/ext-active/ /etc/php/phpdbg-php8.2/ext-active/ /etc/revdep-rebuild /etc/sandbox.d" CXXFLAGS="-O2 -pipe -march=znver1" DISTDIR="/var/cache/distfiles" ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME" FCFLAGS="-O2 -pipe -march=znver1" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe -march=znver1" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="C.UTF8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LEX="flex" MAKEOPTS="-j8" PKGDIR="/var/cache/binpkgs" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" PORTAGE_TMPDIR="/var/tmp" SHELL="/bin/bash" USE="X a52 aac acl acpi alsa amd64 bluetooth branding bzip2 cairo cdda cdr cjk cli crypt cups dbus dri dts dvd dvdr encode exif flac fortran gdbm gif gles2 gnome-keyring gpm gtk gui iconv icu ipv6 jpeg jpeg2k lcms libglvnd libnotify libtirpc mad mng mp3 mp4 mpeg mtp multilib ncurses nls nptl ogg opencl opengl openmp pam pango pcre pdf pipewire png policykit ppds pulseaudio qt5 readline screencast sdl seccomp sound spell ssl startup-notification svg system-ffmpeg system-icu systemd test-rust tiff truetype udev udisks unicode upower usb vaapi vorbis vulkan wayland wxwidgets x264 xattr xcb xft xml xv xvid xwayland zlib zsh-completion" ABI_X86="64" ADA_TARGET="gnat_2021" AMDGPU_TARGETS="gfx1010" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 aes avx avx2 f16c fma3 pclmul popcnt rdrand sha sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en-US ja" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="AArch64 AMDGPU ARM BPF PowerPC X86" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" RUBY_TARGETS="ruby26 ruby27 ruby30 ruby31" USERLAND="GNU" VIDEO_CARDS="amdgpu radeon radeonsi" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Created attachment 848143 [details] build.log
I'd also like to note that there are newer versions available. After bodging some of the patches to fit the new versions (5.3.3), it came down to the same build failure.
I get the same
Is this error specific to gfx1010? I'll try reproducing it on gfx1031 > Trying to get rocm running on my system (amd ryzen 2700/amd rx 6700 xt) Also, rx 6700 xt should be gfx1031. According to build log I guess you're using 5700 xt?
(In reply to Yiyang Wu from comment #4) > Is this error specific to gfx1010? I'll try reproducing it on gfx1031 > Confirmed on gfx1031
I have tried: llvm/clang-15.0.6 + rocm-device-libs/rocm-comgr/hip-5.3.3 : fail llvm/clang-15.0.6 + rocm-device-libs/rocm-comgr/hip-5.1.3 : fail llvm/clang-15.0.0_rc2 + rocm-device-libs/rocm-comgr/hip-5.1.3 : success So I guess something went wrong in llvm/clang-15 releases. Will do some further testing
(In reply to Yiyang Wu from comment #4) > Is this error specific to gfx1010? I'll try reproducing it on gfx1031 > > > Trying to get rocm running on my system (amd ryzen 2700/amd rx 6700 xt) > > Also, rx 6700 xt should be gfx1031. According to build log I guess you're > using 5700 xt? Ah yeh, misspoke/mistyped. Actual model is a: ASRock Radeon RX 5700 XT Taichi X
(In reply to Yiyang Wu from comment #6) > I have tried: > > llvm/clang-15.0.6 + rocm-device-libs/rocm-comgr/hip-5.3.3 : fail > llvm/clang-15.0.6 + rocm-device-libs/rocm-comgr/hip-5.1.3 : fail > llvm/clang-15.0.0_rc2 + rocm-device-libs/rocm-comgr/hip-5.1.3 : success > > So I guess something went wrong in llvm/clang-15 releases. Will do some > further testing Further bisecting shows the problem may come from the llvm-gentoo-patchset llvm/clang-15.0.1::gentoo + rocm-device-libs/rocm-comgr/hip-5.3.3 : success llvm/clang-15.0.2::gentoo + rocm-device-libs/rocm-comgr/hip-5.3.3 : fail llvm/clang-15.0.2::gentoo with llvm-gentoo-patchset-15.0.1 + rocm-device-libs/rocm-comgr/hip-5.3.3 : success
(In reply to Yiyang Wu from comment #8) > > llvm/clang-15.0.1::gentoo + rocm-device-libs/rocm-comgr/hip-5.3.3 : success > llvm/clang-15.0.2::gentoo + rocm-device-libs/rocm-comgr/hip-5.3.3 : fail > llvm/clang-15.0.2::gentoo with llvm-gentoo-patchset-15.0.1 + > rocm-device-libs/rocm-comgr/hip-5.3.3 : success As I tested, 0008-clang-Driver-More-flexible-rules-for-loading-default.patch can cause this bug
(In reply to Yiyang Wu from comment #9) > As I tested, 0008-clang-Driver-More-flexible-rules-for-loading-default.patch > can cause this bug CC the author of 0008-clang-Driver-More-flexible-rules-for-loading-default.patch
Could you try commenting stuff out in /etc/clang to see if any specific rule is causing it vs. loading config files at all?
(In reply to Michał Górny from comment #11) > Could you try commenting stuff out in /etc/clang to see if any specific rule > is causing it vs. loading config files at all? Commenting out `-fstack-protector-strong` in `/etc/clang/gentoo-hardened.cfg` can mitigate this bug
(In reply to Yiyang Wu from comment #12) > (In reply to Michał Górny from comment #11) > > Could you try commenting stuff out in /etc/clang to see if any specific rule > > is causing it vs. loading config files at all? > > Commenting out `-fstack-protector-strong` in > `/etc/clang/gentoo-hardened.cfg` can mitigate this bug Does that mean before clang-Driver-More-flexible-rules-for-loading-default.patch those configs never get loaded, so this bug is hidden?
According to https://github.com/ROCmSoftwarePlatform/Tensile/issues/1455#issuecomment-1007632229 https://github.com/ROCmSoftwarePlatform/rocBLAS/issues/437 `-fstack-protector-strong` can cause errors when compiling GPU kernels. The simplest solution would be disabling this flag in rocm.eclass
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bb6386121107a5a6f108a429e6042a237e07e371 commit bb6386121107a5a6f108a429e6042a237e07e371 Author: Yiyang Wu <xgreenlandforwyy@gmail.com> AuthorDate: 2023-01-20 10:12:16 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-01-21 03:32:16 +0000 dev-util/hip: append -fno-stack-protector for hipcc Closes: https://bugs.gentoo.org/890377 Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/29188 Signed-off-by: Sam James <sam@gentoo.org> dev-util/hip/files/hip-5.1.3-fno-stack-protector.patch | 16 ++++++++++++++++ .../hip/{hip-5.1.3-r2.ebuild => hip-5.1.3-r3.ebuild} | 1 + dev-util/hip/{hip-5.3.3.ebuild => hip-5.3.3-r1.ebuild} | 1 + 3 files changed, 18 insertions(+)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6992e6ff39664c798459db3f93e048a06095adf6 commit 6992e6ff39664c798459db3f93e048a06095adf6 Author: Sv. Lockal <lockalsash@gmail.com> AuthorDate: 2023-10-18 18:37:09 +0000 Commit: Benda Xu <heroxbd@gentoo.org> CommitDate: 2023-11-19 02:18:15 +0000 dev-util/hipcc-5.7.1: fix compilation issues - Restore the patch for adding -fno-stack-protector - Better handling of clang path using llvm.eclass - Fix the device lib path parsed to clang - QA: remove files installed to wrong location Bug: https://bugs.gentoo.org/890377 Bug: https://github.com/gentoo/gentoo/pull/33400 Signed-off-by: Sv. Lockal <lockalsash@gmail.com> Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com> Signed-off-by: Benda Xu <heroxbd@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/33845 .../files/hipcc-5.7.1-fno-stack-protector.patch | 13 ++++++++++++ ...hipcc-5.7.1-r1.ebuild => hipcc-5.7.1-r2.ebuild} | 24 +++++++++++++++++++--- dev-util/hipcc/hipcc-5.7.1.ebuild | 21 ------------------- 3 files changed, 34 insertions(+), 24 deletions(-)