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

Automate handling of supported CUDA_ARCH by probing nvcc #143

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

Spudz76
Copy link
Contributor

@Spudz76 Spudz76 commented Dec 14, 2021

This will follow naturally with the DEFAULT_CUDA_ARCH list being set to exactly everything the selected Toolkit nvcc supports (from nvcc --help output) and reduce need for manual updates to logic other than the MSG_CUDA_MAP and related support helper/crash messages.

When arch 90 comes out and CUDA Toolkit v12.x nvcc has support, the automatic builds should just work day one (when v12 is added to the build list).

Related to the issue #142 which was caused by never adding 86 and not working right with base 80 code. Should avoid similar issues in the future (like with 87 or 90) or when older things become deprecated (all 3X and 5X should all be gone suddenly in v12)

Also fixed a couple actual bugs and improved some message phrasing. Bumped minimal CMake version to 3.0 because execute_process() was not in 2.x ; Everyone either already has 3.0+ or it's super easy to get a more current version.

Sample output from testing against all major versions of Toolkit:

-- [/usr/local/cuda-8.0/bin/nvcc] Architecture support: 20;21;30;32;35;37;50;52;53;60;61;62
-- [/usr/local/cuda-9.0/bin/nvcc] Architecture support: 30;32;35;37;50;52;53;60;61;62;70
-- [/usr/local/cuda-9.1/bin/nvcc] Architecture support: 30;32;35;37;50;52;53;60;61;62;70;72
-- [/usr/local/cuda-9.2/bin/nvcc] Architecture support: 30;32;35;37;50;52;53;60;61;62;70;72
-- [/usr/local/cuda-10.0/bin/nvcc] Architecture support: 30;32;35;37;50;52;53;60;61;62;70;72;75
-- [/usr/local/cuda-10.1/bin/nvcc] Architecture support: 30;32;35;37;50;52;53;60;61;62;70;72;75
-- [/usr/local/cuda-10.2/bin/nvcc] Architecture support: 30;32;35;37;50;52;53;60;61;62;70;72;75
-- [/usr/local/cuda-11.0/bin/nvcc] Architecture support: 35;37;50;52;53;60;61;62;70;72;75;80
-- [/usr/local/cuda-11.1/bin/nvcc] Architecture support: 35;37;50;52;53;60;61;62;70;72;75;80;86
-- [/usr/local/cuda-11.2/bin/nvcc] Architecture support: 35;37;50;52;53;60;61;62;70;72;75;80;86
-- [/usr/local/cuda-11.3/bin/nvcc] Architecture support: 35;37;50;52;53;60;61;62;70;72;75;80;86
-- [/usr/local/cuda-11.4/bin/nvcc] Architecture support: 35;37;50;52;53;60;61;62;70;72;75;80;86;87
-- [/usr/local/cuda-11.5/bin/nvcc] Architecture support: 35;37;50;52;53;60;61;62;70;72;75;80;86;87

@Spudz76 Spudz76 force-pushed the dev-improveArchHandling branch from b57b56a to 0740c91 Compare December 14, 2021 00:48
@xmrig
Copy link
Owner

xmrig commented Dec 15, 2021

Main reason why arch list is very limited was the resulting binary size and compile time. Large arch list dramatically increases size and compile time which is already huge. Overall changes are good but I don't like arch list becoming big.
Thank you.

@Spudz76
Copy link
Contributor Author

Spudz76 commented Dec 15, 2021

Then someone should make a list of which ones actually need their sub-arch and which don't (60/61/62 all work on 60; obviously due to enduser report 86 does not work with 80)

Not sure if the release files being useless for anyone with an 86 is worth the savings of compile time nobody is waiting for because it's automated, or some more MB. :)

@Spudz76 Spudz76 force-pushed the dev-improveArchHandling branch from 0740c91 to e7f2e55 Compare December 18, 2021 09:36
@Spudz76
Copy link
Contributor Author

Spudz76 commented Dec 18, 2021

Made that list I said someone should make, based on what the original code would have not-built (but adding the 86), and cleaned up some wording, and added some more architecture feedback.

Should build identically to current aside from the addition of 86 which should fix the actual reported issue.

@Spudz76 Spudz76 force-pushed the dev-improveArchHandling branch from e7f2e55 to e756f31 Compare December 18, 2021 09:45
@Spudz76
Copy link
Contributor Author

Spudz76 commented Dec 18, 2021

Updated sample output from every Toolkit version (confirming useless arch filtering):

