Skip to content

Dpcpp debug build issue #919

@yhmtsai

Description

@yhmtsai

When we add more function into dpcpp module, the debug build will give some compilation issue.
It will throw relocation truncated to fit: R_X86_64_GOTPCREL.... and PC-relative offset overflows in PLT entry ...

The following are some observation:

  • It depends on the system gcc, so different environments do not throw the error at the same commit.
  • It's does not help when we add -mc-model=medium/large
  • the total object file size are around 220 M but the library takes 1.9 G (when it is still compilable)
  • With bloaty, more than 90% size is for __CLANG_OFFLOAD_BUNDLE__sycl-spir64
  • -fsycl-device-code-split=per_source only needs 216M for library, not 1.9G when -fsycl-device-code-split=per_kernel

The size seems to introduced by inserting the debug information to each kernel.

possible workaround and decision currently from our side

  • split the dpcpp to several sub-libraries.
    It works but requires -lginkgo_dpcpp_1 -lginkgo_dpcpp_2 ... when not using CMake.
    Thus, we do not prefer this way
  • Collecting all subgroup/workgroup list into config and it can be changed in CMake.
    By doing so, we can limit ginkgo only compiles the supported parameters kernel on specific device and use -fsycl-device-code-split=per_source to reduce the library size.

Before pushing these fixes, we disable the debug build in #676

Metadata

Metadata

Assignees

No one assigned

    Labels

    is:bugSomething looks wrong.is:bugfixThis fixes a bugis:confirmedSomeone confirmed this issue.mod:dpcppThis is related to the DPC++ module.plat:intelThis is related to the Intel compilers.reg:buildThis is related to the build system.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions