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_VERSION instead of __CUDACC_VER_{MAJOR,MINOR}__? #38

Closed
Yangqing opened this issue Aug 1, 2016 · 3 comments
Closed

CUDA_VERSION instead of __CUDACC_VER_{MAJOR,MINOR}__? #38

Yangqing opened this issue Aug 1, 2016 · 3 comments

Comments

@Yangqing
Copy link

Yangqing commented Aug 1, 2016

Just out of curiosity, is there a reason we infer CUDA_VERSION out of libcudart.so, instead of CUDACC_VER_MAJOR and CUDACC_VER_MINOR defined by nvcc? I am curious mainly because having CUDA_VERSION figured out via shell script makes it kind of hard to compile in a separate environment without manually feeding in these macros.

@nluehr
Copy link
Contributor

nluehr commented Aug 3, 2016

NVCC's version variables are conveniently available during compilation, but the version is also needed at the shell level to build deb packages. I suspect this use case is what led to the current mechanism.

An alternative might be to derive the version from the output nvcc -V instead of libcudart's version. I'm not sure if this would be an improvement, without understanding better what environments you have in mind. You'd still need to locate libcudart in order to link. Also, if you want to build using different CUDA toolkits, you can export CUDA_HOME to the toolkit path, and all other directories should get set accordingly.

@sjeaugey
Copy link
Member

sjeaugey commented Aug 3, 2016

Sorry, I missed this issue. Nathan is right regarding the initial reason behind the CUDA version detection.

I agree we could support your case, where CUDA is already in the PATH and therefore you don't need to set CUDA_HOME.

The new Makefile was supposed to be easier to integrate in any build environment (mostly all variables can be redefined) but maybe we have a regression on that aspect.

Would it be an acceptable solution for you to set CUDA_HOME ?

If there is no easier/cleaner way, I guess you can always set CUDA_HOME with :

CUDA_HOME=$(dirname $(dirname $(which nvcc)))

@sjeaugey
Copy link
Member

sjeaugey commented May 6, 2019

Cleaning up old bugs. Please reopen if it is still a problem. Thanks !

@sjeaugey sjeaugey closed this as completed May 6, 2019
minsii added a commit to minsii/nccl that referenced this issue Nov 17, 2023
Summary:

See title.

Differential Revision: D51420806
minsii added a commit to minsii/nccl that referenced this issue Nov 17, 2023
Summary:

See title.

Differential Revision: D51420806
minsii added a commit to minsii/nccl that referenced this issue Nov 17, 2023
Summary:

See title.

Differential Revision: D51420806
minsii added a commit to minsii/nccl that referenced this issue Nov 17, 2023
Summary:

See title.

Differential Revision: D51420806
minsii added a commit to minsii/nccl that referenced this issue Jan 29, 2024
Summary:
Pull Request resolved: facebookresearch#38

See title.

Reviewed By: wesbland

Differential Revision: D51420806

fbshipit-source-id: e335d83175748fe7392c73881651bb9ad500a729
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

No branches or pull requests

3 participants