-
Notifications
You must be signed in to change notification settings - Fork 146
BUILD: Add configurable CUDA architecture targeting with meson built-in options #719
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
base: main
Are you sure you want to change the base?
BUILD: Add configurable CUDA architecture targeting with meson built-in options #719
Conversation
👋 Hi michal-shalev! Thank you for contributing to ai-dynamo/nixl. Your PR reviewers will review your contribution then trigger the CI to test your changes. 🚀 |
meson.build
Outdated
nvcc_flags += ['-gencode', 'arch=compute_80,code=sm_80'] | ||
nvcc_flags += ['-gencode', 'arch=compute_90,code=sm_90'] | ||
nvcc_flags_link = [] | ||
if get_option('nvcc_gencode') != '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why need this check? wouldn't the for loop below be empty any way if options not set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because with a string option, ''.split(' ') returns [''], so the loop runs once and adds an empty flag. I changed nvcc_gencode
to an array and removed this check and split to avoid empty args.
meson_options.txt
Outdated
option('cudapath_inc', type: 'string', value: '', description: 'Include path for CUDA') | ||
option('cudapath_lib', type: 'string', value: '', description: 'Library path for CUDA') | ||
option('cudapath_stub', type: 'string', value: '', description: 'Extra Stub path for CUDA') | ||
option('nvcc_gencode', type: 'string', value: '-gencode=arch=compute_80,code=sm_80 -gencode=arch=compute_90,code=sm_90', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like can provide meson cuda build flags like this:
meson setup -Dcuda_args="-gencode=arch=compute_90,code=sm_90" \
-Dcuda_link_args="-gencode=arch=compute_90,code=sm_90"
Can you pls check it? so maybe no need to add specific option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested -Dcuda_args
and -Dcuda_link_args
and it's working.
I've updated the PR to use meson's built-in cuda_args
and cuda_link_args
instead of adding a custom option.
7e58efd
to
01da329
Compare
0bb541f
to
07321e7
Compare
Signed-off-by: Michal Shalev <[email protected]>
|
||
# CUDA GPU architecture targeting (example) | ||
$ meson setup <name_of_build_dir> \ | ||
-Dcuda_args="-gencode=arch=compute_80,code=sm_80,-gencode=arch=compute_90,code=sm_90" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this comma separated or space separated?
What?
Replace hardcoded CUDA architecture flags with configurable defaults using meson's built-in
cuda_args
/cuda_link_args
.Why?
Replaces hardcoded CUDA architecture flags with configurable defaults using meson's built-in CUDA argument handling for better flexibility.
How?
nvcc_flags
with conditionaldefault_cuda_args
Usage