public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* libgomp nvptx plugin: Debugging output for cuInit failure
@ 2017-05-22 13:01 Thomas Schwinge
  2017-05-23 10:46 ` Jakub Jelinek
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Schwinge @ 2017-05-22 13:01 UTC (permalink / raw)
  To: gcc-patches, Jakub Jelinek

Hi!

OK for trunk?

commit 7b2f06b7d2fd23b20d81fda8be6ec7453e8b3fe3
Author: Thomas Schwinge <thomas@codesourcery.com>
Date:   Thu Dec 22 08:30:04 2016 +0100

    libgomp nvptx plugin: Debugging output for cuInit failure
    
            libgomp/
            * plugin/plugin-nvptx.c (nvptx_get_num_devices): Debugging output
            for cuInit failure.
---
 libgomp/plugin/plugin-nvptx.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git libgomp/plugin/plugin-nvptx.c libgomp/plugin/plugin-nvptx.c
index 3ef48dd..0e1b3e2 100644
--- libgomp/plugin/plugin-nvptx.c
+++ libgomp/plugin/plugin-nvptx.c
@@ -838,7 +838,11 @@ nvptx_get_num_devices (void)
   /* PR libgomp/65099: Currently, we only support offloading in 64-bit
      configurations.  */
   if (sizeof (void *) != 8)
-    return 0;
+    {
+      GOMP_PLUGIN_debug (0, "Disabling nvptx offloading;"
+			 " only 64-bit configurations are supported\n");
+      return 0;
+    }
 
   /* This function will be called before the plugin has been initialized in
      order to enumerate available devices, but CUDA API routines can't be used
@@ -852,7 +856,11 @@ nvptx_get_num_devices (void)
       /* This is not an error: e.g. we may have CUDA libraries installed but
          no devices available.  */
       if (r != CUDA_SUCCESS)
-        return 0;
+	{
+	  GOMP_PLUGIN_debug (0, "Disabling nvptx offloading; cuInit: %s\n",
+			     cuda_error (r));
+	  return 0;
+	}
     }
 
   CUDA_CALL_ERET (-1, cuDeviceGetCount, &n);


Grüße
 Thomas

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: libgomp nvptx plugin: Debugging output for cuInit failure
  2017-05-22 13:01 libgomp nvptx plugin: Debugging output for cuInit failure Thomas Schwinge
@ 2017-05-23 10:46 ` Jakub Jelinek
  2017-05-24  7:15   ` Thomas Schwinge
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Jelinek @ 2017-05-23 10:46 UTC (permalink / raw)
  To: Thomas Schwinge; +Cc: gcc-patches

On Mon, May 22, 2017 at 02:57:24PM +0200, Thomas Schwinge wrote:
> Hi!
> 
> OK for trunk?
> 
> commit 7b2f06b7d2fd23b20d81fda8be6ec7453e8b3fe3
> Author: Thomas Schwinge <thomas@codesourcery.com>
> Date:   Thu Dec 22 08:30:04 2016 +0100
> 
>     libgomp nvptx plugin: Debugging output for cuInit failure
>     
>             libgomp/
>             * plugin/plugin-nvptx.c (nvptx_get_num_devices): Debugging output
>             for cuInit failure.

Ok.

	Jakub

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: libgomp nvptx plugin: Debugging output for cuInit failure
  2017-05-23 10:46 ` Jakub Jelinek
