FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Build libafcuda with dynamically loaded CUDA numeric binaries by umar456 · Pull Request #3205 · arrayfire/arrayfire · GitHub

Repository navigation

Build libafcuda with dynamically loaded CUDA numeric binaries - #3205

Merged
umar456 merged 2 commits into
arrayfire:masterfrom
umar456:binary_size_opt
Mar 22, 2022
Merged

umar456 merged 2 commits into
arrayfire:masterfrom
umar456:binary_size_opt

Conversation

umar456 commented Jan 13, 2022

Copy link
Copy Markdown
Member

Dynamically link CUDA numeric libraries instead of always staticly linking.

Description

ArrayFire's CUDA backend linked against the CUDA numeric libraries
staticly before this change. This caused the libafcuda library to be
in the 1.1GB range for CUDA 11.5 even if you were targeting one compute
capability. This is partially due to the fact that the linker does not
remove the compute capabilities of older architectures when linking.

One way around this would be to use nvprune to remove the architectures
that are not being used by the compute cability when building. This
approach is not yet implemented.

This commit will revert back to dynamically linking the CUDA numeric
libraries by default. You can still select the old behavior by setting
the AF_WITH_STATIC_CUDA_NUMERIC_LIBS option in CMake

Changes to Users

Then binary sizes are significantly smaller but requires you to have
the cuda libraries in the library paths. This is only an issue when building
installers.

Checklist

  • Rebased on latest master
  • Code compiles
  • Tests pass
  • [ ] Functions added to unified API
  • [ ] Functions documented

Copy link
Copy Markdown
Contributor

@umar456 any way for afcuda to dynload such nvidia libs only if needed (especially cufft, ...)?

umar456 commented Jan 13, 2022

Copy link
Copy Markdown
Member Author

It could be done but would require a good bit of work. We have done this for other libraries but not for things like cublas and cufft.

9prady9 commented Jan 20, 2022

Copy link
Copy Markdown
Member

This is unfortunate, is this still the same with CUDA 11.6 ?

umar456 added 2 commits March 22, 2022 00:28
ArrayFire's CUDA backend linked against the CUDA numeric libraries
staticly before this change. This caused the libafcuda library to be
in the 1.1GB range for CUDA 11.5 even if you were targeting one compute
capability. This is partially due to the fact that the linker does not
remove the compute capabilities of older architectures when linking.

One way around this would be to use nvprune to remove the architectures
that are not being used by the compute cability when building. This
approach is not yet implemented.

This commit will revert back to dynamically linking the CUDA numeric
libraries by default. You can still select the old behavior by setting
the AF_WITH_STATIC_CUDA_NUMERIC_LIBS option in CMake
umar456 merged commit e3f9559 into arrayfire:master Mar 22, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

4 participants


Back | FazBrowse Home | New Git URL