This is an archive of the discontinued LLVM Phabricator instance.

[HIP] Enable specifying different default gpu arch for HIP/CUDA.
ClosedPublic

Authored by hliao on Oct 3 2019, 7:31 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

hliao created this revision.Oct 3 2019, 7:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 3 2019, 7:31 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
hliao marked an inline comment as done.Oct 3 2019, 7:32 AM
hliao added inline comments.
clang/lib/Driver/Driver.cpp
2655 ↗(On Diff #223015)

Sam, could you let me know which reasonable default arch should we use here?

tra added inline comments.Oct 3 2019, 9:09 AM
clang/lib/Driver/Driver.cpp
2538 ↗(On Diff #223015)

This technically depends on the CUDA version.
We do have CUDA version info in clang/lib/Driver/ToolChains/Cuda.h
The default for NVCC has been sm_30 since CUDA-9.0. In fact sm_20 is not supported at all by CUDA-9.0+ at all , so we should bump the default to sm_30 for those versions.

hliao marked an inline comment as done.Oct 3 2019, 9:31 AM
hliao added inline comments.
clang/lib/Driver/Driver.cpp
2538 ↗(On Diff #223015)

unfortunately, when the action build is running, the CUDA is not detected yet, I probably revise the detection logic to update CUDA's default gpu arch after successful detection

yaxunl added inline comments.Oct 3 2019, 9:37 AM
clang/lib/Driver/Driver.cpp
2655 ↗(On Diff #223015)

I think it should be gfx803 since as far as I know it is the lowest one that supports HIP.

tra accepted this revision.Oct 3 2019, 9:46 AM
tra added inline comments.
clang/lib/Driver/Driver.cpp
2538 ↗(On Diff #223015)

OK. If there's no easy way to do it here, it's probably not worth doing it just to keep sm_20 as the default.
sm_20 has not been supported by the last two major CUDA releases and it makes little sense to have the default that does not work for the majority of current users.

I think we should just bump the default to sm_30 for all currently supported CUDA versions in a separate patch. I can do it once this patch lands.

This revision is now accepted and ready to land.Oct 3 2019, 9:46 AM
hliao marked 2 inline comments as done.Oct 3 2019, 10:47 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 3 2019, 10:47 AM