https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105201
Bug ID: 105201 Summary: cuLaunchKernel error with subsequent empty target regions Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libgomp Assignee: unassigned at gcc dot gnu.org Reporter: marcel at codesourcery dot com CC: jakub at gcc dot gnu.org Target Milestone: --- Hi all, I observed a "libgomp: cuLaunchKernel error: invalid resource handle" for the following testcase (compiled with x86_64-linux and run with nvptx offloading (different machines with different kinds of GPUs)): #include <omp.h> int main (int argc, char *const *argv) { __builtin_printf ("omp_get_num_devices (): %d\n", omp_get_num_devices ()); for (int i=0; i < 2; i++) #pragma omp target device (i) ; #pragma omp target device (0) ; return 0; } The error occurred when using two devices at least (for (n)one device the test passes). Marcel