Skip to content

Build: fix torch build on cuda-12#3203

Merged
dyzheng merged 1 commit into
deepmodeling:developfrom
caic99:cmake-
Nov 14, 2023
Merged

Build: fix torch build on cuda-12#3203
dyzheng merged 1 commit into
deepmodeling:developfrom
caic99:cmake-

Conversation

@caic99

@caic99 caic99 commented Nov 14, 2023

Copy link
Copy Markdown
Member

Reminder

  • Have you linked an issue with this pull request?
  • Have you noticed possible changes of behavior below or in the linked issue?
  • Have you explained the changes of codes in core modules of ESolver, HSolver, ElecState, Hamilt, Operator or Psi? (ignore if not applicable)

Linked Issue

conda-forge/abacus-feedstock#11

What's changed?

Torch will try to detect all applicable architectures for nvcc.
However, for TorchConfig -> Caffe2Config -> FindCUDA (outdated) -> select_compute_arch, it fails to remove unsupported arch for new CUDA toolkits.
This cause error when building with CUDA 12+:
nvcc fatal : Unsupported gpu architecture 'compute_35'

This PR will re-use the detected arch at the CUDA component part for Torch.

Any changes of core modules? (ignore if not applicable)

  • Example: I have added a new virtual function in the esolver base class in order to ...

@caic99 caic99 requested a review from njzjz November 14, 2023 03:31
@njzjz

njzjz commented Nov 14, 2023

Copy link
Copy Markdown
Member

Why can't the test detect this problem?

@dyzheng dyzheng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe the test of cuda compilation should cover different version of cuda, thanks for your contribution.

@dyzheng dyzheng merged commit cf870f2 into deepmodeling:develop Nov 14, 2023
@caic99 caic99 deleted the cmake- branch November 14, 2023 06:00
@caic99

caic99 commented Nov 14, 2023

Copy link
Copy Markdown
Member Author

Why can't the test detect this problem?

The tested CUDA environment does not contain PyTorch components.

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.

3 participants