https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81177
Bug ID: 81177 Summary: Dump cubin module to file before offloading in nvptx libgomp plugin Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: libgomp Assignee: unassigned at gcc dot gnu.org Reporter: vries at gcc dot gnu.org CC: jakub at gcc dot gnu.org Target Milestone: --- The nvptx libgomp plugin adds a number of ptx sources to a CUlinkState object using cuLinkAddData, and then links them together using the cuLinkComplete call: ... static bool link_ptx (CUmodule *module, const struct targ_ptx_obj *ptx_objs, unsigned num_objs) { ... GOMP_PLUGIN_debug (0, "Linking\n"); r = CUDA_CALL_NOCHECK (cuLinkComplete, linkstate, &linkout, &linkoutsize); GOMP_PLUGIN_debug (0, "Link complete: %fms\n", elapsed); GOMP_PLUGIN_debug (0, "Link log %s\n", &ilog[0]); if (r != CUDA_SUCCESS) { GOMP_PLUGIN_error ("cuLinkComplete error: %s", cuda_error (r)); return false; } CUDA_CALL (cuModuleLoadData, module, linkout); CUDA_CALL (cuLinkDestroy, linkstate); return true; } ... After that, the module is loaded using cuModuleLoadData. For debugging purposes, it would be good to be able to inspect the module.