<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Amd on Ulis Notes</title>
    <link>https://wolf-u.li/en/tag/amd/</link>
    <description>Recent content in Amd on Ulis Notes</description>
    <generator>Hugo</generator>
    <language>en</language>
    <copyright>Copyright 2006-CURRENTYEAR Uli Wolf - All rights reserved</copyright>
    <lastBuildDate>Sun, 04 Aug 2024 20:11:22 +0400</lastBuildDate>
    <atom:link href="https://wolf-u.li/en/tag/amd/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Using Ollama with AMD RX 6700 (gfx1031) or other older cards on Windows</title>
      
      
      <link>https://wolf-u.li/using-ollama-with-amd-rx-6700-gfx1031-or-other-older-cards-on-windows/</link>
      <pubDate>Sun, 04 Aug 2024 20:11:22 +0400</pubDate>
      <guid>https://wolf-u.li/using-ollama-with-amd-rx-6700-gfx1031-or-other-older-cards-on-windows/</guid>
      <description>&lt;p&gt;Ollama, the open-source platform for running powerful AI models locally on your hardware, is gaining traction for its ease of use and accessibility. While it primarily leverages NVIDIA GPUs through CUDA, the world of open-source extends beyond NVIDIA.  Today, I&amp;rsquo;ll show you how to harness the power of an AMD RX 6700 GPU with ROCm to run Ollama, bringing powerful AI capabilities within reach of a wider range of users.