@ 2017-05-24  7:15   ` Thomas Schwinge
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Schwinge @ 2017-05-24  7:15 UTC (permalink / raw)
  To: Jakub Jelinek, gcc-patches

Hi!

On Tue, 23 May 2017 12:41:05 +0200, Jakub Jelinek <jakub@redhat.com> wrote:
> On Mon, May 22, 2017 at 02:57:24PM +0200, Thomas Schwinge wrote:
> >     libgomp nvptx plugin: Debugging output for cuInit failure

> Ok.

Thanks.  As posted, just with better ChangeLog committed to trunk in
r248400:

commit d5f081f8cfa23d74aec1cea4dd4ae3061c4498c8
Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Wed May 24 06:59:05 2017 +0000

    libgomp nvptx plugin: Debugging output when disabling nvptx offloading
    
            libgomp/
            * plugin/plugin-nvptx.c (nvptx_get_num_devices): Debugging output
            when disabling nvptx offloading.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@248400 138bc75d-0d04-0410-961f-82ee72b054a4
---
 libgomp/ChangeLog             |  5 +++++
 libgomp/plugin/plugin-nvptx.c | 12 ++++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git libgomp/ChangeLog libgomp/ChangeLog
index 32f8bf1..14e95ef 100644
--- libgomp/ChangeLog
+++ libgomp/ChangeLog
@@ -1,3 +1,8 @@
+2017-05-24  Thomas Schwinge  <thomas@codesourcery.com>
+
+	* plugin/plugin-nvptx.c (nvptx_get_num_devices): Debugging output
+	when disabling nvptx offloading.
+
 2017-05-23  Thomas Schwinge  <thomas@codesourcery.com>
 
 	* testsuite/libgomp.oacc-c-c++-common/kernels-loop-2.c: Update.
diff --git libgomp/plugin/plugin-nvptx.c libgomp/plugin/plugin-nvptx.c
index 3ef48dd..0e1b3e2 100644
--- libgomp/plugin/plugin-nvptx.c
+++ libgomp/plugin/plugin-nvptx.c
@@ -838,7 +838,11 @@ nvptx_get_num_devices (void)
   /* PR libgomp/65099: Currently, we only support offloading in 64-bit
      configurations.  */
   if (sizeof (void *) != 8)
-    return 0;
+    {
+      GOMP_PLUGIN_debug (0, "Disabling nvptx offloading;"
+			 " only 64-bit configurations are supported\n");
+      return 0;
+    }
 
   /* This function will be called before the plugin has been initialized in
      order to enumerate available devices, but CUDA API routines can't be used
@@ -852,7 +856,11 @@ nvptx_get_num_devices (void)
       /* This is not an error: e.g. we may have CUDA libraries installed but
          no devices available.  */
       if (r != CUDA_SUCCESS)
-        return 0;
+	{
+	  GOMP_PLUGIN_debug (0, "Disabling nvptx offloading; cuInit: %s\n",
+			     cuda_error (r));
+	  return 0;
+	}
     }
 
   CUDA_CALL_ERET (-1, cuDeviceGetCount, &n);

Committed to gomp-4_0-branch in r248401:

commit e526e3776c9995e60927d8d75e9a2b2120702f57
Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Wed May 24 07:00:04 2017 +0000

    libgomp nvptx plugin: Debugging output when disabling nvptx offloading
    
            libgomp/
            * plugin/plugin-nvptx.c (nvptx_get_num_devices): Debugging output
            when disabling nvptx offloading.
    
    trunk r248400
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@248401 138bc75d-0d04-0410-961f-82ee72b054a4
---
 libgomp/ChangeLog.gomp        |  5 +++++
 libgomp/plugin/plugin-nvptx.c | 12 ++++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git libgomp/ChangeLog.gomp libgomp/ChangeLog.gomp
index 996c1f9..15e0c58 100644
--- libgomp/ChangeLog.gomp
+++ libgomp/ChangeLog.gomp
@@ -1,3 +1,8 @@
+2017-05-24  Thomas Schwinge  <thomas@codesourcery.com>
+
+	* plugin/plugin-nvptx.c (nvptx_get_num_devices): Debugging output
+	when disabling nvptx offloading.
+
 2017-05-17  Thomas Schwinge  <thomas@codesourcery.com>
 
 	* libgomp.texi (OpenACC Profiling Interface): Update.
diff --git libgomp/plugin/plugin-nvptx.c libgomp/plugin/plugin-nvptx.c
index a9d1f16..7bbaca5 100644
--- libgomp/plugin/plugin-nvptx.c
+++ libgomp/plugin/plugin-nvptx.c
@@ -807,7 +807,11 @@ nvptx_get_num_devices (void)
   /* PR libgomp/65099: Currently, we only support offloading in 64-bit
      configurations.  */
   if (sizeof (void *) != 8)
-    return 0;
+    {
+      GOMP_PLUGIN_debug (0, "Disabling nvptx offloading;"
+			 " only 64-bit configurations are supported\n");
+      return 0;
+    }
 
   /* This function will be called before the plugin has been initialized in
      order to enumerate available devices, but CUDA API routines can't be used
@@ -819,7 +823,11 @@ nvptx_get_num_devices (void)
       /* This is not an error: e.g. we may have CUDA libraries installed but
          no devices available.  */
       if (r != CUDA_SUCCESS)
-        return 0;
+	{
+	  GOMP_PLUGIN_debug (0, "Disabling nvptx offloading; cuInit: %s\n",
+			     cuda_error (r));
+	  return 0;
+	}
     }
 
   CUDA_CALL_ERET (-1, cuDeviceGetCount, &n);


Grüße
 Thomas

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-24  7:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-22 13:01 libgomp nvptx plugin: Debugging output for cuInit failure Thomas Schwinge
2017-05-23 10:46 ` Jakub Jelinek
2017-05-24  7:15   ` Thomas Schwinge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).