Commit 8f83771
Reduce packaged native library size (#4881)
## Summary
- rely on the static nvCOMP copy already linked into `libcudf.so`
- stop packaging and loading the redundant nvCOMP shared libraries
- localize symbols from statically linked CUDA compiler and nvCOMP
implementation archives with `--exclude-libs`
- retain the regular ELF symbol table for stack traces and debugging
No GPU architectures are removed.
No upstream cuDF change is required. cuDF already selects
`nvcomp_static` when
`CUDF_BUILD_STATIC_DEPS=FORCE`, as used by this build. This supersedes
the previous dependency on
rapidsai/cudf#23415.
Related to NVIDIA/cudf-spark#15145.
## Size results
Focused CUDA 12.9.1 Release builds with `CMAKE_CUDA_ARCHITECTURES=75`:
| Variant | Packaged native bytes | ZIP level 6 |
| --- | ---: | ---: |
| main: static nvCOMP in `libcudf.so` plus packaged `libnvcomp.so` |
754,765,376 B | 389,662,932 B |
| this PR: static nvCOMP only in `libcudf.so`, private symbols localized
| 693,387,896 B | 354,470,480 B |
The focused build reduces packaged native data by 58.53 MiB uncompressed
(8.13%) and 33.56 MiB
after DEFLATE (9.03%). `libcudfjni.so` is unchanged and omitted from
both rows.
These measurements use one architecture to make repeated comparisons
practical. The implementation
does not change the production architecture list.
## Linking and symbol compatibility
- the JAR contains `libcudf.so` and `libcudfjni.so`, with no nvCOMP
shared-library entries
- `libcudf.so` has no nvCOMP `DT_NEEDED` entry
- all 12 nvCOMP JNI entry points remain dynamically exported
- nvCOMP implementation symbols are absent from `.dynsym`
- the regular ELF `.symtab` remains available for diagnostics
## Validation
- native CUDA 12.9.1 Release build with `CMAKE_CUDA_ARCHITECTURES=75`
- `mvn package -DskipTests` through the normal patch lifecycle
- `NativeDepsLoaderTest`: 4 passed
- GPU `NvcompTest` LZ4 and Zstd cases: 2 passed
- `git diff --check`
---------
Signed-off-by: Gera Shegalov <gshegalov@nvidia.com>1 parent 52598d9 commit 8f83771
4 files changed
Lines changed: 30 additions & 8 deletions
File tree
- patches
- src/main/cpp
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
Whitespace-only changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
570 | 570 | | |
571 | 571 | | |
572 | 572 | | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | | - | |
579 | | - | |
580 | | - | |
581 | 573 | | |
582 | 574 | | |
583 | 575 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
| |||
349 | 353 | | |
350 | 354 | | |
351 | 355 | | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
352 | 368 | | |
353 | 369 | | |
354 | 370 | | |
| |||
0 commit comments