<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Debugging on ./Code</title><link>https://blog.ouankou.com/tags/debugging/</link><description>Recent content in Debugging on ./Code</description><generator>Hugo</generator><language>en-US</language><copyright>© Anjia Wang</copyright><lastBuildDate>Mon, 20 Apr 2026 23:22:04 -0700</lastBuildDate><atom:link href="https://blog.ouankou.com/tags/debugging/index.xml" rel="self" type="application/rss+xml"/><item><title>How To Debug When REX GPU Offloading Builds But Does Not Run</title><link>https://blog.ouankou.com/2026/04/13/how-to-debug-when-rex-gpu-offloading-builds-but-does-not-run/</link><pubDate>Mon, 13 Apr 2026 00:00:00 +0000</pubDate><guid>https://blog.ouankou.com/2026/04/13/how-to-debug-when-rex-gpu-offloading-builds-but-does-not-run/</guid><description>&lt;p&gt;The previous posts in this series split the runtime boundary into focused pieces:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;how REX registers CUBIN images with &lt;code&gt;libomptarget&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;how &lt;code&gt;rex_kmp.h&lt;/code&gt; rewrites generated runtime calls,&lt;/li&gt;
&lt;li&gt;and why the lowerer inserts &lt;code&gt;rex_offload_init()&lt;/code&gt; eagerly but avoids automatic &lt;code&gt;rex_offload_fini()&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Those posts explain the design.&lt;/p&gt;
&lt;p&gt;This one is about failure handling.&lt;/p&gt;
&lt;p&gt;Sometimes a REX-lowered program reaches a frustrating state:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the source lowers correctly,&lt;/li&gt;
&lt;li&gt;the host and device files compile,&lt;/li&gt;
&lt;li&gt;the final executable links,&lt;/li&gt;
&lt;li&gt;and then GPU offloading still does not work.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That kind of failure is easy to misdiagnose because it feels like &amp;ldquo;a CUDA runtime problem&amp;rdquo; or &amp;ldquo;an LLVM issue&amp;rdquo; in the abstract.&lt;/p&gt;</description></item></channel></rss>