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

torchvision: Does not use the same compiler as torch when building with CUDA #217913

Closed
ConnorBaker opened this issue Feb 23, 2023 · 3 comments
Closed

Comments

@ConnorBaker
Copy link
Contributor

Describe the bug

Unlike torch, torchvision does not explicitly set the C/C++ compiler when building with CUDA. This is problematic because we can end up linking libraries built by different versions of the compiler built with different language standards. Additionally, we can potentially end up using a compiler which isn't supported by the version of NVCC being used.

torch does this in the preConfigure phase:

preConfigure = lib.optionalString cudaSupport ''
export TORCH_CUDA_ARCH_LIST="${cudaFlags.cudaCapabilitiesSemiColonString}"
export CC=${cudatoolkit.cc}/bin/gcc CXX=${cudatoolkit.cc}/bin/g++
'' + lib.optionalString (cudaSupport && cudnn != null) ''

torchvision can do it in the same place or in preBuild:

preBuild = lib.optionalString cudaSupport ''
export TORCH_CUDA_ARCH_LIST="${cudaFlags.cudaCapabilitiesSemiColonString}"
export FORCE_CUDA=1
'';

Notify maintainers

@ericsagnes

cc @NixOS/cuda-maintainers

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.12-200.fc37.x86_64, Fedora Linux, 37 (Workstation Edition), nobuild`
 - multi-user?: `no`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.14.0pre20230208_ec78896`
 - channels(connorbaker): `"nixpkgs"`
 - nixpkgs: `/home/connorbaker/.nix-defexpr/channels/nixpkgs`
@ConnorBaker
Copy link
Contributor Author

Would be closed by #218035

@SomeoneSerge
Copy link
Contributor

SomeoneSerge commented Feb 25, 2023

Duplicate of: #217878 (unless I'm mistaken)

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/tweag-nix-dev-update-45/26397/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

3 participants