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

[CUDA] Download instead of having the user install it. #35336

Open
wants to merge 51 commits into
base: master
Choose a base branch
from

Conversation

Neumann-A
Copy link
Contributor

(Only tested with windows currently.)

@Cheney-W Cheney-W added requires:testing Needs tests added before merging category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist and removed requires:testing Needs tests added before merging labels Nov 27, 2023
@Neumann-A Neumann-A marked this pull request as ready for review December 4, 2023 08:01
Cheney-W
Cheney-W previously approved these changes Dec 4, 2023
@Cheney-W
Copy link
Contributor

Cheney-W commented Dec 4, 2023

Tested the installation of cub:x64-windows on a machine without CUDA installed (it depends on CUDA), and cub can be successfully installed.

@Cheney-W Cheney-W added the info:reviewed Pull Request changes follow basic guidelines label Dec 4, 2023
Copy link
Member

@BillyONeal BillyONeal left a comment

Choose a reason for hiding this comment

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

I am concerned that by effectively creating our own CUDA distribution that isn't identical to real CUDA (with CUDA_HOME and all that stuff) that this behavior is likely to be ... 'surprising'.

Also, this copies stuff from CUDA into the installed tree; I'm not sure that's desirable.

(I'm not 'request changes' here because these are closer to 'questions' than 'this needs to change')

@BillyONeal BillyONeal added requires:vcpkg-team-review This PR or issue requires someone on the vcpkg team to take a further look. and removed info:reviewed Pull Request changes follow basic guidelines labels Dec 5, 2023
# Conflicts:
#	ports/cuda-api-wrappers/vcpkg.json
#	versions/baseline.json
#	versions/c-/cuda-api-wrappers.json
@Cheney-W Cheney-W added the info:reviewed Pull Request changes follow basic guidelines label Mar 8, 2024
set(platform linux)
endif()

set(components
Copy link
Member

Choose a reason for hiding this comment

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

Where did these lists come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Asking this questions 5 months after the fact is a bit hard. But probably just open https://developer.download.nvidia.com/compute/cuda/redist/ in a web browser + look at the redistrib_x.y.z.json files there and also checking conda-forge recipes.

)

set(util
#nsight_compute
Copy link
Member

Choose a reason for hiding this comment

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

My understanding is that nsight is some kind of developer gui tool so its OK that it isn't included here, but it does highlight a concern: If folks were using vcpkg with something nsight, before they were getting the matching bits for their copy of CUDA, now they might get mismatched bits. Do we have folks who actually use cuda regularly to common on the practicality of this idea?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nobody stops you from installing the exact same version of cuda vcpkg would install. (If it even matters. From my understanding Nsight is basically a profiler like vtune to figure out bottlenecks. )


file(READ "${cuda_redist_json}" cuda_json)

file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/cuda")
Copy link
Member

Choose a reason for hiding this comment

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

Unfortunately I think this implicates the tool ports thing since this is going to try to provide nvcc...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is not trying to provide nvcc it is providing nvcc. (but you could also use the installation with clang to compile cuda)

Comment on lines 236 to 237
# Don't really know why this renaming is required.
file(RENAME "${CURRENT_PACKAGES_DIR}/tools/cuda/lib" "${CURRENT_PACKAGES_DIR}/tools/cuda/lib64")
Copy link
Member

Choose a reason for hiding this comment

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

In general lib vs. lib64 depends on one's distro...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

tuned to what nvcc expects.

foreach(pc_file IN LISTS pc_files)
file(READ "${pc_file}" contents)
string(REGEX REPLACE "cudaroot=[^\n]+" "cudaroot=\${prefix}/tools/cuda" contents "${contents}")
#string(REGEX REPLACE "/targets/x86_64-linux" "" contents "${contents}")
Copy link
Member

Choose a reason for hiding this comment

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

There's a lot of commented out code in here; are you still working on this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm below 5% lines are comments in this file is considered a lot?
I probably expected this to be needed to be changed but there was no pc file consumer for cuda yet so it couldn't be properly tested.

ports/cuda/portfile.cmake Outdated Show resolved Hide resolved
set(VCPKG_POLICY_SKIP_ARCHITECTURE_CHECK enabled)
set(VCPKG_POLICY_ONLY_RELEASE_CRT enabled)

set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
Copy link
Member

Choose a reason for hiding this comment

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

CUDA has headers so if you need this skip it seems like something is wrong? I would get this if it only made bits pointing to a separate cuda install somewhere, but it isn't doing that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

headers are not located in /include but /tools/cuda/... (whatever nvcc expects)

@BillyONeal
Copy link
Member

@data-queue @ras0219-msft @vicroms @JavierMatosD and I discussed this today and we are not blocking over $CUDA_HOME not being exactly the official layout. I still need to review this overall.

I think there needs to be a description in this port describing the differences between how it installs things and how things are in a 'CUDA_HOME'.

@BillyONeal BillyONeal removed the info:reviewed Pull Request changes follow basic guidelines label Mar 11, 2024
@Neumann-A
Copy link
Contributor Author

I think there needs to be a description in this port describing the differences between how it installs things and how things are in a 'CUDA_HOME'.

tools/cuda should have the same layout as CUDA_HOME since otherwise the compiler does not work. libs and dlls are also copied to (debug)?/bin (debug)?/lib for vcpkg to deploy the dlls and making it easier for cmake or other buildsystems to find the libs.

@BillyONeal
Copy link
Member

tools/cuda should have the same layout as CUDA_HOME since otherwise the compiler does not work. libs and dlls are also copied to (debug)?/bin (debug)?/lib for vcpkg to deploy the dlls and making it easier for cmake or other buildsystems to find the libs.

Can you describe this in a comment in the port?

@Neumann-A
Copy link
Contributor Author

Can you describe this in a comment in the port?

Added a comment in 6573e17

@Neumann-A
Copy link
Contributor Author

One issue here is that the license files seem to change over time.

@BillyONeal
Copy link
Member

It looks like they stopped with the 'sign one's life away' to download cudnn; https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/windows-x86_64/cudnn-windows-x86_64-9.2.0.82_cuda12-archive.zip looks like a normal URI now.

@BillyONeal
Copy link
Member

image

Cracking open the installer directly seems pseudo-blessed by nvidia now

@BillyONeal
Copy link
Member

(I'm just observing changes relevant to this review as I'm updating the build lab to CUDA 12.5, sorry for the spam)

ports/cudnn/portfile.cmake Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants