<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Pytorch on Singularity</title><link>https://singularity.sg/tags/pytorch/</link><description>Recent content in Pytorch on Singularity</description><generator>Hugo</generator><language>en-SG</language><copyright>(c) {year} Abhishek Dujari</copyright><lastBuildDate>Mon, 17 Aug 2026 14:25:36 +0800</lastBuildDate><atom:link href="https://singularity.sg/tags/pytorch/index.xml" rel="self" type="application/rss+xml"/><item><title>Compiling PyTorch CUDA Extensions in Docker Without a GPU</title><link>https://singularity.sg/2026/08/compiling-pytorch-cuda-extensions-in-docker-without-a-gpu/</link><pubDate>Mon, 17 Aug 2026 14:25:36 +0800</pubDate><guid>https://singularity.sg/2026/08/compiling-pytorch-cuda-extensions-in-docker-without-a-gpu/</guid><description>&lt;p&gt;One detail that is easy to forget when building CUDA containers is that the GPU itself is normally not available during &lt;code&gt;docker build&lt;/code&gt;. The compiler and CUDA toolkit can be present, but PyTorch cannot inspect the target card and choose an architecture automatically.&lt;/p&gt;
&lt;p&gt;For an RTX 3090 build, the important setting is:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-dockerfile" data-lang="dockerfile"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;ENV&lt;/span&gt; &lt;span class="nv"&gt;TORCH_CUDA_ARCH_LIST&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;8.6&amp;#34;&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Compute capability &lt;code&gt;8.6&lt;/code&gt; is the correct target for the RTX 3090. This variable is specifically used by PyTorch CUDA extension builds. A plain &lt;code&gt;nvcc&lt;/code&gt; or CMake CUDA project needs its equivalent compiler or &lt;code&gt;CMAKE_CUDA_ARCHITECTURES&lt;/code&gt; setting instead.&lt;/p&gt;</description></item></channel></rss>