]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libgomp/plugin/plugin-gcn.c: Show device number in ISA error message
authorTobias Burnus <tburnus@baylibre.com>
Mon, 11 Nov 2024 11:17:42 +0000 (12:17 +0100)
committerTobias Burnus <tburnus@baylibre.com>
Mon, 11 Nov 2024 11:17:42 +0000 (12:17 +0100)
libgomp/ChangeLog:

* plugin/plugin-gcn.c (isa_matches_agent): Mention the device number
and ROCR_VISIBLE_DEVICES when reporting an ISA mismatch error.

libgomp/plugin/plugin-gcn.c

index 592a7b6daba4ddecba1d4190892c2f47e1c86a27..f2f2940de9dbaf7486a2eb6dd504414c7beed046 100644 (file)
@@ -2414,14 +2414,17 @@ isa_matches_agent (struct agent_info *agent, Elf64_Ehdr *image)
 
   if (isa_field != agent->device_isa)
     {
-      char msg[120];
+      char msg[204];
       const char *agent_isa_s = isa_name (agent->device_isa);
       assert (agent_isa_s);
 
       snprintf (msg, sizeof msg,
-               "GCN code object ISA '%s' does not match GPU ISA '%s'.\n"
-               "Try to recompile with '-foffload-options=-march=%s'.\n",
-               isa_s, agent_isa_s, agent_isa_s);
+               "GCN code object ISA '%s' does not match GPU ISA '%s' "
+               "(device %d).\n"
+               "Try to recompile with '-foffload-options=-march=%s',\n"
+               "or use ROCR_VISIBLE_DEVICES to disable incompatible "
+               "devices.\n",
+               isa_s, agent_isa_s, agent->device_id, agent_isa_s);
 
       hsa_error (msg, HSA_STATUS_ERROR);
       return false;