diff mbox series

nvptx: Switch default from '-march=sm_30' to '-march=sm_52' (was: Raise nvptx code generation to default PTX ISA 7.3, sm_52, therefore CUDA 11.3 (released 2021-04))

Message ID 871pyh16sp.fsf@euler.schwinge.ddns.net
State New
Headers show
Series nvptx: Switch default from '-march=sm_30' to '-march=sm_52' (was: Raise nvptx code generation to default PTX ISA 7.3, sm_52, therefore CUDA 11.3 (released 2021-04)) | expand

Commit Message

Thomas Schwinge Dec. 9, 2024, 10:37 a.m. UTC
Hi!

On 2024-09-20T18:49:46+0200, Thomas Schwinge <tschwinge@baylibre.com> wrote:
> We'd like to raise nvptx code generation from PTX ISA 6.0, sm_30 "Kepler"
> to default PTX ISA 7.3, sm_52 "Maxwell", therefore CUDA 11.3 (2021-04).
> This is, primarily, so that we're able to use 'alloca' and related stack
> manipulation instructions, and improve upon the current:
>
>     sorry ("target cannot support alloca");
>
> I see, for example:
>
>   - Ubuntu 22.04 "jammy" LTS has 11.5.1-1ubuntu1 packaged
>   - Debian 12 "stable" ("bookworm", 2023-06) has 11.8.89~11.8.0-5~deb12u1 packaged
>
> ..., and sm_52 "Maxwell" has been supported as of CUDA 6.5 (2014-08), and
> thus supported by most Nvidia GPUs of the last decade, approximately.

As a first step, while still maintaining use of PTX ISA 6.0, I've pushed
to trunk branch commit d4e1f7cfdb8375c2a0076d4227a220b5e2682834
"nvptx: Switch default from '-march=sm_30' to '-march=sm_52'", see
attached.


Grüße
 Thomas
diff mbox series

Patch

From d4e1f7cfdb8375c2a0076d4227a220b5e2682834 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <tschwinge@baylibre.com>
Date: Mon, 11 Nov 2024 13:20:46 +0100
Subject: [PATCH] nvptx: Switch default from '-march=sm_30' to '-march=sm_52'

In preparation of GCC/nvptx code changes that require sm_52 features, this
commit raises nvptx code generation from sm_30 "Kepler" to sm_52 "Maxwell".
The latter has been supported as of CUDA 6.5 (2014-08), and is thus supported
by most Nvidia GPUs of the last decade, approximately.  (This commit doesn't
change the use of PTX ISA 6.0, which already requires CUDA 9.0 anyway.)

To continue building sm_30 multilib variants (for use via building/linking with
'-march=sm_30'), specify '--with-multilib-list=default,sm_30', for example.  Or,
to continue defaulting to sm_30 multilib variants, specify '--with-arch=sm_30'
(plus '--without-multilib-list', if applicable).  See the documentation,
<https://gcc.gnu.org/install/specific.html#nvptx-x-none>.

(Note that after a long deprecation time, eventually the
sm_3x "Kepler architecture support is removed from CUDA 12.0", 2022-12.)

	gcc/
	* config.gcc [nvptx-*]: Switch default from '-march=sm_30' to
	'-march=sm_52'.
	* doc/install.texi (Nvidia PTX Options): Update.
---
 gcc/config.gcc       | 4 ++--
 gcc/doc/install.texi | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/config.gcc b/gcc/config.gcc
index a2d21b5f3436..262b38cf0e36 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -4133,7 +4133,7 @@  if test x$with_arch = x ; then
       with_arch=mips2
       ;;
     nvptx-*)
-      with_arch=sm_30
+      with_arch=sm_52
       ;;
   esac
 
@@ -5596,7 +5596,7 @@  case "${target}" in
 	nvptx-*)
 		supported_defaults=arch
 
-		nvptx_multilibs_default=sm_30
+		nvptx_multilibs_default=sm_52
 
 		case "x${with_multilib_list}" in
 		x | xno)
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index f3a0700ced43..feabf4cbe20b 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -1422,7 +1422,7 @@  is specified, then no additional multilibs are built.
 Otherwise, @var{list} is a comma separated list specifying which
 multilibs to build.
 List items are either @samp{sm_SM}, or @samp{default}, which is a
-placeholder specifying a default set of multilibs: @samp{sm_30}.
+placeholder specifying a default set of multilibs: @samp{sm_52}.
 Any duplicates are filtered out.
 If @option{--with-multilib-list} is not specified, then
 @option{--with-multilib-list=default} is assumed.
@@ -4628,7 +4628,7 @@  Use the @option{--disable-sjlj-exceptions} and
 The @option{--with-arch} option may be specified to override the
 default value for the @option{-march} option, and to also build
 corresponding target libraries.
-The default is @option{--with-arch=sm_30}.
+The default is @option{--with-arch=sm_52}.
 
 For example, if @option{--with-arch=sm_70} is specified,
 code generation defaults to @option{-march=sm_70} and
-- 
2.34.1