-- Found CUDA: /usr/local/cuda-8.0 (found suitable version "8.0", minimum required is "8.0")
-- CUDA 8.0: RandomX, AstroBWT, and KawPow disabled, they do not work with CUDA < 9.0
-- CUDA Architectures supported by [/usr/local/cuda-8.0/bin/nvcc]: 20;21;30;32;35;37;50;52;53;60;61;62
-- CUDA Architectures filtered defaults: 20;21;30;35;50;60
-- CUDA Architectures being built: 20;21;30;35;50;60
-- Found CUDA: /usr/local/cuda-9.0 (found suitable version "9.0", minimum required is "8.0")
-- CUDA Architectures supported by [/usr/local/cuda-9.0/bin/nvcc]: 30;32;35;37;50;52;53;60;61;62;70
-- CUDA Architectures filtered defaults: 30;35;50;60;70
-- CUDA Architectures being built: 30;35;50;60;70
-- Found CUDA: /usr/local/cuda-9.1 (found suitable version "9.1", minimum required is "8.0") 
-- CUDA Architectures supported by [/usr/local/cuda-9.1/bin/nvcc]: 30;32;35;37;50;52;53;60;61;62;70;72
-- CUDA Architectures filtered defaults: 30;35;50;60;70
-- CUDA Architectures being built: 30;35;50;60;70
-- Found CUDA: /usr/local/cuda-9.2 (found suitable version "9.2", minimum required is "8.0") 
-- CUDA Architectures supported by [/usr/local/cuda-9.2/bin/nvcc]: 30;32;35;37;50;52;53;60;61;62;70;72
-- CUDA Architectures filtered defaults: 30;35;50;60;70
-- CUDA Architectures being built: 30;35;50;60;70
-- Found CUDA: /usr/local/cuda-10.0 (found suitable version "10.0", minimum required is "8.0") 
-- CUDA Architectures supported by [/usr/local/cuda-10.0/bin/nvcc]: 30;32;35;37;50;52;53;60;61;62;70;72;75
-- CUDA Architectures filtered defaults: 30;35;50;60;70;75
-- CUDA Architectures being built: 30;35;50;60;70;75
-- Found CUDA: /usr/local/cuda-10.1 (found suitable version "10.1", minimum required is "8.0") 
-- CUDA Architectures supported by [/usr/local/cuda-10.1/bin/nvcc]: 30;32;35;37;50;52;53;60;61;62;70;72;75
-- CUDA Architectures filtered defaults: 30;35;50;60;70;75
-- CUDA Architectures being built: 30;35;50;60;70;75
-- Found CUDA: /usr/local/cuda-10.2 (found suitable version "10.2", minimum required is "8.0") 
-- CUDA Architectures supported by [/usr/local/cuda-10.2/bin/nvcc]: 30;32;35;37;50;52;53;60;61;62;70;72;75
-- CUDA Architectures filtered defaults: 30;35;50;60;70;75
-- CUDA Architectures being built: 30;35;50;60;70;75
-- Found CUDA: /usr/local/cuda-11.0 (found suitable version "11.0", minimum required is "8.0") 
-- CUDA Architectures supported by [/usr/local/cuda-11.0/bin/nvcc]: 35;37;50;52;53;60;61;62;70;72;75;80
-- CUDA Architectures filtered defaults: 35;50;60;70;75;80
-- CUDA Architectures being built: 35;50;60;70;75;80
-- Found CUDA: /usr/local/cuda-11.1 (found suitable version "11.1", minimum required is "8.0") 
-- CUDA Architectures supported by [/usr/local/cuda-11.1/bin/nvcc]: 35;37;50;52;53;60;61;62;70;72;75;80;86
-- CUDA Architectures filtered defaults: 35;50;60;70;75;80;86
-- CUDA Architectures being built: 35;50;60;70;75;80;86
-- Found CUDA: /usr/local/cuda-11.2 (found suitable version "11.2", minimum required is "8.0") 
-- CUDA Architectures supported by [/usr/local/cuda-11.2/bin/nvcc]: 35;37;50;52;53;60;61;62;70;72;75;80;86
-- CUDA Architectures filtered defaults: 35;50;60;70;75;80;86
-- CUDA Architectures being built: 35;50;60;70;75;80;86
-- Found CUDA: /usr/local/cuda-11.3 (found suitable version "11.3", minimum required is "8.0")
-- CUDA Architectures supported by [/usr/local/cuda-11.3/bin/nvcc]: 35;37;50;52;53;60;61;62;70;72;75;80;86
-- CUDA Architectures filtered defaults: 35;50;60;70;75;80;86
-- CUDA Architectures being built: 35;50;60;70;75;80;86
-- Found CUDA: /usr/local/cuda-11.4 (found suitable version "11.4", minimum required is "8.0")
-- CUDA Architectures supported by [/usr/local/cuda-11.4/bin/nvcc]: 35;37;50;52;53;60;61;62;70;72;75;80;86;87
-- CUDA Architectures filtered defaults: 35;50;60;70;75;80;86
-- CUDA Architectures being built: 35;50;60;70;75;80;86
-- Found CUDA: /usr/local/cuda-11.5 (found suitable version "11.5", minimum required is "8.0")
-- CUDA Architectures supported by [/usr/local/cuda-11.5/bin/nvcc]: 35;37;50;52;53;60;61;62;70;72;75;80;86;87
-- CUDA Architectures filtered defaults: 35;50;60;70;75;80;86
-- CUDA Architectures being built: 35;50;60;70;75;80;86

@Spudz76
Copy link
Contributor Author

Spudz76 commented Dec 18, 2021

Here is one where I am building on purpose for some other specified arch:

-- CUDA Architectures supported by [/usr/local/cuda-11.5/bin/nvcc]: 35;37;50;52;53;60;61;62;70;72;75;80;86;87
-- CUDA Architectures filtered defaults: 35;50;60;70;75;80;86
-- CUDA Architectures being built: 61

@Spudz76 Spudz76 force-pushed the dev-improveArchHandling branch from e756f31 to d9c6856 Compare March 10, 2022 06:02
@Spudz76 Spudz76 force-pushed the dev-improveArchHandling branch 2 times, most recently from 266b2bf to 257b398 Compare April 6, 2022 06:05
@Spudz76 Spudz76 force-pushed the dev-improveArchHandling branch from 257b398 to 4c2c9ba Compare June 14, 2022 20:57
@Spudz76 Spudz76 force-pushed the dev-improveArchHandling branch from 4c2c9ba to 5344f58 Compare May 31, 2023 07:08
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.

2 participants