<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ALTRAD8UD &#8211; richliu&#039;s blog</title>
	<atom:link href="https://blog.richliu.com/tag/altrad8ud/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.richliu.com</link>
	<description>Linux, 工作, 生活, 家人</description>
	<lastBuildDate>Fri, 17 Oct 2025 02:46:40 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>
	<item>
		<title>Build Master EDK2 for Altrad8ud</title>
		<link>https://blog.richliu.com/2025/10/17/6433/build-master-edk2-for-altrad8ud/</link>
					<comments>https://blog.richliu.com/2025/10/17/6433/build-master-edk2-for-altrad8ud/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Fri, 17 Oct 2025 02:30:02 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Altra]]></category>
		<category><![CDATA[ALTRAD8UD]]></category>
		<category><![CDATA[edk2]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=6433</guid>

					<description><![CDATA[<p>The previous article is the Ampere Altra Mt. Jade OpenB [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2025/10/17/6433/build-master-edk2-for-altrad8ud/">Build Master EDK2 for Altrad8ud</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>The previous article is the <a href="https://blog.richliu.com/2022/06/23/4601/ampere-altra-mt-jade-openbmc-build-guide-on-arm64-platform/">Ampere Altra Mt. Jade OpenBMC and EDKII build guide on ARM64 platform</a>. It&#8217;s a kind of old article and is for Mt. Jade, not for Altrad8ud. <br />Rebecca committed the Altrad8ud support for EDK2 several months ago. I&#8217;ll just update some procedures and the git tree addresses.</p>



<p>OS: ubuntu 24.04</p>



<span id="more-6433"></span>



<p>Install necessary packages</p>



<pre class="wp-block-code"><code>sudo apt update
sudo apt-get install -y build-essential chrpath cpio debianutils diffstat gawk git iputils-ping libdata-dumper-simple-perl liblz4-tool libsdl1.2-dev libthread-queue-any-perl locales python3 socat subversion texinfo wget zstd
sudo apt-get install -y uuid-dev acpica-tools</code></pre>



<p>If want to compile it on x86 platform, it needs to install cross compiler gcc</p>



<pre class="wp-block-code"><code>sudo apt install gcc-aarch64-linux-gnu
export GCC_AARCH64_PREFIX=aarch64-linux-gnu-</code></pre>



<p>Download git source code </p>



<pre class="wp-block-code"><code>export WORKSPACE=/nvme/tianocore
mkdir -p $WORKSPACE
cd $WORKSPACE
git clone https://github.com/tianocore/edk2.git
cd edk2
git submodule update --init
cd ..

git clone https://github.com/tianocore/edk2-platforms.git
cd edk2-platforms
git submodule update --init
cd ..
git clone https://github.com/tianocore/edk2-non-osi.git

git clone https://github.com/AmpereComputing/edk2-ampere-tools.git

git clone --depth 1 https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git</code></pre>



<p>Setup the environment, first time, it needs to run the script in the edk2 directory</p>



<pre class="wp-block-code"><code>make -C edk2/BaseTools
cd edk2
. edksetup.sh</code></pre>



<p>then it should run it again on &lt;WORKSPACE></p>



<pre class="wp-block-code"><code>cd $WORKSPACE
. edk2/edksetup.sh</code></pre>



<p>Build ARM ATF</p>



<pre class="wp-block-code"><code>cd $WORKSPACE
cd trusted-firmware-a                                                                        
make fiptool  
make certtool  </code></pre>



<p>add those parameters to your environment file and source it.</p>



<pre class="wp-block-preformatted">export WORKSPACE=/nvme/tianocore<br />export PACKAGES_PATH=$PWD/edk2:$PWD/edk2-platforms:$PWD/edk2-non-osi:$PWD/edk2-platforms/Features<br />ATFPATH=$WORKSPACE<br />export MANUFACTURER=ASRockRack<br />export BOARD_NAME=Altra1L2T<br />export PATH=$PATH:$ATFPATH/AtfTools/tools/cert_create:$ATFPATH/AtfTools/tools/fiptool</pre>



<p>Build the edk2 </p>



<pre class="wp-block-code"><code># build release version
./edk2-platforms/Platform/Ampere/buildfw.sh -m ASRockRack -p Altra1L2T -b RELEASE
# build debug version 
./edk2-platforms/Platform/Ampere/buildfw.sh -m ASRockRack -p Altra1L2T -b DEBUG
# Change default parameters
EDK2_X86_EMULATOR_ENABLE=FALSE EDK2_SHELL_ENABLE=TRUE ./edk2-platforms/Platform/Ampere/buildfw.sh -m ASRockRack -p Altra1L2T -b RELEASE</code></pre>



<p>Detail parameres can be seen in the build_fw.sh file</p>



<pre class="wp-block-code"><code>./edk2-platforms/Platform/Ampere/buildfw.sh  --help
Usage:
  ./edk2-platforms/Platform/Ampere/buildfw.sh &#91;options]

Options:
  -b &lt;bldtype&gt;, --build &lt;bldtype&gt;  Specify the build type: DEBUG or RELEASE
  -t &lt;tc&gt;, --toolchain &lt;tc&gt;        Specify the toolchain to use: GCC or CLANG
  -m &lt;mfg&gt;, --manufacturer &lt;mfg&gt;   Specify platform manufacturer (e.g. Ampere)
  -p &lt;plat&gt;, --platform &lt;plat&gt;     Specify platform to build (e.g. Jade)
  -l &lt;kern&gt;, --linuxboot &lt;kern&gt;    Build LinuxBoot firmware instead of full EDK2 with UEFI Shell, specifying path to flashkernel
  -f, --flash                      Copy firmware to BMC and flash firmware (keeping EFI variables and NVPARAMs) after building
  -F, --full-flash                 Copy firmware to BMC and flash full EEPROM (resetting EFI variables and NVPARAMs) after building

  Note: flash options require bmc.sh file with env vars BMC_HOST, BMC_USER and BMC_PASS defined

  Available manufacturers:
    ADLINK
    Ampere
    ASRockRack

  Available platforms:
    ADLINK     -&gt; ComHpcAlt
    Ampere     -&gt; Jade
    ASRockRack -&gt; Altra1L2Q
    ASRockRack -&gt; Altra1L2T

Environment Variables:
  SECUREBOOT_DIR       - directory to store SecureBoot keys, certs etc.
  USE_EXISTING_SB_KEYS - use existing Secure Boot Platform and Update keys
  DOWNLOAD_MS_SB_KEYS  - force re-download of Microsoft Secure Boot KEK and DB certificates
  CERT_PASSWORD        - password to use when generating Platform and Update Keys and certificates
                         defaults to "password" if not specified.

  EDK2_SECURE_BOOT_ENABLE             (TRUE)
  EDK2_NETWORK_ENABLE                 (TRUE)
  EDK2_INCLUDE_TFTP_COMMAND           (TRUE)
  EDK2_NETWORK_IP6_ENABLE             (TRUE)
  EDK2_NETWORK_ALLOW_HTTP_CONNECTIONS (FALSE)
  EDK2_NETWORK_TLS_ENABLE             (TRUE)
  EDK2_REDFISH_ENABLE                 (TRUE)
  EDK2_PERFORMANCE_MEASUREMENT_ENABLE (FALSE)
  EDK2_TPM2_ENABLE                    (TRUE)
  EDK2_HEAP_GUARD_ENABLE              (FALSE)
  EDK2_X86_EMULATOR_ENABLE            (TRUE)
  EDK2_SHELL_ENABLE                   (TRUE)</code></pre>



<p>If build_fw.sh run&#8217;s without any problem, it will generate a 10MB size BIOS image, but the stock ASRR image size is 32MB. Therefore, you needs to copy the EDK2 image into the stock image at offset 0x600000. You can download the Altrad8ud stock firmware from the Altrad8ud firmware download site.</p>



<pre class="wp-block-code"><code>dd if=edk2-uefi.bin of=stock-bios.bin bs=1MB seek=6 conv=notrunc</code></pre>



<p>Here is a sample script to package it again. It will generate fw-altrad8ud.tar, which can be upgraded via the WebGUI.</p>



<pre class="wp-block-code"><code>cp ampere/bios.bin .
cp ampere/MANIFEST .

dd if=Build/Altra1L2T/altra1l2t_uefi.bin of=bios.bin bs=1M seek=6 conv=notrunc

tar cf fw-altrad8ud.tar bios.bin MANIFEST</code></pre>



<p>Or you also can  copy bios.bin(modified) to the BMC and update it directly from the BMC. <br />because scp or sftp didn&#8217;t work for me, I used the http to download the image.</p>



<pre class="wp-block-code"><code># cd /tmp
# curl &lt;your web&gt;/bios.bin
# ampere_flash_bios.sh bios.bin</code></pre>



<p>ref. <a href="https://community.amperecomputing.com/t/edk2-new-support-for-asrock-rack-altrad8ud-1l2t-altrad8ud2-1l2q-and-build-improvements-for-mt-jade-and-com-hpc-alt/2969" target="_blank" rel="noopener">EDK2: new support for ASRock Rack ALTRAD8UD-1L2T / ALTRAD8UD2-1L2Q and build improvements for Mt Jade and COM-HPC-ALT</a></p>



<p></p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2025/10/17/6433/build-master-edk2-for-altrad8ud/">Build Master EDK2 for Altrad8ud</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2025/10/17/6433/build-master-edk2-for-altrad8ud/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>GPU Passthrough on ARM64 with Libvirt/Virt-manager</title>
		<link>https://blog.richliu.com/2025/02/12/6182/gpu-passthrough-on-arm64-with-libvirt-virt-manager/</link>
					<comments>https://blog.richliu.com/2025/02/12/6182/gpu-passthrough-on-arm64-with-libvirt-virt-manager/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Wed, 12 Feb 2025 09:18:24 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Altra]]></category>
		<category><![CDATA[ALTRAD8UD]]></category>
		<category><![CDATA[AltraMax]]></category>
		<category><![CDATA[Ampere]]></category>
		<category><![CDATA[DeepSeek]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Nvidia]]></category>
		<category><![CDATA[ollama]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=6182</guid>

					<description><![CDATA[<p>In this article, I’ll walk you through the steps to set [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2025/02/12/6182/gpu-passthrough-on-arm64-with-libvirt-virt-manager/">GPU Passthrough on ARM64 with Libvirt/Virt-manager</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>In this article, I’ll walk you through the steps to set up GPU passthrough on an ARM64 system using Libvirt and Virt-manager. While using the ChatGPT to search answer, the steps may seem straightforward, but missing a critical detail can cause the process to fail.</p>



<p><strong>System Specifications</strong></p>



<p><strong>Nvidia Driver</strong>: NVIDIA-Linux-aarch64-570.86.16.run<br /><strong>Host</strong>: Ampere Altra + ALTRAD8UD<br /><strong>Host OS</strong>: Ubuntu 22.04 with HWE kernel (6.8)<br /><strong>Guest OS</strong>: Ubuntu 22.04 (ubuntu-22.04-live-server-arm64.iso)<br /><strong>GPU</strong>: Nvidia RTX 4080 16GB</p>



<p><strong>Assumptions</strong></p>



<ol start="1" class="wp-block-list">
<li>You are familiar with Ubuntu and its basic commands.</li>



<li>You have experience using Virt-manager.</li>



<li>All commands are executed as the root user.</li>
</ol>



<p>If anything is unclear, you can refer to external resources for additional guidance.</p>



<span id="more-6182"></span>



<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>Table of Contents</h2><nav><ul><li><a href="#host-configuration">Host Configuration </a><ul><li><a href="#enable-iommu">Enable IOMMU</a></li><li><a href="#host-upgrade-to-hwe-kernel">Upgrade Host to HWE Kernel</a></li><li><a href="#configure-the-vfio-on-host">Configure VFIO on Host</a></li><li><a href="#disable-nvidia-driver-on-the-host">Disable Nvidia Driver on HOST</a></li></ul></li><li><a href="#configure-vm">Configure VM</a><ul><li><a href="#i">Install Virt-manager</a></li><li><a href="#create-vm-image">Create VM image</a></li><li><a href="#create-vm">Add Nvidia device to VM</a></li><li><a href="#disable-security-boot">Disable secure Boot in UEFI</a></li><li><a href="#gpu-passthrough-test">GPU Passthrough Test</a></li></ul></li></ul></nav></div>



<h2 class="wp-block-heading" id="host-configuration">Host Configuration </h2>



<h3 class="wp-block-heading" id="enable-iommu">Enable IOMMU</h3>



<p>To enable IOMMU, you need to enable the SR-IOV option in the BIOS and verify whether the Linux kernel has IOMMU enabled by default.</p>



<p>You can check if IOMMU is enabled by running:</p>



<pre class="wp-block-preformatted">$ dmesg | grep -i iommu</pre>



<p>Example output:</p>



<pre class="wp-block-preformatted">[    0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-6.8.0-52-generic root=UUID=6b78fa89-a575-432d-a445-1497c3467214 ro iommu=on<br />[    0.000000] Unknown kernel command line parameters "BOOT_IMAGE=/boot/vmlinuz-6.8.0-52-generic iommu=on", will be passed to user space.<br />[   11.561684] <strong>iommu: Default domain type: Translated</strong><br />[   11.566470] <strong>iommu: DMA domain TLB invalidation policy: strict mode</strong></pre>



<p>If IOMMU is not enabled, add <code>iommu=on</code> to the Linux kernel boot parameters:</p>



<pre class="wp-block-preformatted">$ vim /etc/default/grub </pre>



<p>Modify the line:</p>



<pre class="wp-block-preformatted">GRUB_CMDLINE_LINUX_DEFAULT="iommu=on"</pre>



<p>Then update GRUB and reboot:</p>



<pre class="wp-block-preformatted">$ update-grub2  <br />$ reboot  </pre>



<p>Additionally, enable SR-IOV in the BIOS. The exact location of this setting varies depending on the BIOS, but it is typically found under the PCIe subsystem or related options.</p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="1280" height="770" src="https://blog.richliu.com/wp-content/uploads/2025/02/image-4.png" alt="" class="wp-image-6183" srcset="https://blog.richliu.com/wp-content/uploads/2025/02/image-4.png 1280w, https://blog.richliu.com/wp-content/uploads/2025/02/image-4-600x361.png 600w, https://blog.richliu.com/wp-content/uploads/2025/02/image-4-768x462.png 768w, https://blog.richliu.com/wp-content/uploads/2025/02/image-4-816x491.png 816w" sizes="(max-width: 1280px) 100vw, 1280px" /></figure>



<h3 class="wp-block-heading" id="host-upgrade-to-hwe-kernel"><strong>Upgrade Host to HWE Kernel</strong></h3>



<p>I recommend using the Hardware Enablement (HWE) kernel on the host. While I’m unsure if the regular kernel works, the HWE kernel has been reliable in my experience. Install it with:</p>



<pre class="wp-block-preformatted">sudo apt install linux-generic-hwe-22.04</pre>



<h3 class="wp-block-heading" id="configure-the-vfio-on-host">Configure VFIO on Host</h3>



<p>The VM relies on the VFIO driver for GPU passthrough. To configure VFIO, you need to pass the PCIe device information to the VFIO driver.</p>



<p>First, identify the GPU’s PCIe device IDs:</p>



<pre class="wp-block-preformatted">$ lspci -nn</pre>



<p>Example output:</p>



<pre class="wp-block-preformatted"><br /><br />0005:01:00.0 VGA compatible controller [0300]: NVIDIA Corporation Device [<strong>10de:2704</strong>] (rev a1)<br />0005:01:00.1 Audio device [0403]: NVIDIA Corporation Device [<strong>10de:22bb</strong>] (rev a1)</pre>



<p>Here, <strong><code>10de:2704</code> </strong>is the GPU’s PCIe device ID, and <code><strong>10de:22bb</strong></code> is the audio device ID. At a minimum, you need to pass through the GPU device.</p>



<p>Next, edit the VFIO configuration file to include these IDs:</p>



<pre class="wp-block-preformatted">$ vim /etc/modprobe.d/vfio.conf</pre>



<p>Add the following line:</p>



<pre class="wp-block-preformatted">options vfio-pci ids=10de:2704,10de:22bb</pre>



<h3 class="wp-block-heading" id="disable-nvidia-driver-on-the-host">Disable Nvidia Driver on HOST</h3>



<p>To prevent the host from loading the Nvidia driver, add the Nvidia modules to the kernel’s blocklist:</p>



<pre class="wp-block-preformatted">$ vim /etc/modprobe.d/blacklist.conf</pre>



<p>Add the following lines:</p>



<pre class="wp-block-preformatted">blacklist nvidia<br />blacklist nvidia_drm<br />blacklist nvidia_modeset</pre>



<p>Update the initramfs and reboot:</p>



<pre class="wp-block-preformatted">$ update-initramfs -u<br />$ reboot</pre>



<h2 class="wp-block-heading" id="configure-vm">Configure VM</h2>



<h3 class="wp-block-heading" id="i">Install Virt-manager</h3>



<p>In this article, we used virt-manager as VM manager, first step is install virt-manager, suppose Ubuntu will install all relative packages. </p>



<pre class="wp-block-preformatted">$ apt install virt-manager </pre>



<p>If you’re using SSH with X11 forwarding (e.g.,&nbsp;<code>ssh -X host</code>) or MobaXTerm on Windows, Virt-manager will display the remote X window. If neither method works, consider installing a KDE desktop on the host and accessing it via the BMC remote console.</p>



<p>(Optional) Install KDE Plasma Desktop:</p>



<pre class="wp-block-preformatted">(option)<br />$ apt install kde-plasma-desktop</pre>



<h3 class="wp-block-heading" id="create-vm-image">Create VM image</h3>



<p>Virt-manager creates fixed-size VM images by default. If you prefer dynamic allocation, create the image manually:</p>



<pre class="wp-block-preformatted">$ qemu-img create -f qcow2 ubuntu2204.qcow2 200G</pre>



<h3 class="wp-block-heading" id="create-vm">Add Nvidia device to VM</h3>



<p>If the host is configured correctly, Virt-manager will list all PCIe devices, including the Nvidia GPU. Add the GPU and its audio device (e.g., <code><strong>0005:01:00.0</strong></code> and <code><strong>0005:01:00.1</strong></code>) to the VM’s hardware list.</p>



<p>After adding the devices, proceed with the Ubuntu 22.04 installation.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="1023" height="632" src="https://blog.richliu.com/wp-content/uploads/2025/02/image-5.png" alt="" class="wp-image-6184" srcset="https://blog.richliu.com/wp-content/uploads/2025/02/image-5.png 1023w, https://blog.richliu.com/wp-content/uploads/2025/02/image-5-600x371.png 600w, https://blog.richliu.com/wp-content/uploads/2025/02/image-5-768x474.png 768w, https://blog.richliu.com/wp-content/uploads/2025/02/image-5-816x504.png 816w" sizes="(max-width: 1023px) 100vw, 1023px" /></figure>



<p>After add hardware </p>



<figure class="wp-block-image size-full"><img decoding="async" width="1046" height="646" src="https://blog.richliu.com/wp-content/uploads/2025/02/image-6.png" alt="" class="wp-image-6185" srcset="https://blog.richliu.com/wp-content/uploads/2025/02/image-6.png 1046w, https://blog.richliu.com/wp-content/uploads/2025/02/image-6-600x371.png 600w, https://blog.richliu.com/wp-content/uploads/2025/02/image-6-768x474.png 768w, https://blog.richliu.com/wp-content/uploads/2025/02/image-6-816x504.png 816w" sizes="(max-width: 1046px) 100vw, 1046px" /></figure>



<p>Now, it can run begin install to install ubuntu 22.04</p>



<h3 class="wp-block-heading" id="disable-security-boot">Disable secure Boot in UEFI</h3>



<p>By default, Virt-manager enables Secure Boot. However, Nvidia drivers may not work with Secure Boot enabled. Even though the Nvidia installer includes a driver signing feature, the driver may still fail to load. To avoid issues, disable Secure Boot in the VM’s UEFI settings.</p>



<p>During the VM’s boot process, press the <strong><code>DEL</code> </strong>key to enter UEFI settings and uncheck the Secure Boot option.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="973" height="632" src="https://blog.richliu.com/wp-content/uploads/2025/02/image-7.png" alt="" class="wp-image-6186" srcset="https://blog.richliu.com/wp-content/uploads/2025/02/image-7.png 973w, https://blog.richliu.com/wp-content/uploads/2025/02/image-7-600x390.png 600w, https://blog.richliu.com/wp-content/uploads/2025/02/image-7-768x499.png 768w, https://blog.richliu.com/wp-content/uploads/2025/02/image-7-816x530.png 816w" sizes="(max-width: 973px) 100vw, 973px" /></figure>



<p>Before installing the Nvidia driver, ensure the necessary development packages are installed:</p>



<pre class="wp-block-preformatted">$ apt install build-essential</pre>



<p>Then, install the Nvidia driver and reboot the VM.</p>



<h3 class="wp-block-heading" id="gpu-passthrough-test">GPU Passthrough Test</h3>



<p>If everything is set up correctly, running <code><strong>nvidia-smi</strong></code> should display the GPU’s status.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1280" height="515" src="https://blog.richliu.com/wp-content/uploads/2025/02/image-8.png" alt="" class="wp-image-6188" srcset="https://blog.richliu.com/wp-content/uploads/2025/02/image-8.png 1280w, https://blog.richliu.com/wp-content/uploads/2025/02/image-8-600x241.png 600w, https://blog.richliu.com/wp-content/uploads/2025/02/image-8-768x309.png 768w, https://blog.richliu.com/wp-content/uploads/2025/02/image-8-816x328.png 816w" sizes="(max-width: 1280px) 100vw, 1280px" /></figure>



<p>For testing, you can use&nbsp;<strong>Ollama</strong>&nbsp;with the&nbsp;<strong>Deepseek-R1</strong>&nbsp;model. Install Ollama with:</p>



<pre class="wp-block-preformatted">curl -fsSL https://ollama.com/install.sh | sh</pre>



<p>Pull the Deepseek-R1 model. Since the GPU has 16GB of memory, the 14B model is a good choice (it requires ~10GB):</p>



<pre class="wp-block-preformatted">ollama run deepseek-r1:14b</pre>



<p>Ask a question like, “Why is the sky blue?” This will trigger the model’s Chain-of-Thought (CoT) reasoning.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1280" height="772" src="https://blog.richliu.com/wp-content/uploads/2025/02/image-9.png" alt="" class="wp-image-6189" srcset="https://blog.richliu.com/wp-content/uploads/2025/02/image-9.png 1280w, https://blog.richliu.com/wp-content/uploads/2025/02/image-9-600x362.png 600w, https://blog.richliu.com/wp-content/uploads/2025/02/image-9-768x463.png 768w, https://blog.richliu.com/wp-content/uploads/2025/02/image-9-816x492.png 816w" sizes="(max-width: 1280px) 100vw, 1280px" /></figure>



<p>Monitor the GPU’s status using <code>nvidia-smi</code> to ensure it’s functioning correctly.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1280" height="577" src="https://blog.richliu.com/wp-content/uploads/2025/02/image-10.png" alt="" class="wp-image-6190" srcset="https://blog.richliu.com/wp-content/uploads/2025/02/image-10.png 1280w, https://blog.richliu.com/wp-content/uploads/2025/02/image-10-600x270.png 600w, https://blog.richliu.com/wp-content/uploads/2025/02/image-10-768x346.png 768w, https://blog.richliu.com/wp-content/uploads/2025/02/image-10-816x368.png 816w" sizes="(max-width: 1280px) 100vw, 1280px" /></figure>



<p></p>



<p></p>



<p></p>



<p></p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2025/02/12/6182/gpu-passthrough-on-arm64-with-libvirt-virt-manager/">GPU Passthrough on ARM64 with Libvirt/Virt-manager</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2025/02/12/6182/gpu-passthrough-on-arm64-with-libvirt-virt-manager/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Dynatron W3 for Ampere AltraMax</title>
		<link>https://blog.richliu.com/2024/08/02/6012/dynatron-w3-for-ampere-altramax/</link>
					<comments>https://blog.richliu.com/2024/08/02/6012/dynatron-w3-for-ampere-altramax/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Thu, 01 Aug 2024 16:27:28 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[ALTRAD8UD]]></category>
		<category><![CDATA[AltraMax]]></category>
		<category><![CDATA[Ampere]]></category>
		<category><![CDATA[Ampere Computing]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=6012</guid>

					<description><![CDATA[<p>The Dynatron W3 fan package offers an alternative cooling solution, including a tower heatsink and 120mm fan. It's easy to install. Preliminary tests on an AltraMax 128-30 CPU show the fan maintains 64°C at 1400 RPM, consuming around 178W. While suitable for general use.</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/08/02/6012/dynatron-w3-for-ampere-altramax/">Dynatron W3 for Ampere AltraMax</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Ampere AltraMax is a powerful server CPU with numerous cores. However, it lacks solutions for end users, with the ASRock Rack motherboard being the only available option. The original package includes a heatsink but no CPU fan, necessitating alternative heat dissipation methods. Currently, there are some tower fans available, and I have acquired a <a href="https://ja.dynatron.co/product-page/w3" target="_blank" rel="noopener">Dynatron W3</a> fan (from <a href="https://www.newegg.com/dynatron-w3/p/N82E16835114163" target="_blank" rel="noopener">newegg</a>) for preliminary testing.</p>



<span id="more-6012"></span>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222502-scaled.jpg" alt="" class="wp-image-6013" srcset="https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222502-scaled.jpg 2560w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222502-600x450.jpg 600w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222502-768x576.jpg 768w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222502-1536x1152.jpg 1536w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222502-2048x1536.jpg 2048w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222502-816x612.jpg 816w" sizes="(max-width: 2560px) 100vw, 2560px" /></figure>



<p>The Dynatron W3 package comes in a standard case.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222514-scaled.jpg" alt="" class="wp-image-6014" srcset="https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222514-scaled.jpg 2560w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222514-600x450.jpg 600w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222514-768x576.jpg 768w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222514-1536x1152.jpg 1536w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222514-2048x1536.jpg 2048w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222514-816x612.jpg 816w" sizes="(max-width: 2560px) 100vw, 2560px" /></figure>



<p>includes a tower heatsink, one 120mm 4-pin fan, and thermal paste.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1920" height="2560" src="https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222526-scaled.jpg" alt="" class="wp-image-6015" srcset="https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222526-scaled.jpg 1920w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222526-450x600.jpg 450w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222526-768x1024.jpg 768w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222526-1152x1536.jpg 1152w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222526-1536x2048.jpg 1536w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222526-816x1088.jpg 816w" sizes="(max-width: 1920px) 100vw, 1920px" /></figure>



<p>The base is not entirely copper, and its area seems somewhat small</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222553-scaled.jpg" alt="" class="wp-image-6016" srcset="https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222553-scaled.jpg 2560w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222553-600x450.jpg 600w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222553-768x576.jpg 768w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222553-1536x1152.jpg 1536w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222553-2048x1536.jpg 2048w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_222553-816x612.jpg 816w" sizes="(max-width: 2560px) 100vw, 2560px" /></figure>



<p>other parts</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1920" height="2560" src="https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_223103-scaled.jpg" alt="" class="wp-image-6017" srcset="https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_223103-scaled.jpg 1920w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_223103-450x600.jpg 450w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_223103-768x1024.jpg 768w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_223103-1152x1536.jpg 1152w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_223103-1536x2048.jpg 1536w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_223103-816x1088.jpg 816w" sizes="(max-width: 1920px) 100vw, 1920px" /></figure>



<p>While no documentation is provided, installation is straightforward for those familiar with DIY PC building</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_224225-scaled.jpg" alt="" class="wp-image-6018" srcset="https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_224225-scaled.jpg 2560w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_224225-600x450.jpg 600w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_224225-768x576.jpg 768w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_224225-1536x1152.jpg 1536w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_224225-2048x1536.jpg 2048w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_224225-816x612.jpg 816w" sizes="(max-width: 2560px) 100vw, 2560px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_224252-scaled.jpg" alt="" class="wp-image-6019" srcset="https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_224252-scaled.jpg 2560w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_224252-600x450.jpg 600w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_224252-768x576.jpg 768w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_224252-1536x1152.jpg 1536w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_224252-2048x1536.jpg 2048w, https://blog.richliu.com/wp-content/uploads/2024/08/IMG_20240730_224252-816x612.jpg 816w" sizes="(max-width: 2560px) 100vw, 2560px" /></figure>



<p>There is a gap between the DDR slots and the CPU fan, but larger DIMMs might require disassembling and reinstalling the tower fan. </p>



<p>In a preliminary test using stress-ng with 128 threads on an AltraMax 128-30 CPU and ASRock Rack ALTRAD8UD-1L2T.</p>



<p>Test command is </p>



<pre class="wp-block-preformatted">stress-ng --cpu 128 --vm 128 --vm-bytes 128M --timeout 180s --metrics-brief</pre>



<p>the fan operated at 1400 RPM and maintained a quiet profile. The CPU temperature reached 64°C, staying below 70°C, with power consumption around 178W. </p>



<p>This performance suggests the tower fan is suitable for general purposes.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="766" height="322" src="https://blog.richliu.com/wp-content/uploads/2024/08/image.png" alt="" class="wp-image-6020" srcset="https://blog.richliu.com/wp-content/uploads/2024/08/image.png 766w, https://blog.richliu.com/wp-content/uploads/2024/08/image-600x252.png 600w" sizes="(max-width: 766px) 100vw, 766px" /></figure>



<p>Notice: The CPU&#8217;s TDP is rated at 250W, this maximum power draw is only achievable under full system stress, such as utilizing all 8 DRAM controllers and all PCIe root controllers. Therefore, this figure should be considered as a reference rather than a precise measurement.<br /></p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/08/02/6012/dynatron-w3-for-ampere-altramax/">Dynatron W3 for Ampere AltraMax</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2024/08/02/6012/dynatron-w3-for-ampere-altramax/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Play Game On Ampere Altra ARM64 Platform</title>
		<link>https://blog.richliu.com/2024/02/25/5816/play-game-on-ampere-altra-arm64-platform/</link>
					<comments>https://blog.richliu.com/2024/02/25/5816/play-game-on-ampere-altra-arm64-platform/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sun, 25 Feb 2024 04:38:53 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[GAME]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Altra]]></category>
		<category><![CDATA[ALTRAD8UD]]></category>
		<category><![CDATA[Ampere]]></category>
		<category><![CDATA[arm64]]></category>
		<category><![CDATA[Box86]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=5816</guid>

					<description><![CDATA[<p>Setup Steam on Ampere Altra platform. </p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/02/25/5816/play-game-on-ampere-altra-arm64-platform/">Play Game On Ampere Altra ARM64 Platform</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div class="wp-block-image">
<figure class="alignright size-full is-resized"><img loading="lazy" decoding="async" width="2560" height="1527" src="https://blog.richliu.com/wp-content/uploads/2024/02/IMG_20240223_154907-1-scaled.jpg" alt="" class="wp-image-5824" style="aspect-ratio:1.676489849377865;width:367px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/IMG_20240223_154907-1-scaled.jpg 2560w, https://blog.richliu.com/wp-content/uploads/2024/02/IMG_20240223_154907-1-600x358.jpg 600w, https://blog.richliu.com/wp-content/uploads/2024/02/IMG_20240223_154907-1-768x458.jpg 768w, https://blog.richliu.com/wp-content/uploads/2024/02/IMG_20240223_154907-1-1536x916.jpg 1536w, https://blog.richliu.com/wp-content/uploads/2024/02/IMG_20240223_154907-1-2048x1222.jpg 2048w, https://blog.richliu.com/wp-content/uploads/2024/02/IMG_20240223_154907-1-816x487.jpg 816w" sizes="(max-width: 2560px) 100vw, 2560px" /></figure></div>


<p>In previous article on <a href="https://blog.richliu.com/2024/02/21/5808/how-to-install-stable-diffusion-gui-on-arm64-nvidia-rtx-platform/">How to Install Stable Diffusion GUI on ARM64 Nvidia RTX platform</a> , we installed the Nvidia driver and ran PyTorch on the platform. Now, this platform has Nvidia RTX gaming card, can we use it to play game? </p>



<p>The answer is yes, there are some windows x86 or x64 emulators on Linux, but the most stable solution comes from Ampere&#8217;s official release solution. Other emulators might not work as well on this combination, such as FEX, but I don&#8217;t know whether it is a driver issue or another issue.</p>



<span id="more-5816"></span>



<p><br />Basically, following Ampere&#8217;s documentation makes it easy to install the driver and play games. Let&#8217;s combine both documents into one and simplify it in this article.<br /><br />Hardware <br />CPU: Ampere Altra <br />Board: AsRock ALTRAD8UD<br />GPU: Nvidia RTX 4080 <br /><br />Reference Ampere&#8217;s document<br /><a href="https://github.com/AmpereComputing/NVIDIA-GPU-Accelerated-Linux-Desktop-on-Ampere" target="_blank" rel="noopener">NVIDIA GPU Accelerated Linux Desktop on Ampere</a><br /><a href="https://github.com/AmpereComputing/Steam-on-Ampere" target="_blank" rel="noopener">Steam-on-Ampere</a></p>



<h2 class="wp-block-heading">Install Nvidia Driver</h2>



<p>All the conditions are similar to those outlined in the article <a href="https://blog.richliu.com/2024/02/21/5808/how-to-install-stable-diffusion-gui-on-arm64-nvidia-rtx-platform/">How to Install Stable Diffusion GUI on ARM64 Nvidia RTX platform</a>, using Ubuntu 22.04 with a general kernel (not the HWE kernel, which Nvidia may address in the future).</p>



<p>I haven&#8217;t utilized the original document&#8217;s script; instead, I&#8217;ve copied some necessary commands from it.</p>



<pre class="wp-block-preformatted">sudo apt-get install build-essential
# Install Nvidia driver here
sudo rmmod nouveau
cat &lt;&lt; EOF | sudo tee /etc/modprobe.d/blacklist-nouveau.conf
blacklist nouveau
options nouveau modeset=0
EOF

sudo nvidia-xconfig -a --cool-bits=31 --allow-empty-initial-configuration

# Install Desktop, personally I like kde. 
sudo apt install kde-plasma-desktop
# or it can install regular ubuntu desktop 
# sudo apt install ubuntu-desktop</pre>



<p>Download <a href="https://www.nvidia.com/en-us/drivers/unix/linux-aarch64-archive/" target="_blank" rel="noopener">Nvidia ARM64 (aarch64) Display Driver </a>; the current version, 535.154.05, is acceptable. After installing the Nvidia driver, simply reboot the system. You can then use the following command to check the driver status.</p>



<pre class="wp-block-preformatted">nvidia-smi</pre>



<h2 class="wp-block-heading">Disable aspm from kernel </h2>



<p>I didn&#8217;t apply this option. Most of the time, it&#8217;s only necessary to do so if the system encounters the massive AER error issue. Here&#8217;s an example command from the original document:</p>



<pre class="wp-block-preformatted">sudo nano /etc/default/grub
# Add pcie_aspm=off to kernel parameters
# GRUB_CMDLINE_LINUX_DEFAULT="pcie_aspm=off"
sudo update-grub
</pre>



<h2 class="wp-block-heading">Install Box86</h2>



<p>Following commands show how to install Box86</p>



<pre class="wp-block-preformatted">sudo wget https://itai-nelken.github.io/weekly-box86-debs/debian/box86.list -O /etc/apt/sources.list.d/box86.list
wget -qO- https://itai-nelken.github.io/weekly-box86-debs/debian/KEY.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg
sudo dpkg --add-architecture armhf
sudo apt update
sudo apt install box86:armhf -y</pre>



<h2 class="wp-block-heading">Install Box64</h2>



<p>Following command show how to install <a href="https://github.com/ryanfortner/box64-debs" target="_blank" rel="noopener">Box64</a>, but original instruction have update , a package name was changed. </p>



<pre class="wp-block-preformatted">sudo wget https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list
wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg
sudo apt update 
sudo apt install box64-arm64 -y
sudo systemctl restart systemd-binfmt</pre>



<h2 class="wp-block-heading">Installing Steam</h2>



<p>Because I am using the Ubuntu 22.04 ARM64 server version with minimal, so,  some packages might not be installed, Before Install Steam, install necessary packages</p>



<pre class="wp-block-preformatted">sudo apt install lsof

sudo apt install zenity
sudo apt install alsa
</pre>



<p>Use the following to install steam.</p>



<pre class="wp-block-code"><code>git clone https://github.com/ptitSeb/box86
cd box86
./install_steam.sh</code></pre>



<p>Now, it can use steam now. </p>



<pre class="wp-block-preformatted">/usr/local/bin/steam</pre>



<p>Okay, log in and enjoy it. However, in my experience, when installing other emulators, it might damage the box86+Steam setup, necessitating a system reinstallation to fix it.</p>



<p>Furthermore, the game&#8217;s performance seems not as good as expected, possibly due to my choice of Vampire Survivors and enabling high performance</p>



<h2 class="wp-block-heading">Xbox JoyStick controller</h2>



<p>I have an Xbox controller, and ALTRAD8UD doesn&#8217;t have Bluetooth capability, so I cannot use wireless conntions. However, it can connect via USB.</p>



<p>There are several Xbox drivers available for Linux. After testing, I found that <a href="https://atar-axis.github.io/xpadneo/" target="_blank" rel="noopener">xpadano</a> is compatible with this platform. Simply follow their instruction guide to install the Xbox driver.</p>



<pre class="wp-block-preformatted"># Install DKMS package
sudo apt-get install dkms linux-headers-`uname -r`

# download source code
git clone https://github.com/atar-axis/xpadneo.git
cd xpadneo
# use DKMS to compile the driver
sudo ./install.sh</pre>



<p>The Xbox controller driver will be installed automatically, and it works well in my tests. You can install the <code>jstest</code> package to perform a joystick test.</p>



<p>The Xbox controller functions seamlessly on Steam and Vampire Survivors. I can easily use the Xbox controller to play Vampire Survivors.</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/02/25/5816/play-game-on-ampere-altra-arm64-platform/">Play Game On Ampere Altra ARM64 Platform</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2024/02/25/5816/play-game-on-ampere-altra-arm64-platform/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Install Stable Diffusion GUI on ARM64 Nvidia RTX platform</title>
		<link>https://blog.richliu.com/2024/02/21/5808/how-to-install-stable-diffusion-gui-on-arm64-nvidia-rtx-platform/</link>
					<comments>https://blog.richliu.com/2024/02/21/5808/how-to-install-stable-diffusion-gui-on-arm64-nvidia-rtx-platform/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Wed, 21 Feb 2024 12:11:49 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[aarch64]]></category>
		<category><![CDATA[AI]]></category>
		<category><![CDATA[Altra]]></category>
		<category><![CDATA[ALTRAD8UD]]></category>
		<category><![CDATA[AltraMax]]></category>
		<category><![CDATA[Ampere]]></category>
		<category><![CDATA[arm64]]></category>
		<category><![CDATA[Nvidia]]></category>
		<category><![CDATA[RTX]]></category>
		<category><![CDATA[Stable Diffustion]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=5808</guid>

					<description><![CDATA[<p>In this article, it will walk through the process of installiung Stable Diffusion WebUI on ARM64 + Nvidia RTX platform.</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/02/21/5808/how-to-install-stable-diffusion-gui-on-arm64-nvidia-rtx-platform/">How to Install Stable Diffusion GUI on ARM64 Nvidia RTX platform</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div class="wp-block-image">
<figure class="alignright size-full is-resized"><img loading="lazy" decoding="async" width="1744" height="1177" src="https://blog.richliu.com/wp-content/uploads/2024/02/image-16.png" alt="" class="wp-image-5809" style="aspect-ratio:1.481733220050977;width:284px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/image-16.png 1744w, https://blog.richliu.com/wp-content/uploads/2024/02/image-16-600x405.png 600w, https://blog.richliu.com/wp-content/uploads/2024/02/image-16-768x518.png 768w, https://blog.richliu.com/wp-content/uploads/2024/02/image-16-1536x1037.png 1536w, https://blog.richliu.com/wp-content/uploads/2024/02/image-16-816x551.png 816w" sizes="(max-width: 1744px) 100vw, 1744px" /></figure></div>


<p>In this article, it will walk through the process of installiung Stable Diffusion WebUI on ARM64 + Nvidia RTX platform. <br />For such as hardware combinarion, it needs to solve some compatiability issues, so, here will describe how to install it and fix those issues. </p>



<span id="more-5808"></span>



<h2 class="wp-block-heading">Platform</h2>



<p>CPU: Ampere Altra ARM64 CPU<br />Board: AsRock ALTRAD8UD<br />OS: Ubuntu 22.04 </p>



<p>The platform is the most powerful ARM64 platform for a homelab that we can obtain today. There are some server models available, but they come with high-speed cooling fans that are not suitable for home use.</p>



<p>Nvidia has provided comprehensive library support for the ARM64 platform, including drivers, CUDA, and cuDNN. However, despite these efforts, there are still gaps in support. Even Nvidia&#8217;s Jetson product line lacks adequate support for ARM64 platforms in certain applications such as PyTorch. While there exists an individual PyTorch accelerator package for direct download on x64 platforms, the same cannot be said for ARM64 platforms. Although there is technically one package available, its availability is severely limited, rendering it practically useless.</p>



<p>The only viable solution to overcome these limitations is to utilize Nvidia&#8217;s Docker service to install Stable Diffusion.</p>



<h2 class="wp-block-heading">Installation</h2>



<p>Install Ubuntu 22.04 without selecting the HWE (Hardware Enablement) support. It appears that the current Nvidia driver version has issues, leading to potential soft-lock bugs. A general kernel version (5.15) is preferable for stability.</p>



<p>Next, install the necessary Ubuntu packages.</p>



<pre class="wp-block-preformatted">sudo apt-get install build-essential</pre>



<p>Download <a href="https://www.nvidia.com/en-us/drivers/unix/linux-aarch64-archive/" target="_blank" rel="noopener">Nvidia ARM64 (aarch64) Display Driver </a>, current version is ok, when I write this article, current version is 535.154.05 </p>



<h3 class="wp-block-heading">Docker</h3>



<p><br />Install Docker by following the Docker guide  <a href="https://docs.docker.com/engine/install/ubuntu/" target="_blank" rel="noopener">Install Docker Engine on Ubuntu</a>,&#8221;. Also provide the necessary installation steps here. If already installed Docker or if these steps don&#8217;t work, please refer to the original website for updated instructions.</p>



<pre class="wp-block-preformatted"># Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release &amp;&amp; echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list &gt; /dev/null
sudo apt-get update</pre>



<pre class="wp-block-preformatted">sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin</pre>



<h3 class="wp-block-heading">Nvidia Container Toolkit</h3>



<p>Follow the instructions for installing the <a href="https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#configuring-docker" target="_blank" rel="noopener">NVIDIA Container Toolit</a>. It can modify the Docker configuration using this toolkit. Alternatively, modifying the daemon.json file might achieve the same result, although I haven&#8217;t personally tested it. Below are the instructions:</p>



<pre class="wp-block-preformatted">curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
  &amp;&amp; curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
    sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
    sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list

sudo sed -i -e '/experimental/ s/^#//g' /etc/apt/sources.list.d/nvidia-container-toolkit.list

sudo apt-get update
sudo apt-get install -y nvidia-container-toolkit

sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker</pre>



<p>It can check the file /etc/docker/daemon.json file, the configuration should be like this.</p>



<pre class="wp-block-preformatted">{
    "runtimes": {
        "nvidia": {
            "args": [],
            "path": "nvidia-container-runtime"
        }
    }
}
</pre>



<h3 class="wp-block-heading">Run Nvidia pytorch docker image </h3>



<p>Following is example command to run the Nvidia pytorch docker image</p>



<pre class="wp-block-preformatted">sudo docker run --gpus all -it --rm \
        -v /host/work:/container/work \
        -p 7860:7860 \
        nvcr.io/nvidia/pytorch:XX.XX-py3
</pre>



<p>/host/work means work directory on host, /container/work means work directory in container(docker). -p 7860 mean gui default port, it needs to forward to host machine. XX.XX means container versiom please see tags to get container version, or this <a href="https://catalog.ngc.nvidia.com/orgs/nvidia/containers/pytorch/tags" target="_blank" rel="noopener">URL</a> . [<a href="https://catalog.ngc.nvidia.com/orgs/nvidia/containers/pytorch" target="_blank" rel="noopener">NGC Pytorch</a>]. Following is example command. </p>



<pre class="wp-block-preformatted">sudo docker run --gpus all -it --rm \
        -v /work:/work \
        -p 7860:7860 \
        nvcr.io/nvidia/pytorch:24.01-py3
</pre>



<h2 class="wp-block-heading">Stable Diffustion WebUI</h2>



<p>First steps clone Stable Diffustion WebUI source code. </p>



<pre class="wp-block-preformatted">git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git</pre>



<p>Then, it needs to modify the settings file. Edit webui.sh, and adjust the parameters to the following numbers.</p>



<pre class="wp-block-preformatted">use_venv=0
can_run_as_root=1</pre>



<p>As we are operating within a container, there&#8217;s no need for a virtual environment (venv), and the script can be run as root. Modify the file webui-user.sh and add COMMANDLINE_ARGS accordingly.</p>



<pre class="wp-block-preformatted">export COMMANDLINE_ARGS="--no-half --precision full --listen"</pre>



<p>or run it directly </p>



<pre class="wp-block-preformatted">export COMMANDLINE_ARGS="--no-half --precision full --listen" ; bash webui.sh</pre>



<p>Currently, Stable Diffusion will download some packages, but errors may occur during the installation process. We&#8217;ll address and fix these errors in the next few steps.</p>



<h3 class="wp-block-heading">CV2</h3>



<p>Error message :</p>



<pre class="wp-block-preformatted">    if __load_extra_py_code_for_module("cv2", submodule, DEBUG):
  File "/usr/local/lib/python3.10/dist-packages/cv2/__init__.py", line 28, in __load_extra_py_code_for_module
    py_module = importlib.import_module(module_name)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/usr/local/lib/python3.10/dist-packages/cv2/typing/__init__.py", line 168, in &lt;module&gt;
    LayerId = cv2.dnn.DictValue
AttributeError: module 'cv2.dnn' has no attribute 'DictValue'
</pre>



<p>Modify file &#8220;/usr/local/lib/python3.10/dist-packages/cv2/typing/__init__.py&#8221;, comment out line 169 like following.[<a href="https://github.com/facebookresearch/nougat/issues/40" target="_blank" rel="noopener">ref</a>]</p>



<pre class="wp-block-preformatted"># LayerId = cv2.dnn.DictValue</pre>



<h2 class="wp-block-heading">CodeFormer </h2>



<p>Error message:</p>



<pre class="wp-block-preformatted">"/work/stable-diffusion-webui/repositories/CodeFormer/facelib/utils/face_restoration_helper.py", line 7, in &lt;module&gt;
        from facelib.detection import init_detection_model
      File "/work/stable-diffusion-webui/repositories/CodeFormer/facelib/detection/__init__.py", line 11, in &lt;module&gt;
        from .yolov5face.face_detector import YoloDetector
      File "/work/stable-diffusion-webui/repositories/CodeFormer/facelib/detection/yolov5face/face_detector.py", line 20, in &lt;module&gt;
        IS_HIGH_VERSION = tuple(map(int, torch.__version__.split('+')[0].split('.'))) &gt;= (1, 9, 0)
    ValueError: invalid literal for int() with base 10: '0a0'
</pre>



<p>This issue caused by pytorch.<strong>version</strong>&nbsp;will return illegeal number like 2.2.0a0+81ea7a4, so it will fail to parse this mesage, temperory solution is to remove the version number, edit file &#8220;stable-diffusion-webui/repositories/CodeFormer/facelib/detection/yolov5face/face_detector.py&#8221;. and modify line 20, IS_HIGH_VERSION to following version to following:[<a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/13766" target="_blank" rel="noopener">ref</a>]</p>



<pre class="wp-block-preformatted">version_string = torch.version.split('+')[0]
version_string = ''.join(filter(str.isdigit, version_string))
IS_HIGH_VERSION = tuple(map(int, version_string.split('.'))) &gt;= (1, 9, 0)</pre>



<p>Now, the Stable Diffusion GUI should be working as well as expected</p>



<p></p>



<p></p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/02/21/5808/how-to-install-stable-diffusion-gui-on-arm64-nvidia-rtx-platform/">How to Install Stable Diffusion GUI on ARM64 Nvidia RTX platform</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2024/02/21/5808/how-to-install-stable-diffusion-gui-on-arm64-nvidia-rtx-platform/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>AsRock ALTRAD8UD-1L2T Ampere Altra/AltraMax Note</title>
		<link>https://blog.richliu.com/2024/02/07/5766/asrock-altrad8ud-1l2t-ampere-altra-altramax-note/</link>
					<comments>https://blog.richliu.com/2024/02/07/5766/asrock-altrad8ud-1l2t-ampere-altra-altramax-note/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Wed, 07 Feb 2024 04:10:41 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Altra]]></category>
		<category><![CDATA[ALTRAD8UD]]></category>
		<category><![CDATA[AltraMax]]></category>
		<category><![CDATA[arm64]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=5766</guid>

					<description><![CDATA[<p>ALTRAD8UD-1L2T is based on Ampere Altra Max/Ampere Altr [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/02/07/5766/asrock-altrad8ud-1l2t-ampere-altra-altramax-note/">AsRock ALTRAD8UD-1L2T Ampere Altra/AltraMax Note</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>ALTRAD8UD-1L2T is based on Ampere Altra Max/Ampere Altra processors server mother board. <br />This is an interesting board. AsRock has built a small, but powerful and feature-rich server board that is suitable for homelab use. If you are looking for a pure and powerful ARM64 environment, this is the best choice right now. </p>



<p>What truly impresses me is the board&#8217;s specifications. Not only does it boast a compact Micro-ATX form factor, but it also packs a powerful punch with four PCIe 4.0 x16 lanes, easily handling even demanding homelab tasks. The dual M.2 slots and dual OCULink port can enable software RAID for your NVMe disks. As a server board, it offers a BMC for remote control and system management. While the x64 platform remains popular, this board is an exceptional choice for those who prefer the non-x64 architecture, considering the limited choices with high speed fan options in server platforms. </p>



<span id="more-5766"></span>



<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>Table of Contents</h2><nav><ul><li><a href="#information">Information </a><ul><li><a href="#important-spec">Important Spec</a></li><li><a href="#where-to-buy">Where To Buy</a><ul><li><a href="#us-newegg">US/Newegg</a></li><li><a href="#uk-server-factory-ltd">UK/Server Factory Ltd</a></li></ul></li><li><a href="#news">News</a></li><li><a href="#cooling-solution">Cooling solution </a></li><li><a href="#other-reference-url">Other reference URL</a></li></ul></li><li><a href="#tricks-for-altrad-8-ud">Tricks for ALTRAD8UD</a><ul><li><a href="#open-bmc-default-username-password">OpenBMC default username password </a></li><li><a href="#serial-console-over-lan-port">Serial Console over LAN Port</a></li><li><a href="#serial-console-output-to-vga">Serial Console Output To VGA</a></li><li><a href="#ipmitool-fan-control-ref">Ipmitool Fan Control [ref]</a></li><li><a href="#nc-si-port">NC-SI Port </a></li></ul></li><li><a href="#known-issues"> Known Issues</a><ul><li><a href="#intel-x-550-massive-aer-error-messages-ref-1-ref-2">Intel X550 massive AER error messages[ref1][ref2]</a></li></ul></li></ul></nav></div>



<h2 class="wp-block-heading" id="information">Information </h2>



<h3 class="wp-block-heading" id="important-spec">Important Spec</h3>



<p><a href="https://www.asrockrack.com/general/productdetail.asp?Model=ALTRAD8UD-1L2T#Specifications" target="_blank" rel="noopener">AsRock ALTRAD8UD-1L2T Spec web site</a></p>



<h3 class="wp-block-heading" id="where-to-buy">Where To Buy</h3>



<h4 class="wp-block-heading" id="us-newegg">US/Newegg</h4>



<p><a href="https://www.newegg.com/p/N82E16813140130" target="_blank" rel="noopener">ASRock Rack ALTRAD8UD-1L2T Deep Micro-ATX Server Motherboard Single Socket (LGA 4926) Ampere Altra Max/Ampere Altra processors Dual 10G &amp; 1G Without CPU,</a> <br />Mother board only<br />USD$849.-</p>



<p><a href="https://www.newegg.com/p/N82E16813140134" target="_blank" rel="noopener">Asrock Rack Bundle ALTRAD8UD-1L2T Deep Micro-ATX Server Motherboard Single Socket (LGA 4926) with Ampere Altra Q64-22 64 cores &amp; 2U passive cooler, Dual 10G &#8211; Integrated by Asrock Rack with CPU and heatsink</a> <br />Mother board + Altra Q64-22 + 2U passive cooler(heatsink)<br />USD$1,500.-</p>



<h4 class="wp-block-heading" id="uk-server-factory-ltd">UK/Server Factory Ltd</h4>



<p><a href="https://serverfactory.com/asrock-altrad8ud-1l2t.html" target="_blank" rel="noopener">ASRock ALTRAD8UD-1L2T</a>: Board only,  Inc VAT: £870.00. </p>



<h3 class="wp-block-heading" id="news">News</h3>



<p><a href="https://www.servethehome.com/asrock-rack-altrad8ud-1l2t-review-this-is-the-ampere-arm-motherboard-you-want/" target="_blank" rel="noopener">ASRock Rack ALTRAD8UD-1L2T Review This is the Ampere Arm Motherboard You Want</a></p>



<h3 class="wp-block-heading" id="cooling-solution">Cooling solution </h3>



<p><a href="https://www.servethehome.com/making-arm-desktops-viable-ampere-altra-noctua-nh-d9-amp-4926-4u-and-nh-u14s-amp-4926/" target="_blank" rel="noopener">Making Arm Desktops Viable Ampere Altra Noctua NH-D9 AMP-4926 4U and NH-U14S AMP-4926</a> (Preview tower fan system)<br /><a href="https://blog.richliu.com/2024/01/09/5471/ampere-altra-altramax-asrock-altrad8ud-1l2t-liquid-cooling-system/">Ampere Altra/AltraMax AsRock ALTRAD8UD-1L2T Liquid Cooling System</a> (my homemake Liquid/Water cooling system)</p>



<h3 class="wp-block-heading" id="other-reference-url">Other reference URL</h3>



<p><a href="https://wiki.bsdio.com/en/asrock-rack-altrad8ud/introduction" target="_blank" rel="noopener">ASRock Rack ALTRAD8UD Getting Started</a> : A good note to start up to use the board. </p>



<h2 class="wp-block-heading" id="tricks-for-altrad-8-ud">Tricks for ALTRAD8UD</h2>



<p>This chapter aims to guide users through using the ALTRAD8UD board, addressing potential information gaps left by the official ALTRAD8UD manual.</p>



<p>For memory compatibility reference, AsRock offers its own DRAM AVL (Approved Vendor List). Alternatively, users can access the <a href="https://amperecomputing.com/customer-connect/products/altra-family-device-documentation" target="_blank" rel="noopener">Ampere Altra family device document</a>, freely available without registration.</p>



<h3 class="wp-block-heading" id="open-bmc-default-username-password">OpenBMC default username password </h3>



<p>User: root<br />Pass: 0penBmc (first word is zero, not O).<br />both BMC console and GUI&#8217;s default username password are the same. </p>



<h3 class="wp-block-heading" id="serial-console-over-lan-port">Serial Console over LAN Port</h3>



<p>The board support Serial Port Header (9-pin COM1), it needs to use this serial port or VGA port to enter BIOS and get BMC IP. <br />After get the BMC IP, it can get more information from serial console over LAN port <br />Port 2201: ATF console <br />Port 2202: SCP console <br />Port 2203: Host console <br />Port 22: ssh console<br /><br />Here is my script to run the sol and make it more easy to use</p>



<pre class="wp-block-preformatted"># It can put following two lines to bashrc
alias oit='ipmitool -U root -P 0penBmc -I lanplus -C 17'
alias ossh="sshpass -p 0penBmc ssh -o GlobalKnownHostsFile=/dev/null -o UserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no"

# get host console 
ossh root@&lt;bmc ip> -p 2203 
# get in bmc ssh console 
ossh root@&lt;bmc ip> </pre>



<h3 class="wp-block-heading" id="serial-console-output-to-vga">Serial Console Output To VGA</h3>



<p>If you cannot see the serial console output to console port, probably it bacuase this option was enabled[<a href="https://blog.richliu.com/2023/08/01/5267/arm64-cannot-output-linux-kernel-message-to-vga/">ref</a>], just turn it off and add console=tty0 or console=ttyAMA0 to grub.conf, ex:</p>



<pre class="wp-block-preformatted">GRUB_CMDLINE_LINUX_DEFAULT="console=ttyAMA0"</pre>



<h3 class="wp-block-heading" id="ipmitool-fan-control-ref">Ipmitool Fan Control [<a href="https://www.asrockrack.com/support/faq.tw.asp?id=38" target="_blank" rel="noopener">ref</a>]</h3>



<pre class="wp-block-preformatted">Manual Full speed
ipmitool raw 0x3a 0x01 0x64 0x64 0x64 0x64 0x64 0x64 0x64 0x64

Manual Half speed
ipmitool raw 0x3a 0x01 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32

Auto fan control
ipmitool raw 0x3a 0x01 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0</pre>



<h3 class="wp-block-heading" id="nc-si-port">NC-SI Port </h3>



<p>In the user manual, NC-SI port is typo, the NC-SI port location is 5, in the document which marked as IPMI LAN port. if use this port, both host and BMC can use the same network cable to connect to the same ethernet. <br /></p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="1220" height="952" src="https://blog.richliu.com/wp-content/uploads/2024/02/image-13.png" alt="" class="wp-image-5768" style="aspect-ratio:1.281512605042017;width:364px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/image-13.png 1220w, https://blog.richliu.com/wp-content/uploads/2024/02/image-13-600x468.png 600w, https://blog.richliu.com/wp-content/uploads/2024/02/image-13-768x599.png 768w" sizes="(max-width: 1220px) 100vw, 1220px" /></figure></div>


<h2 class="wp-block-heading" id="known-issues"><br /><br />Known Issues</h2>



<h3 class="wp-block-heading" id="intel-x-550-massive-aer-error-messages-ref-1-ref-2">Intel X550 massive AER error messages[<a href="https://www.thomas-krenn.com/en/wiki/PCIe_Bus_Error_Status_00001100" target="_blank" rel="noopener">ref</a>1][<a href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1521173" target="_blank" rel="noopener">ref</a>2]</h3>



<p></p>



<p>Seems that Intel NICs have compatibility issues with non-Intel platform systems. This can cause some server safety systems, like Advanced Error Reporting (AER), to generate many alerts and experience interface problems. A temporary solution is to add aspi_aspm=off to the Linux kernel parameters, ex:</p>



<pre class="wp-block-preformatted">GRUB_CMDLINE_LINUX_DEFAULT="console=ttyAMA0 pcie_aspm=off"</pre>



<p>It will fix the AER issue. </p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/02/07/5766/asrock-altrad8ud-1l2t-ampere-altra-altramax-note/">AsRock ALTRAD8UD-1L2T Ampere Altra/AltraMax Note</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2024/02/07/5766/asrock-altrad8ud-1l2t-ampere-altra-altramax-note/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
