Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 920554 - sci-libs/rocBLAS-5.7.1-r1: TypeError: buildSourceCodeObjectFile() missing 2 required positional arguments: 'outputPath' and 'kernelFile'
Summary: sci-libs/rocBLAS-5.7.1-r1: TypeError: buildSourceCodeObjectFile() missing 2 r...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-22 21:30 UTC by Stefano
Modified: 2024-03-27 22:33 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,69.65 KB, text/plain)
2023-12-23 09:14 UTC, Stefano
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefano 2023-12-22 21:30:11 UTC
* Package:    sci-libs/rocBLAS-5.7.1-r1:0/5.7
 * Repository: gentoo
 * Maintainer: sci@gentoo.org gentoo@holzke.net,xgreenlandforwyy@gmail.com
 * USE:        abi_x86_64 amd64 amdgpu_targets_gfx1010 elibc_glibc kernel_linux
 * FEATURES:   network-sandbox preserve-libs sandbox userpriv usersandbox
>>> Unpacking source...
>>> Unpacking rocm-rocBLAS-5.7.1.tar.gz to /var/tmp/notmpdir/portage/sci-libs/rocBLAS-5.7.1-r1/work
>>> Source unpacked in /var/tmp/notmpdir/portage/sci-libs/rocBLAS-5.7.1-r1/work
>>> Preparing source in /var/tmp/notmpdir/portage/sci-libs/rocBLAS-5.7.1-r1/work/rocBLAS-rocm-5.7.1 ...

