Skip to content

magma: add -Xfatbin -compress-all flags when compiling with cuda#3424

Open
Markus92 wants to merge 1 commit intospack:developfrom
Markus92:magma
Open

magma: add -Xfatbin -compress-all flags when compiling with cuda#3424
Markus92 wants to merge 1 commit intospack:developfrom
Markus92:magma

Conversation

@Markus92
Copy link
Contributor

When compiling magma with a lot of cuda architectures (we got 6 in our heterogenous cluster!) the library can get over 2GB of code causing linker errors:

lib/libmagma.so: PC-relative offset overflow in PLT entry for `_Z24herk_template_batched_tnI6float2Li8ELi12ELi24ELi24ELi8ELi1ELi8ELi12ELi8ELi12ELi1ELi0EEv12magma_uplo_tiiPKPKT_iiiS6_iiiPPS2_iiiS2_S2_iP11magma_queue'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/magma.dir/build.make:23918: lib/libmagma.so] Error 1
make[2]: Leaving directory '/tmp/spackadmin/spack-stage/spack-stage-magma-2.9.0

The people over at Nix had the same issue and looked at how PyTorch solved it, as PyTorch ships with a dozen architectures for their conda builds.

This PR adds these flags for the CUDA builds and this fixed my linker issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant