This is an archive of the discontinued LLVM Phabricator instance.

[CUDA] Add support for 11.1
AbandonedPublic

Authored by kiwixz on Oct 1 2020, 9:12 AM.

Details

Reviewers
jlebar
tra
Summary

It looks like 11.1 doesn't have a version.txt file, so I changed the default guess in this case from CUDA 7.0 to 11.1.

Diff Detail

Event Timeline

kiwixz created this revision.Oct 1 2020, 9:12 AM
kiwixz requested review of this revision.Oct 1 2020, 9:12 AM
jlebar added a comment.Oct 1 2020, 9:18 AM

It looks like 11.1 doesn't have a version.txt file

Yikes, this is a problem if we can't tell the difference between CUDA versions!

kiwixz added a comment.Oct 1 2020, 9:21 AM

It looks like 11.1 doesn't have a version.txt file

Yikes, this is a problem if we can't tell the difference between CUDA versions!

It looks like a blunder from NVIDIA, CUDA 11.1 actually miss most of the documentation (pdf files etc).

tra added a comment.Oct 1 2020, 9:42 AM

Generally speaking the default should be conservative. It does us no good if we generate PTX 99.99, but discover that ptxas does not support it. Granted, these days 7.0 is also the wrong default as it's pretty ancient. IMO bumping it to 9.0 and GPU arch to sm_30 would be sensible.

Now, as for the missing version file, we should probably allow explicitly specifying the version. We already do it for HIP.

clang/lib/Driver/ToolChains/Cuda.cpp
662

I do not think LLVM has this feature implemented. I'm not sure how it reacts to clang specifying non-existing feature.

tra added a comment.Nov 2 2020, 2:33 PM

This patch is also missing corresponding LLVM changes that define features for sm_86 and ptx71.
See https://github.com/llvm/llvm-project/blob/master/llvm/lib/Target/NVPTX/NVPTX.td

clang/lib/Driver/ToolChains/Cuda.cpp
158–160

This should not be needed any more. Clang now extracts CUDA version from cuda.h.

kiwixz abandoned this revision.Mar 8 2021, 1:36 AM

Fixed in a much proper way in D89832. Thanks @tra!