Reading logic files: 100% 108/108 [00:10<00:00,  9.92it/s]
Processing logic data: 100% 108/108 [00:00<00:00, 237.39it/s]
# Writing Custom CMake
# Writing Kernels...
Generating kernels: 0it [00:00, ?it/s]
0it [00:00, ?it/s]
Compiling source kernels: 0it [00:00, ?it/s]
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.11/TensileCreateLibrary", line 8, in <module>
    sys.exit(TensileCreateLibrary())
             ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/Tensile/TensileCreateLibrary.py", line 1355, in TensileCreateLibrary
    codeObjectFiles = writeSolutionsAndKernels(outputPath, CxxCompiler, None, solutions,
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/Tensile/TensileCreateLibrary.py", line 604, in writeSolutionsAndKernels
    codeObjectFiles += buildSourceCodeObjectFiles(CxxCompiler, kernelFiles, outputPath)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/Tensile/TensileCreateLibrary.py", line 328, in buildSourceCodeObjectFiles
    coFiles = Common.ParallelMap(buildSourceCodeObjectFile, args, "Compiling source kernels")
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/Tensile/Parallel.py", line 74, in ParallelMap
    return list(map(function, Utils.tqdm(objects, message)))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: buildSourceCodeObjectFile() missing 2 required positional arguments: 'outputPath' and 'kernelFile'
FAILED: Tensile/library/Kernels.so-000-gfx1010.hsaco /var/tmp/notmpdir/portage/sci-libs/rocBLAS-5.7.1-r1/work/rocBLAS-rocm-5.7.1_build/Tensile/library/Kernels.so-000-gfx1010.hsaco 
cd /var/tmp/notmpdir/portage/sci-libs/rocBLAS-5.7.1-r1/work/rocBLAS-rocm-5.7.1_build/library/src && TensileCreateLibrary --merge-files --separate-architectures --lazy-library-loading --no-short-file-names --no-library-print-debug --code-object-version=default --cxx-compiler=hipcc --jobs=1 --library-format=msgpack --architecture=gfx1010 /var/tmp/notmpdir/portage/sci-libs/rocBLAS-5.7.1-r1/work/rocBLAS-rocm-5.7.1/library/src/blas3/Tensile/Logic/asm_full /var/tmp/notmpdir/portage/sci-libs/rocBLAS-5.7.1-r1/work/rocBLAS-rocm-5.7.1_build/Tensile HIP
ninja: build stopped: subcommand failed.
 * ERROR: sci-libs/rocBLAS-5.7.1-r1::gentoo failed (compile phase):
 *   ninja -v -j1 -l0 failed
 *
Comment 1 Yiyang Wu 2023-12-23 03:22:26 UTC
Can you attach the full build.log? I'd like to see the Tensile_CREATE_COMMAND cmake is executing.
Comment 2 Stefano 2023-12-23 09:14:53 UTC
Created attachment 880254 [details]
build.log

build.log for debug
Comment 3 Yiyang Wu 2023-12-23 12:07:37 UTC
I can reproduced this bug with MAKEOPTS="-j1". Setting MAKEOPTS="-j1" temporarily solves the issue.

However, I encountered another bug when only gfx1010 is being built:

Generating kernels: Launching 2 threads...
Generating kernels: Done.
^M0it [00:00, ?it/s]^M0it [00:00, ?it/s]
Compiling source kernels: Launching 2 threads...
hipcc: /opt/gentoo/usr/bin/hipcc --genco -D__HIP_HCC_COMPAT_MODE__=1 -I /var/tmp/notmpdir/portage/sci-libs/rocBLAS-5.7.1-r1/work/rocBLAS-rocm-5.7.1_build/Tensile -Xoffload-linker --build-id --offload-arch=gfx1010 /var/tmp/notmpdir/portage/sci-libs/rocBLAS-5.7.1-r1/work/rocBLAS-rocm-5.7.1_build/Tensile/Kernels.cpp -c -o /var/tmp/notmpdir/portage/sci-libs/rocBLAS-5.7.1-r1/work/rocBLAS-rocm-5.7.1_build/library/src/build_tmp/TENSILE/code_object_tmp/Kernels.o
/opt/gentoo/usr/lib/llvm/17/bin/clang-offload-bundler -type=o -targets=hipv4-amdgcn-amd-amdhsa--gfx1010 -input=/var/tmp/notmpdir/portage/sci-libs/rocBLAS-5.7.1-r1/work/rocBLAS-rocm-5.7.1_build/library/src/build_tmp/TENSILE/code_object_tmp/Kernels.o -output=/var/tmp/notmpdir/portage/sci-libs/rocBLAS-5.7.1-r1/work/rocBLAS-rocm-5.7.1_build/library/src/build_tmp/TENSILE/code_object_tmp/Kernels.so-000-gfx1010.hsaco -unbundle
Compiling source kernels: Done.
# Kernel Building elapsed time = 0.7 secs
codeObjectFiles: ['/var/tmp/notmpdir/portage/sci-libs/rocBLAS-5.7.1-r1/work/rocBLAS-rocm-5.7.1_build/Tensile/library/Kernels.so-000-gfx1010.hsaco']
sourceLibPaths + asmLibPaths: ['/var/tmp/notmpdir/portage/sci-libs/rocBLAS-5.7.1-r1/work/rocBLAS-rocm-5.7.1_build/Tensile/library/Kernels.so-000-gfx1010.hsaco']
Traceback (most recent call last):
  File "/opt/gentoo/usr/lib/python-exec/python3.11/TensileCreateLibrary", line 8, in <module>
    sys.exit(TensileCreateLibrary())
             ^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/gentoo/usr/lib/python3.11/site-packages/Tensile/TensileCreateLibrary.py", line 1407, in TensileCreateLibrary
    theMasterLibrary = list(masterLibraries.values())[0]
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
[16/456] cd /var/tmp/notmpdir/portage/sci-libs/rocBLAS-5.7.1-r1/work/rocBLAS-rocm-5.7.1/clients && /opt/gentoo/usr/bin/cmake -E copy include/rocblas_template.yaml /var/tmp/notmpdir/portage/sci-libs/rocBLAS-5.7.1-r1/work/rocBLAS-rocm-5.7.1_build/clients/staging/rocblas_template.yaml
FAILED: Tensile/library/Kernels.so-000-gfx1010.hsaco /var/tmp/notmpdir/portage/sci-libs/rocBLAS-5.7.1-r1/work/rocBLAS-rocm-5.7.1_build/Tensile/library/Kernels.so-000-gfx1010.hsaco 
cd /var/tmp/notmpdir/portage/sci-libs/rocBLAS-5.7.1-r1/work/rocBLAS-rocm-5.7.1_build/library/src && TensileCreateLibrary --merge-files --separate-architectures --lazy-library-loading --no-short-file-names --no-library-print-debug --code-object-version=default --cxx-compiler=hipcc --jobs=2 --library-format=msgpack --architecture=gfx1010 /var/tmp/notmpdir/portage/sci-libs/rocBLAS-5.7.1-r1/work/rocBLAS-rocm-5.7.1/library/src/blas3/Tensile/Logic/asm_full /var/tmp/notmpdir/portage/sci-libs/rocBLAS-5.7.1-r1/work/rocBLAS-rocm-5.7.1_build/Tensile HIP
[18/456] cd /var/tmp/notmpdir/portage/sci-libs/rocBLAS-5.7.1-r1/work/rocBLAS-rocm-5.7.1/clients/gtest && /opt/gentoo/usr/bin/python3 ../common/rocblas_gentest.py -I ../include rocblas_gtest.yaml -o /var/tmp/notmpdir/portage/sci-libs/rocBLAS-5.7.1-r1/work/rocBLAS-rocm-5.7.1_build/clients/staging/rocblas_gtest.data
ninja: build stopped: subcommand failed.
Comment 4 sin-ack 2023-12-26 12:52:51 UTC
I have the same issue as Yiyang Wu with AMDGPU_TARGETS_gfx1031. The solution was to also enable a "master library" for BLAS, in my case gfx1030. Maybe a REQUIRED_USE like "gfx1031? ( gfx1030 )" (of course, with all the corresponding "master libraries" discovered through trial and error) could fix this.
Comment 5 Michael Seifert 2024-03-19 16:11:57 UTC
I can confirm the issue persists with sci-libs/rocBLAS-5.7.1-r2. I have the same  USE flags, especially amdgpu_targets_gfx1010.

Setting MAKEOPTS="-j1" does not work around the build error in my case.
Comment 6 Stefano 2024-03-19 17:25:33 UTC
I have found on site that gfx1010 is not compatible anymore with this version of rocBLAS but need the preceeding version 5.4.2
In my computer also rocminfo-5.7.1 failed with unrecognized module while rocminfo-5.4.2 is OK.
rocBLAS-5.4.2-r3 compile sucessfully
Comment 7 Sv. Lockal 2024-03-24 18:55:40 UTC
@Stefano, could you try this patch?

https://github.com/T0mstone/void-packages/blob/dbfd3ec74ce0ef4e647e93bf27566275be384237/srcpkgs/rocBLAS/patches/Tensile-fix-fallback-arch-build.patch

I know that it allows to *compile* for gfx1010, I just don't know if resulting library works.

Upstream bug: https://github.com/ROCm/Tensile/issues/1757

What I see in 5.4.2, that there is no finetuned kernels for gfx1010 (https://github.com/ROCm/rocBLAS/tree/rocm-5.4.1/library/src/blas3/Tensile/Logic/asm_full - no navi10), so back then library used fallback generic kernels. These kernels are still there, they just need to be enabled.
Comment 8 Stefano 2024-03-27 22:33:16 UTC
Thanks @Sv. Lockal but the main problem (In my computer also rocminfo-5.7.1 failed with unrecognized module while rocminfo-5.4.2 is OK.) remain