&lt;ins class=&#34;adsbygoogle&#34; style=&#34;display:block; text-align:center;&#34; data-ad-layout=&#34;in-article&#34; data-ad-format=&#34;fluid&#34; data-ad-client=&#34;ca-pub-2322978122735420&#34; data-ad-slot=&#34;3161252284&#34;&gt;&lt;/ins&gt;&lt;/p&gt;</description>
      
         <content:encoded><![CDATA[<p>Ollama, the open-source platform for running powerful AI models locally on your hardware, is gaining traction for its ease of use and accessibility. While it primarily leverages NVIDIA GPUs through CUDA, the world of open-source extends beyond NVIDIA.  Today, I&rsquo;ll show you how to harness the power of an AMD RX 6700 GPU with ROCm to run Ollama, bringing powerful AI capabilities within reach of a wider range of users.
<ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-2322978122735420" data-ad-slot="3161252284"></ins></p>
<h2 id="what-is-rocm">What is ROCm?</h2>
<p>ROCm (Radeon Open Compute Platform) is AMD&rsquo;s open-source software platform for high-performance computing on Radeon GPUs. It provides the necessary drivers, libraries, and tools to unlock the full potential of AMD GPUs for various tasks, including machine learning.</p>
<h2 id="what-is-the-issue">What is the issue?</h2>
<p>While the AMD graphic cards are a cost-effective option (Compared to some NVIDIA counterparts), the challenge comes in with the general AI toolset support. E.g. ROCm by default doesn&rsquo;t feature the RX 6700 which i own. You can check the compatibility matrix <link rel=dns-prefetch href=//rocm.docs.amd.com /> <a href="https://rocm.docs.amd.com/projects/install-on-windows/en/develop/reference/system-requirements.html"
    title="here" 
     target="_blank" rel="nofollow noopener noreferrer" >
  here&nbsp;<svg xmlns="http://www.w3.org/2000/svg" class="icon" aria-hidden="true" focusable="false" viewBox="0 -128 512 640">
    <path d="M384 320c-17.67 0-32 14.33-32 32v96H64V160h96c17.67 0 32-14.32 32-32s-14.33-32-32-32L64 96c-35.35 0-64 28.65-64 64V448c0 35.34 28.65 64 64 64h288c35.35 0 64-28.66 64-64v-96C416 334.3 401.7 320 384 320zM488 0H352c-12.94 0-24.62 7.797-29.56 19.75c-4.969 11.97-2.219 25.72 6.938 34.88L370.8 96L169.4 297.4c-12.5 12.5-12.5 32.75 0 45.25C175.6 348.9 183.8 352 192 352s16.38-3.125 22.62-9.375L416 141.3l41.38 41.38c9.156 9.141 22.88 11.84 34.88 6.938C504.2 184.6 512 172.9 512 160V24C512 10.74 501.3 0 488 0z"/>
  </svg></a>. Also Ollama recently <link rel=dns-prefetch href=//ollama.com /> <a href="https://ollama.com/blog/amd-preview"
    title="announced" 
     target="_blank" rel="nofollow noopener noreferrer" >
  announced&nbsp;<svg xmlns="http://www.w3.org/2000/svg" class="icon" aria-hidden="true" focusable="false" viewBox="0 -128 512 640">
    <path d="M384 320c-17.67 0-32 14.33-32 32v96H64V160h96c17.67 0 32-14.32 32-32s-14.33-32-32-32L64 96c-35.35 0-64 28.65-64 64V448c0 35.34 28.65 64 64 64h288c35.35 0 64-28.66 64-64v-96C416 334.3 401.7 320 384 320zM488 0H352c-12.94 0-24.62 7.797-29.56 19.75c-4.969 11.97-2.219 25.72 6.938 34.88L370.8 96L169.4 297.4c-12.5 12.5-12.5 32.75 0 45.25C175.6 348.9 183.8 352 192 352s16.38-3.125 22.62-9.375L416 141.3l41.38 41.38c9.156 9.141 22.88 11.84 34.88 6.938C504.2 184.6 512 172.9 512 160V24C512 10.74 501.3 0 488 0z"/>
  </svg></a> that it supports some of the AMD cards but also there the support (due to the limitation of ROCm) is limited to some of the cards.</p>
<h2 id="any-way-out">Any way out?</h2>
<p>Thanks to ROCm&rsquo;s open nature allows for greater transparency and community collaboration, some very clever developers found a way to also compile the ROCm libraries, especially the HIP support for older cards.</p>
<h2 id="solution">Solution</h2>
<p>The solution is quite easy actually. We&rsquo;ll be using a repository which follows the official Ollama Releases but where the developer adds ROCm support for older devices.</p>
<h3 id="check-instructions">Check Instructions</h3>
<p>First check the <link rel=dns-prefetch href=//github.com /> <a href="https://github.com/likelovewant/ollama-for-amd/wiki#demo-release-version#demo-release-version"
    title="instructions" 
     target="_blank" rel="nofollow noopener noreferrer" >
  instructions&nbsp;<svg xmlns="http://www.w3.org/2000/svg" class="icon" aria-hidden="true" focusable="false" viewBox="0 -128 512 640">
    <path d="M384 320c-17.67 0-32 14.33-32 32v96H64V160h96c17.67 0 32-14.32 32-32s-14.33-32-32-32L64 96c-35.35 0-64 28.65-64 64V448c0 35.34 28.65 64 64 64h288c35.35 0 64-28.66 64-64v-96C416 334.3 401.7 320 384 320zM488 0H352c-12.94 0-24.62 7.797-29.56 19.75c-4.969 11.97-2.219 25.72 6.938 34.88L370.8 96L169.4 297.4c-12.5 12.5-12.5 32.75 0 45.25C175.6 348.9 183.8 352 192 352s16.38-3.125 22.62-9.375L416 141.3l41.38 41.38c9.156 9.141 22.88 11.84 34.88 6.938C504.2 184.6 512 172.9 512 160V24C512 10.74 501.3 0 488 0z"/>
  </svg></a></p>
<h3 id="install-rocm">Install ROCm</h3>
<p>Download ROCm (or respectively the HIP SDK) from <link rel=dns-prefetch href=//www.amd.com /> <a href="https://www.amd.com/en/developer/resources/rocm-hub/hip-sdk.html"
    title="here" 
     target="_blank" rel="nofollow noopener noreferrer" >
  here&nbsp;<svg xmlns="http://www.w3.org/2000/svg" class="icon" aria-hidden="true" focusable="false" viewBox="0 -128 512 640">
    <path d="M384 320c-17.67 0-32 14.33-32 32v96H64V160h96c17.67 0 32-14.32 32-32s-14.33-32-32-32L64 96c-35.35 0-64 28.65-64 64V448c0 35.34 28.65 64 64 64h288c35.35 0 64-28.66 64-64v-96C416 334.3 401.7 320 384 320zM488 0H352c-12.94 0-24.62 7.797-29.56 19.75c-4.969 11.97-2.219 25.72 6.938 34.88L370.8 96L169.4 297.4c-12.5 12.5-12.5 32.75 0 45.25C175.6 348.9 183.8 352 192 352s16.38-3.125 22.62-9.375L416 141.3l41.38 41.38c9.156 9.141 22.88 11.84 34.88 6.938C504.2 184.6 512 172.9 512 160V24C512 10.74 501.3 0 488 0z"/>
  </svg></a>. As of the time of writing this article, the version 5.7.1 was the supported one by the Ollama repository.</p>
<h3 id="install-modified-ollama">Install modified Ollama</h3>
<p>As mentioned above, we will be using a modified version of Ollama which you can download from <link rel=dns-prefetch href=//github.com /> <a href="https://github.com/likelovewant/ollama-for-amd/releases"
    title="here" 
     target="_blank" rel="nofollow noopener noreferrer" >
  here&nbsp;<svg xmlns="http://www.w3.org/2000/svg" class="icon" aria-hidden="true" focusable="false" viewBox="0 -128 512 640">
    <path d="M384 320c-17.67 0-32 14.33-32 32v96H64V160h96c17.67 0 32-14.32 32-32s-14.33-32-32-32L64 96c-35.35 0-64 28.65-64 64V448c0 35.34 28.65 64 64 64h288c35.35 0 64-28.66 64-64v-96C416 334.3 401.7 320 384 320zM488 0H352c-12.94 0-24.62 7.797-29.56 19.75c-4.969 11.97-2.219 25.72 6.938 34.88L370.8 96L169.4 297.4c-12.5 12.5-12.5 32.75 0 45.25C175.6 348.9 183.8 352 192 352s16.38-3.125 22.62-9.375L416 141.3l41.38 41.38c9.156 9.141 22.88 11.84 34.88 6.938C504.2 184.6 512 172.9 512 160V24C512 10.74 501.3 0 488 0z"/>
  </svg></a>. Once installed it might ask you to update Ollama which you MUST NOT do.</p>
<h3 id="implement-modified-rocblas">Implement modified ROCblas</h3>
<p>The next step is to visit <link rel=dns-prefetch href=//github.com /> <a href="https://github.com/likelovewant/ROCmLibs-for-gfx1103-AMD780M-APU/releases/tag/v0.5.7"
    title="this page" 
     target="_blank" rel="nofollow noopener noreferrer" >
  this page&nbsp;<svg xmlns="http://www.w3.org/2000/svg" class="icon" aria-hidden="true" focusable="false" viewBox="0 -128 512 640">
    <path d="M384 320c-17.67 0-32 14.33-32 32v96H64V160h96c17.67 0 32-14.32 32-32s-14.33-32-32-32L64 96c-35.35 0-64 28.65-64 64V448c0 35.34 28.65 64 64 64h288c35.35 0 64-28.66 64-64v-96C416 334.3 401.7 320 384 320zM488 0H352c-12.94 0-24.62 7.797-29.56 19.75c-4.969 11.97-2.219 25.72 6.938 34.88L370.8 96L169.4 297.4c-12.5 12.5-12.5 32.75 0 45.25C175.6 348.9 183.8 352 192 352s16.38-3.125 22.62-9.375L416 141.3l41.38 41.38c9.156 9.141 22.88 11.84 34.88 6.938C504.2 184.6 512 172.9 512 160V24C512 10.74 501.3 0 488 0z"/>
  </svg></a> and to choose the correct file according to your graphics architecture. In my case, an RX 6700 (which is a gfx1031 architecture) i would download either <code>rocm.gfx1031.for.hip.sdk.5.7.optimized.with.little.wu.logic.and.I8II.support.7z</code> or <code>rocBLAS-HIP5.7.1-win.rar</code>. Now you need to unpack the <code>rocblas.dll</code> from the archive to the following directories:</p>
<ul>
<li><code>C:\Program Files\AMD\ROCm\5.7\bin</code></li>
<li><code>%LocalAppData%\Programs\Ollama\lib\ollama</code></li>
</ul>
<p>And the folder <code>library</code> from the archive to the following directories:</p>
<ul>
<li><code>C:\Program Files\AMD\ROCm\5.7\bin\rocblas</code></li>
<li><code>%LocalAppData%\Programs\Ollama\lib\ollama\rocblas</code></li>
</ul>
<h3 id="test">Test</h3>
<p>After completing these steps, open the Ollama and run your model.</p>
<h3 id="updates-to-this-article">Updates to this article</h3>
<ul>
<li>2025-Jan-28: Tested ROCm 6.1 and failed miserably with ollama-for-amd v0.5.4. Went back to ROCm 5.7 with ollama-for-amd v0.5.4.</li>
<li>2025-Jan-29: Added various clarifications and also more details for the unpacking of the modified rocm libraries.</li>
</ul>
]]></content:encoded>
    </item>
  </channel>
</rss>
