Skip to content

cuda-core Linux wheels ship unstripped .so files, causing 6x size bloat #1881

Closed

Description

@leofang

Summary

Linux wheels for cuda-core have grown steadily across releases (11 MB in 0.4.0 → 21 MB in 0.6.0 → 30 MB in 0.7.0), while Windows wheels have stayed at ~4-5 MB. The root cause is that Linux .so files ship with debug symbols and are not stripped.

Details

Running file on any .so in the 0.7.0 Linux wheel confirms:

ELF 64-bit LSB shared object, x86-64, ... with debug_info, not stripped

Size comparison for the same module (0.7.0):

Module Linux .so Windows .pyd Ratio
system/_device 5.6 MB 0.4 MB 12.6x
_device 2.7 MB 0.2 MB 10.9x
_stream 1.4 MB 0.1 MB 12.0x

Stripping all .so files reduces the total extracted size from 103.7 MB → 11.2 MB (89% reduction), which would bring the compressed wheel from ~30 MB down to ~4-5 MB, matching Windows.

Growth across releases is compounded by more Cython modules per release (each duplicated for cu12 + cu13):

Version .so count Total .so size (unstripped) Wheel size
0.4.0 20 29.6 MB 11 MB
0.6.0 51 73.0 MB 21 MB
0.7.0 71 103.7 MB 30 MB

Root cause

cuda_bindings already strips debug symbols for wheel builds via -Wl,--strip-all in its build_hooks.py (link):

if strip and sys.platform == "linux":
    extra_link_args += ["-Wl,--strip-all"]

with strip=True passed only for build_wheel().

However, cuda_core/build_hooks.py has no stripping logic at all — its Extension objects have no extra_link_args. The same pattern from cuda_bindings should be applied.

Proposed fix

Add extra_link_args=["-Wl,--strip-all"] to the Extension objects in cuda_core/build_hooks.py when building wheels on Linux, following the same strip=True/False pattern as cuda_bindings.

-- Leo's bot

Activity

  1. added
    bugSomething isn't working
    packagingAnything related to wheels or Conda packages
    cuda.coreEverything related to the cuda.core module
    on Apr 8, 2026
  2. self-assigned this
    on Apr 8, 2026
  3. added this to the cuda.core v1.0.0 milestone on Apr 8, 2026
  4. added a commit that references this issue on Apr 8, 2026
    8169244
  5. leofang commented on Apr 10, 2026

    @leofang
    MemberAuthor

    Closed by #1890.

  6. added a commit that references this issue on Apr 10, 2026
    09c6946
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P0High priority - Must do!bugSomething isn't workingcuda.coreEverything related to the cuda.core modulepackagingAnything related to wheels or Conda packages

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions