Skip to content

Strip debug symbols from cuda-core Linux wheels#1883

Open
leofang wants to merge 1 commit intoNVIDIA:mainfrom
leofang:fix/cuda-core-strip-so
Open

Strip debug symbols from cuda-core Linux wheels#1883
leofang wants to merge 1 commit intoNVIDIA:mainfrom
leofang:fix/cuda-core-strip-so

Conversation

@leofang
Copy link
Copy Markdown
Member

@leofang leofang commented Apr 8, 2026

Summary

  • Add -Wl,--strip-all to extra_link_args for wheel builds on Linux in cuda_core/build_hooks.py, matching the existing behavior in cuda_bindings/build_hooks.py
  • Without stripping, the 0.7.0 Linux wheel is ~30 MB (103 MB extracted) because every .so ships with debug_info. After stripping, extracted size drops from 103 MB to ~11 MB, bringing the wheel in line with the ~4-5 MB Windows wheels.
  • Follow-up issue for other build flag differences: cuda-core build_hooks.py missing compiler/linker flags present in cuda-bindings #1882

Closes #1881

Test plan

  • Build a Linux wheel with pip wheel . in cuda_core/ and verify .so files are stripped (file *.so should NOT show with debug_info, not stripped)
  • Verify editable installs still have debug symbols (strip=False path)
  • Compare wheel size before/after

-- Leo's bot

Add -Wl,--strip-all to extra_link_args for wheel builds on Linux,
matching the existing behavior in cuda_bindings/build_hooks.py.

Without stripping, the 0.7.0 Linux wheel is ~30 MB (103 MB extracted)
because every .so ships with debug_info. After stripping, extracted
size drops from 103 MB to ~11 MB, bringing the wheel in line with
the ~4-5 MB Windows wheels.

Closes NVIDIA#1881

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@copy-pr-bot
Copy link
Copy Markdown
Contributor

copy-pr-bot bot commented Apr 8, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@rparolin rparolin added this to the cuda.core v1.0.0 milestone Apr 8, 2026

def build_editable(wheel_directory, config_settings=None, metadata_directory=None):
_build_cuda_core()
_build_cuda_core(strip=False)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be passing strip=True?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad -- this is the editable one.

I find it usual that editable installs are implicitly different. Other build systems I've seen would just have a --debug flag to indicate building an unstripped, debuggable binary. I don't think we should piggyback on editable for debuggable (though I realize cuda_bindings already does that).


def build_wheel(wheel_directory, config_settings=None, metadata_directory=None):
_build_cuda_core()
_build_cuda_core(strip=True)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto. Pass strip=True?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants