ROCm / ROCm-CompilerSupport

The compiler support repository provides various Lightning Compiler related services.
47 stars 31 forks source link

compile_device_libs_test failed: linking module flags 'amdgpu_code_object_version': IDs have conflicting values in '' and 'llvm-link" #53

Closed littlewu2508 closed 1 year ago

littlewu2508 commented 1 year ago

Building comgr (branch amd-stg-open, commit (4c092fc02e59a2783c94a23a89d2987a2f5a5239) upon llvm-16 (commit dafebd5b5a08dde25f5f52f65cac54bd6ec0ecde) failed one test:

97% tests passed, 1 tests failed out of 32

Total Test time (real) =   8.39 sec

The following tests FAILED:
         16 - comgr_compile_device_libs_test (Failed)

Running this test with verbose output:

AMD_COMGR_SAVE_TEMPS=1 AMD_COMGR_REDIRECT_LOGS=stdout AMD_COMGR_EMIT_VERBOSE_LOGS=1 ./compile_device_libs_test
amd_comgr_do_action:
          ActionKind: AMD_COMGR_ACTION_ADD_PRECOMPILED_HEADERS
             IsaName: amdgcn-amd-amdhsa--gfx803
             Options: "-mllvm" "-amdgpu-early-inline-all" "-mcode-object-version=5"
                Path:
            Language: AMD_COMGR_LANGUAGE_OPENCL_1_2
        ReturnStatus: AMD_COMGR_STATUS_SUCCESS

amd_comgr_do_action:
          ActionKind: AMD_COMGR_ACTION_COMPILE_SOURCE_TO_BC
             IsaName: amdgcn-amd-amdhsa--gfx803
             Options: "-mllvm" "-amdgpu-early-inline-all" "-mcode-object-version=5"
                Path:
            Language: AMD_COMGR_LANGUAGE_OPENCL_1_2
COMGR::executeInProcessDriver argv: clang "-cc1" "-mcode-object-version=5" "-mllvm" "--amdhsa-code-object-version=5" "-triple" "amdgcn-amd-amdhsa" "-emit-llvm-bc" "-emit-llvm-uselists" "-clear-ast-before-backend" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "source1.cl" "-mrelocation-model" "pic" "-pic-level" "1" "-fhalf-no-semantic-interposition" "-mframe-pointer=none" "-fdenormal-fp-math-f32=preserve-sign,preserve-sign" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-fvisibility=hidden" "-fapply-global-visibility-to-externs" "-target-cpu" "gfx803" "-mllvm" "-treat-scalable-fixed-error-as-warning" "-debugger-tuning=gdb" "-resource-dir" "/usr/lib/llvm/16/bin/../../../../lib/clang/16" "-include" "/usr/include/gentoo/fortify.h" "-include-pch" "/tmp/comgr-8b8928/include/opencl1.2-c.pch" "-I" "/tmp/comgr-8b8928/include" "-O3" "-std=cl1.2" "-fdebug-compilation-dir=/ext4-disk/build-vanilla-gcc12/portage/dev-libs/rocm-comgr-9999/work/rocm-comgr-9999/lib/comgr_build/test" "-ferror-limit" "19" "-stack-protector" "2" "-nogpulib" "-fgnuc-version=4.2.1" "-fno-threadsafe-statics" "-fcolor-diagnostics" "-vectorize-loops" "-vectorize-slp" "-fno-validate-pch" "-mllvm" "-amdgpu-early-inline-all" "-faddrsig" "-o" "/tmp/comgr-8b8928/output/source1.cl.bc" "-x" "cl" "/tmp/comgr-8b8928/input/source1.cl"
COMGR::executeInProcessDriver argv: clang "-cc1" "-mcode-object-version=5" "-mllvm" "--amdhsa-code-object-version=5" "-triple" "amdgcn-amd-amdhsa" "-emit-llvm-bc" "-emit-llvm-uselists" "-clear-ast-before-backend" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "source2.cl" "-mrelocation-model" "pic" "-pic-level" "1" "-fhalf-no-semantic-interposition" "-mframe-pointer=none" "-fdenormal-fp-math-f32=preserve-sign,preserve-sign" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-fvisibility=hidden" "-fapply-global-visibility-to-externs" "-target-cpu" "gfx803" "-mllvm" "-treat-scalable-fixed-error-as-warning" "-debugger-tuning=gdb" "-resource-dir" "/usr/lib/llvm/16/bin/../../../../lib/clang/16" "-include" "/usr/include/gentoo/fortify.h" "-include-pch" "/tmp/comgr-8b8928/include/opencl1.2-c.pch" "-I" "/tmp/comgr-8b8928/include" "-O3" "-std=cl1.2" "-fdebug-compilation-dir=/ext4-disk/build-vanilla-gcc12/portage/dev-libs/rocm-comgr-9999/work/rocm-comgr-9999/lib/comgr_build/test" "-ferror-limit" "19" "-stack-protector" "2" "-nogpulib" "-fgnuc-version=4.2.1" "-fno-threadsafe-statics" "-fcolor-diagnostics" "-vectorize-loops" "-vectorize-slp" "-fno-validate-pch" "-mllvm" "-amdgpu-early-inline-all" "-faddrsig" "-o" "/tmp/comgr-8b8928/output/source2.cl.bc" "-x" "cl" "/tmp/comgr-8b8928/input/source2.cl"
        ReturnStatus: AMD_COMGR_STATUS_SUCCESS

amd_comgr_do_action:
          ActionKind: AMD_COMGR_ACTION_ADD_DEVICE_LIBRARIES
             IsaName: amdgcn-amd-amdhsa--gfx803
             Options: "finite_only" "unsafe_math" "code_object_v5"
                Path:
            Language: AMD_COMGR_LANGUAGE_OPENCL_1_2
        ReturnStatus: AMD_COMGR_STATUS_SUCCESS

amd_comgr_do_action:
          ActionKind: AMD_COMGR_ACTION_LINK_BC_TO_BC
             IsaName: amdgcn-amd-amdhsa--gfx803
             Options: "-mllvm" "-amdgpu-early-inline-all" "-mcode-object-version=5"
                Path:
            Language: AMD_COMGR_LANGUAGE_OPENCL_1_2
ERROR: linking module flags 'amdgpu_code_object_version': IDs have conflicting values in '' and 'llvm-link'
        ReturnStatus: AMD_COMGR_STATUS_ERROR

FAILED: amd_comgr_do_action
 REASON: ERROR

Complete build log: build.log.gz Complete test log: LastTest.log.gz

littlewu2508 commented 1 year ago

After a clean reinstall this issue disappears

littlewu2508 commented 7 months ago

After a clean reinstall this issue disappears

Note: rocm-device-libs and rocm-comgr should have consistent version, so the reinstall order is first rocm-device-libs and then rocm-comgr

lamb-j commented 7 months ago

As another follow up, this error usually indicates a mismatch between device-libs and llvm or comgr version:

ERROR: linking module flags 'amdgpu_code_object_version': IDs have conflicting values in '' and 'llvm-link'