Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static link CUDA Runtime #7954

Merged
merged 25 commits into from
Nov 16, 2023
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift click to select a range
c3b276c
implement runtime._getCUDAMajorVersion()
kmaehashi Oct 21, 2023
0922be2
remove or replace runtime.runtimeGetVersion()
kmaehashi Oct 21, 2023
9669e60
fix unused import
kmaehashi Oct 21, 2023
4055338
static link CUDA Runtime
kmaehashi Oct 21, 2023
75465c8
merge profiler module to runtime
kmaehashi Oct 21, 2023
3d29eb4
remove use of profiler module
kmaehashi Oct 13, 2023
4cd14a6
update profile module for backward compatibility
kmaehashi Oct 13, 2023
7b4cece
update docs
kmaehashi Oct 13, 2023
1629883
static link CUDA Runtime in Jitify, cuRAND, Thrust
kmaehashi Oct 21, 2023
841af9e
lazy import Jitify
kmaehashi Oct 13, 2023
7328623
flake8
kmaehashi Oct 21, 2023
385fce3
fix libraries list
kmaehashi Oct 21, 2023
96e37c4
fix HIP translation
kmaehashi Oct 22, 2023
ca5adb8
fix jitify import
kmaehashi Oct 22, 2023
e89e35a
check CUDA header version in cupyx.jit
kmaehashi Oct 22, 2023
3220581
fix mock
kmaehashi Oct 22, 2023
c6122f5
Merge remote-tracking branch 'upstream/main' into static-link-cudart
kmaehashi Nov 8, 2023
841eff7
implement `cupy.cuda.get_local_runtime_version()`
kmaehashi Nov 8, 2023
c693e7a
update tests
kmaehashi Nov 8, 2023
7a4a4bb
Revert "check CUDA header version in cupyx.jit"
kmaehashi Nov 8, 2023
e3f5873
use _getLocalRuntimeVersion instead
kmaehashi Nov 8, 2023
c9f5090
add docs
kmaehashi Nov 8, 2023
3b7b901
fix docs
kmaehashi Nov 8, 2023
1f8f7a0
avoid using getLocalRuntimeVersion from CUDA Python
kmaehashi Nov 10, 2023
aecccf6
use softlink for runtime regardless of CUDA Python mode
kmaehashi Nov 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
static link CUDA Runtime
  • Loading branch information
kmaehashi committed Oct 21, 2023
commit 405533801e070119b2d6480a8a0b1a920d034b40
15 changes: 9 additions & 6 deletions install/cupy_builder/_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,13 465,16 @@ def __init__(self, ctx: Context):
# TODO(kmaehashi): Split profiler module so that dependency to
# `cudart` can be removed when using CUDA Python.
self.libraries = (
(['cudart'] if ctx.use_cuda_python else ['cuda', 'cudart']) [
'cublas',
'cufft',
'curand',
'cusparse',
]
# CUDA Driver
([] if ctx.use_cuda_python else ['cuda'])

# Dependencies for cudart_static
(['pthread', 'rt', 'dl'] if sys.platform == 'linux' else [])

# CUDA Toolkit
['cublas', 'cufft', 'curand', 'cusparse']
)
self.static_libraries = ['cudart_static']
Copy link
Member

Choose a reason for hiding this comment

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

Q: Would this make the CUDA Python build also link to cudart statically?

Copy link
Member Author

@kmaehashi kmaehashi Nov 6, 2023

Choose a reason for hiding this comment

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

I believe the linker is clever enough to avoid linking static libs if symbols are unused 😄

Copy link
Member

Choose a reason for hiding this comment

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

Yes I was asking a silly question. CUDA Python does not use any cudart symbols, and indeed the linker would do nothing.

self._version = self._UNDETERMINED

def configure(self, compiler: Any, settings: Any) -> bool:
Expand Down