<?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>Altra &#8211; richliu&#039;s blog</title>
	<atom:link href="https://blog.richliu.com/tag/altra/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>Ragflow on ARM64</title>
		<link>https://blog.richliu.com/2025/02/10/6176/ragflow-on-arm64/</link>
					<comments>https://blog.richliu.com/2025/02/10/6176/ragflow-on-arm64/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Mon, 10 Feb 2025 14:46:17 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[Altra]]></category>
		<category><![CDATA[Ampere]]></category>
		<category><![CDATA[arm64]]></category>
		<category><![CDATA[DeepSeek]]></category>
		<category><![CDATA[Ragflow]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=6176</guid>

					<description><![CDATA[<p>RAGFlow is an open-source RAG (Retrieval-Augmented Gene [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2025/02/10/6176/ragflow-on-arm64/">Ragflow on ARM64</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p><a href="https://ragflow.io/" target="_blank" rel="noopener"><strong>RAGFlow</strong></a> is an open-source RAG (Retrieval-Augmented Generation) engine built on deep document understanding. It is very easy to use and install. However, RAGFlow does not officially support the ARM64 platform, so it needs to be built from source for deployment on ARM64 systems.</p>



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



<p>In this article, I will skip other steps such as installing Ollama.</p>



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



<ul class="wp-block-list">
<li><strong>OS:</strong> Ubuntu 22.04 on an ARM64 virtual machine</li>



<li><strong>CPU:</strong> Ampere Altra</li>



<li><strong>DRAM:</strong> 32GB (allocated to the VM, though smaller models do not require this much memory)</li>
</ul>



<p>At the time of writing, Infinity does not support the ARM64 platform, but that is not an issue since we do not need it. RAGFlow uses Elasticsearch as its default AI database engine, and Elasticsearch does support the ARM64 platform.</p>



<h2 class="wp-block-heading">Building RAGFlow on ARM64</h2>



<p>Build ragflow command [ref. <a href="https://ragflow.io/docs/dev/build_docker_image" target="_blank" rel="noopener">Build a RAGFlow Docker Image</a>]</p>



<pre class="wp-block-preformatted">git clone https://github.com/infiniflow/ragflow.git<br />cd ragflow/<br />docker build --build-arg LIGHTEN=1 -f Dockerfile -t &lt;username&gt;/ragflow:&lt;version&gt; .<br /><br />docker build --build-arg LIGHTEN=1 -f Dockerfile -t user/ragflow:v0.16.0 .</pre>



<p>If everything is set up correctly, the Docker images will display an output similar to the following:</p>



<pre class="wp-block-preformatted">docker images<br />REPOSITORY                                      TAG                            IMAGE ID       CREATED         SIZE<br />user/ragflow                                    v0.16.0                        8a71ac9cb2fa   3 hours ago     5.73GB</pre>



<p>Note that this image does not include pre-built models. However, models can be installed separately using other methods.</p>



<h2 class="wp-block-heading">Running RAGFlow</h2>



<p>Before running the <code><strong>docker-compose</strong></code> command, assign the RAGFlow Docker image name to the <code><strong>docker-compose</strong></code> configuration.</p>



<pre class="wp-block-preformatted">export RAGFLOW_IMAGE=user/ragflow:v0.16.0<br />docker compose -f docker/docker-compose.yml up -d</pre>



<p>If everything is set up correctly, you should see a message similar to the following:</p>



<pre class="wp-block-preformatted">[+] Running 10/10<br /> <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/2714.png" alt="✔" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Network docker_ragflow      Created                                                                         0.2s<br /> <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/2714.png" alt="✔" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Volume "docker_minio_data"  Created                                                                         0.0s<br /> <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/2714.png" alt="✔" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Volume "docker_redis_data"  Created                                                                         0.0s<br /> <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/2714.png" alt="✔" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Volume "docker_esdata01"    Created                                                                         0.0s<br /> <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/2714.png" alt="✔" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Volume "docker_mysql_data"  Created                                                                         0.0s<br /> <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/2714.png" alt="✔" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Container ragflow-mysql     Healthy                                                                        21.7s<br /> <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/2714.png" alt="✔" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Container ragflow-minio     Started                                                                         1.1s<br /> <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/2714.png" alt="✔" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Container ragflow-redis     Started                                                                         1.1s<br /> <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/2714.png" alt="✔" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Container ragflow-es-01     Started                                                                         1.1s<br /> <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/2714.png" alt="✔" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Container ragflow-server    Started                                                                        22.3s<br /></pre>



<p>Downloading Models with Ollama</p>



<p>Ollama needs to download certain models for system functionality. Here’s an easy way to download the models—you can choose the ones you prefer.</p>



<pre class="wp-block-preformatted">ollama pull deepseek-r1:14b<br />ollama pull deepseek-r1:32b<br />ollama pull smartcreation/bge-large-zh-v1.5:latest</pre>



<p>After downloading the Ollama models, you need to add them in the <strong>&#8220;USER → Model Providers → Add Ollama Model&#8221;</strong> section. Below is an example of how to add the Deepseek model. Once you understand the process, you can add more models as needed.</p>



<p>At a minimum, you will need one chat model and one embedding model.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="764" height="913" src="https://blog.richliu.com/wp-content/uploads/2025/02/image-1.png" alt="" class="wp-image-6177" srcset="https://blog.richliu.com/wp-content/uploads/2025/02/image-1.png 764w, https://blog.richliu.com/wp-content/uploads/2025/02/image-1-502x600.png 502w" sizes="(max-width: 764px) 100vw, 764px" /></figure>



<p>After pressing <strong>OK</strong>, you can configure the <strong>System Model Settings</strong>, which should look something like this:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="761" height="933" src="https://blog.richliu.com/wp-content/uploads/2025/02/image-2.png" alt="" class="wp-image-6178" srcset="https://blog.richliu.com/wp-content/uploads/2025/02/image-2.png 761w, https://blog.richliu.com/wp-content/uploads/2025/02/image-2-489x600.png 489w" sizes="(max-width: 761px) 100vw, 761px" /></figure>



<p>Using RAGFlow</p>



<p>Now, you are ready to use the&nbsp;<strong>Knowledge Base</strong>&nbsp;and&nbsp;<strong>Chat</strong>&nbsp;features to explore RAGFlow.</p>



<p>For example, you can ask the engine to generate an ARM SIMD sample code based on the ARMv8 documentation.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1742" height="1021" src="https://blog.richliu.com/wp-content/uploads/2025/02/image-3.png" alt="" class="wp-image-6179" srcset="https://blog.richliu.com/wp-content/uploads/2025/02/image-3.png 1742w, https://blog.richliu.com/wp-content/uploads/2025/02/image-3-600x352.png 600w, https://blog.richliu.com/wp-content/uploads/2025/02/image-3-768x450.png 768w, https://blog.richliu.com/wp-content/uploads/2025/02/image-3-1536x900.png 1536w, https://blog.richliu.com/wp-content/uploads/2025/02/image-3-816x478.png 816w" sizes="(max-width: 1742px) 100vw, 1742px" /></figure>



<p>Conclusion</p>



<p>RAGFlow is an easy-to-use RAG framework. Although it does not provide a default ARM64 image, you can still build it from source to obtain a functional version of RAGFlow.</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2025/02/10/6176/ragflow-on-arm64/">Ragflow on ARM64</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/10/6176/ragflow-on-arm64/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Gentoo ARM64 Altra Compile chromium Issue</title>
		<link>https://blog.richliu.com/2024/10/10/6052/gentoo-arm64-altra-compile-chromium-issue/</link>
					<comments>https://blog.richliu.com/2024/10/10/6052/gentoo-arm64-altra-compile-chromium-issue/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Wed, 09 Oct 2024 17:22:12 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[aarch64]]></category>
		<category><![CDATA[Altra]]></category>
		<category><![CDATA[AltraMax]]></category>
		<category><![CDATA[Ampere]]></category>
		<category><![CDATA[arm64]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=6052</guid>

					<description><![CDATA[<p>When compile the chromium on my Altra platform, it meet [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/10/10/6052/gentoo-arm64-altra-compile-chromium-issue/">Gentoo ARM64 Altra Compile chromium Issue</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>When compile the chromium on my Altra platform, it meet compile problem like this</p>



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



<pre class="wp-block-preformatted">no-dangling-assignment-gsl -std=c++20 -Wno-trigraphs -gsimple-template-names -fno-exceptio00:01:51 [472/19443]
nc++ -isystem../../third_party/libc++/src/include -isystem../../third_party/libc++abi/src/include -fvisibility
-inlines-hidden -O2 -pipe -march=armv8.2-a -Wno-unknown-warning-option -c ../../third_party/libyuv/source/comp
are_neon64.cc -o obj/third_party/libyuv/libyuv_neon/compare_neon64.o
../../third_party/libyuv/source/compare_neon64.cc:175:8: error: instruction requires: dotprod
  175 |       "udot        v4.4s, v0.16b, v6.16b         \n"
      |        ^
&lt;inline asm>:14:1: note: instantiated into assembly here
   14 | udot        v4.4s, v0.16b, v6.16b
      | ^
../../third_party/libyuv/source/compare_neon64.cc:176:8: error: instruction requires: dotprod
  176 |       "udot        v5.4s, v1.16b, v6.16b         \n"
      |        ^
&lt;inline asm>:15:1: note: instantiated into assembly here
   15 | udot        v5.4s, v1.16b, v6.16b
      | ^
../../third_party/libyuv/source/compare_neon64.cc:204:8: error: instruction requires: dotprod
  204 |       "udot        v4.4s, v0.16b, v0.16b         \n"
      |        ^
&lt;inline asm>:10:1: note: instantiated into assembly here
   10 | udot        v4.4s, v0.16b, v0.16b
      | ^
../../third_party/libyuv/source/compare_neon64.cc:205:8: error: instruction requires: dotprod
  205 |       "udot        v5.4s, v1.16b, v1.16b         \n"
      |        ^
&lt;inline asm>:11:1: note: instantiated into assembly here
   11 | udot        v5.4s, v1.16b, v1.16b
      | ^
4 errors generated.
[10940/63891] aarch64-unknown-linux-gnu-clang++-18 -MD -MF obj/third_party/libyuv/libyuv_neon/rotate_neon.o.d</pre>



<p>Seems because some -march/-mcpu/-mtune drop &#8216;dotprod&#8217; parameters, it needs to add the extension manuall. &#8216;+dotprod&#8217;.</p>



<p>Edit the file /etc/portage/make.conf, and change the COMMON_FLAGS to </p>



<pre class="wp-block-preformatted">COMMON_FLAGS="-mcpu=neoverse-n1+crc+crypto+ssbs+dotprod -O2 -pipe"</pre>



<p>It can use the following command to get current CPU flag</p>



<pre class="wp-block-preformatted">gcc -v -E -x c /dev/null -o /dev/null -march=native -mcpu=native 2>&amp;1 | grep /cc1</pre>



<p>Thanks Gentoo user zukunf to provide those information. </p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/10/10/6052/gentoo-arm64-altra-compile-chromium-issue/">Gentoo ARM64 Altra Compile chromium Issue</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/10/10/6052/gentoo-arm64-altra-compile-chromium-issue/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>LLM Chat WebGUI and Fine-Turning on Ampere Altra ARM64 Platform</title>
		<link>https://blog.richliu.com/2024/03/10/5852/llm-chat-webgui-and-fine-turning-on-ampere-altra-arm64-platform/</link>
					<comments>https://blog.richliu.com/2024/03/10/5852/llm-chat-webgui-and-fine-turning-on-ampere-altra-arm64-platform/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sun, 10 Mar 2024 07:30:53 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[aarch64]]></category>
		<category><![CDATA[Altra]]></category>
		<category><![CDATA[arm64]]></category>
		<category><![CDATA[Fine-Tuning]]></category>
		<category><![CDATA[LLM]]></category>
		<category><![CDATA[Training]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=5852</guid>

					<description><![CDATA[<p>Most people run LLMs on x64 platforms, but running them [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/03/10/5852/llm-chat-webgui-and-fine-turning-on-ampere-altra-arm64-platform/">LLM Chat WebGUI and Fine-Turning 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[
<p>Most people run LLMs on x64 platforms, but running them on ARM64/aarch64 platforms is less common. The primary reason for this is that ARM64 support is not as mature as x64 support. Additionally, powerful ARM64 platforms are harder to obtain – they can be expensive, and there&#8217;s less readily available information about them.</p>



<p>Qualcomm&#8217;s new desktop SoCs might change this landscape. However, we can still leverage the Ampere Altra platform to run LLMs.</p>



<p>Since this is a personal blog, most articles here are my personal notes. I&#8217;ll keep them updated as my understanding evolves.</p>



<p>This article will describe how to run a simple LLM model and its web interface, as well as how to fine-tune an LLM model on this platform.</p>



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



<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>Table of Contents</h2><nav><ul><li><a href="#use-current-llm-model-with-gui">Use current LLM model with GUI</a><ul><li><a href="#big-llm">Big LLM </a></li></ul></li><li><a href="#open-webui">Open-Webui</a></li><li><a href="#llm-fine-turning-l-la-ma-factory">LLM Fine-Turning &#8211; LLaMA-Factory </a><ul><li><a href="#pre-training">Pre-Training</a></li><li><a href="#evaluate-predict">Evaluate &amp; Predict </a></li><li><a href="#test-chat-model">Test Chat Model</a></li><li><a href="#export-model">Export model</a></li></ul></li></ul></nav></div>



<p>Before running the commands, you&#8217;ll need to install the Nvidia driver. Refer to this article, &#8220;[<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>]&#8221;, for instructions on installing the Nvidia driver and Docker driver. </p>



<p>Ollama and Open-Webui don&#8217;t require a GPU. However, having a GPU is beneficial. Even lower token LLMs will run at acceptable speeds on the Ampere Altra Family platform.</p>



<p>This article&#8217;s hardware setup is as follows:</p>



<ul class="wp-block-list">
<li>CPU : Ampere Altra Family </li>



<li>Board: AsRock ALTRAD8UD </li>



<li>GPU: Nvidia RTX 4080</li>
</ul>



<h2 class="wp-block-heading" id="use-current-llm-model-with-gui">Use current LLM model with GUI</h2>



<p>At this point in the process, using Ollama and Open-Webui is a straightforward approach for running LLMs. Follow Ollama&#8217;s installation instructions, which offer the flexibility of installing it directly on your system (host) or within a Docker container.</p>



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



<p>By default, the Ollama service listens on localhost (127.0.0.1). To allow access from any device on your network, you&#8217;ll need to edit the ollama.service file.</p>



<p>In the [Service] section, add the following line:</p>



<pre class="wp-block-preformatted">Environment="OLLAMA_HOST=0.0.0.0:11434"</pre>



<p>For Open-Webui, we recommend using Docker for a simpler solution. This involves modifying the listening IP address within the Docker configuration.</p>



<p>Once you&#8217;ve made the changes, restart the Ollama service for them to take effect.</p>



<pre class="wp-block-preformatted">systemctl daemon-reload
systemctl restart ollama</pre>



<p>Run the ollama command and try it</p>



<pre class="wp-block-preformatted"># ollama run llama2
&gt;&gt;&gt; who are you

I'm LLaMA, an AI assistant developed by Meta AI that can understand and respond to human input in a conversational manner.
I'm here to help you with any questions or topics you'd like to discuss! Is there something specific you'd like to talk
about or ask?

&gt;&gt;&gt; </pre>



<p>If doesn&#8217;t work, try to restart ollama and try again. </p>



<h3 class="wp-block-heading" id="big-llm">Big LLM </h3>



<p>If choose some big LLM like LLaMA2-70b or Qwen </p>



<h2 class="wp-block-heading" id="open-webui">Open-Webui</h2>



<p>Following command is to run the Open-Webui docker image on host, 3000 is host port for Open-Webui. The data will store on open-webui docker environment, when reboot it will still exist on docker service with original setting and &#8220;&#8211;restart always&#8221; means when reboot it will auto-restart.</p>



<pre class="wp-block-preformatted">docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main</pre>



<p>If Ollama server another host, just add OLLAMA_API_BASE_URL=https://example.com/api to the docker command, </p>



<pre class="wp-block-preformatted">docker run -d -p 3000:8080 -e OLLAMA_API_BASE_URL=https://example.com/api -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main</pre>



<p>Upon login, you&#8217;ll need to provide an email and password. Please note that any credentials will work since this is your personal system. Once logged in, you can also edit the OLLAMA_API_BASE on the settings page.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1307" height="875" src="https://blog.richliu.com/wp-content/uploads/2024/03/image.png" alt="" class="wp-image-5853" srcset="https://blog.richliu.com/wp-content/uploads/2024/03/image.png 1307w, https://blog.richliu.com/wp-content/uploads/2024/03/image-600x402.png 600w, https://blog.richliu.com/wp-content/uploads/2024/03/image-768x514.png 768w, https://blog.richliu.com/wp-content/uploads/2024/03/image-816x546.png 816w" sizes="(max-width: 1307px) 100vw, 1307px" /></figure>



<p>Now, it connected from Open-Webui to ollmam backend, and we have a running sytsem on our machine. <br />Run sample chat here and choice llama2:latest as LLM model. </p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2205" height="761" src="https://blog.richliu.com/wp-content/uploads/2024/03/image-1.png" alt="" class="wp-image-5854" srcset="https://blog.richliu.com/wp-content/uploads/2024/03/image-1.png 2205w, https://blog.richliu.com/wp-content/uploads/2024/03/image-1-600x207.png 600w, https://blog.richliu.com/wp-content/uploads/2024/03/image-1-768x265.png 768w, https://blog.richliu.com/wp-content/uploads/2024/03/image-1-1536x530.png 1536w, https://blog.richliu.com/wp-content/uploads/2024/03/image-1-2048x707.png 2048w, https://blog.richliu.com/wp-content/uploads/2024/03/image-1-816x282.png 816w" sizes="(max-width: 2205px) 100vw, 2205px" /></figure>



<p></p>



<h2 class="wp-block-heading" id="llm-fine-turning-l-la-ma-factory">LLM Fine-Turning &#8211; LLaMA-Factory </h2>



<p>Fine-tuning LLMs ideally requires a GPU card for better performance. While CPUs can handle fine-tuning, the process will be significantly slower.</p>



<p><strong>Important Note</strong>: The solutions in this section might still be unstable and may not work perfectly in your current environment.</p>



<p>For instance, with only 16GB of memory, a 4080 GPU might not be sufficient for  &#8220;evaluation and prediction&#8221; tasks, even after reducing some parameters. This still can lead to CUDA out-of-memory errors.</p>



<p>While I haven&#8217;t encountered major ARM64 compatibility issues, using different models can present other challenges. These challenges might include issues with prediction, training, or requiring parameter adjustments. Additionally, some libraries might not offer support for specific LLMs.</p>



<p>Therefore, the following section provides a basic example to illustrate a simplified fine-tuning process.</p>



<p>For fine-tuning solutions, we&#8217;ve chosen <a href="https://github.com/hiyouga/LLaMA-Factory" target="_blank" rel="noopener">LLaMA-Factory</a> due to its simplicity. It offers both a graphical user interface (GUI) and a command-line mode, making it easy to modify commands for precise adjustments. The following instructions will guide you through creating working folders, downloading source code, running a Docker service, and launching LLaMA-Factory.</p>



<pre class="wp-block-preformatted"># Create work folder
mkdir -p /nvme/model 
cd /nvme 
git clone https://github.com/hiyouga/LLaMA-Factory.git

# Run docker, it will use host GPU and map the folder into docker.
sudo docker run --gpus all --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 -it --rm \
     -v /nvme:/nvme \
     -p 7860:7860 \
     nvcr.io/nvidia/pytorch:24.01-py3

# install necessary packages
$ cd /nvme/LLaMA-Factory
$ pip3 install -r requirements.txt
$ pip3 install tiktoken transformers_stream_generator

# run the LLaMA-Factory
$ CUDA_VISIBLE_DEVICES=0 python src/train_web.py</pre>



<p>Now, it can acces the webgui via http://host IP:7860.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1506" height="857" src="https://blog.richliu.com/wp-content/uploads/2024/03/image-2.png" alt="" class="wp-image-5855" srcset="https://blog.richliu.com/wp-content/uploads/2024/03/image-2.png 1506w, https://blog.richliu.com/wp-content/uploads/2024/03/image-2-600x341.png 600w, https://blog.richliu.com/wp-content/uploads/2024/03/image-2-768x437.png 768w, https://blog.richliu.com/wp-content/uploads/2024/03/image-2-816x464.png 816w" sizes="(max-width: 1506px) 100vw, 1506px" /></figure>



<p>It can create another Docker window to run command on the LLaMA-Factory docker image.</p>



<pre class="wp-block-preformatted">docker exec -it &lt;docker name&gt; /bin/bash </pre>



<p>for download LLMs, you need to use git download from huggingface, ex: </p>



<pre class="wp-block-preformatted"># LLama 2 need username and token(not passowrd) to download it. 
git clone https://huggingface.co/meta-llama/Llama-2-7b-hf

# Qwen
git clone https://huggingface.co/Qwen/Qwen1.5-1.8B-Chat
git clone https://huggingface.co/Qwen/Qwen1.5-1.8B</pre>



<h3 class="wp-block-heading" id="pre-training">Pre-Training</h3>



<p>Model name, choice the LLMs name , like Qwen1.5-1.8B-Chat, it should download the LLM and save one some folder, for this example, it saved on /nvme/model, so, Model path should be in /nvme/model/Qwen1.5-1.8B-Chat. </p>



<p>First time, I suggest to use small LLM for fine-tuning, Qweb1.5-0.8B might have issue, will suggest from 1.5-1.8B to start. </p>



<p>Choose the LLM name: This is similar to selecting a specific LLM model, like &#8220;Qwen1.5-1.8B-Chat&#8221;. The instructions will indicate your LLM folder. For this example, the model would be saved in /nvme/model/Qwen1.5-1.8B-Chat.</p>



<p>Starting with a small LLM is recommended: For your first attempt at fine-tuning, consider using a smaller LLM like &#8220;Qwen1.5-1.8B&#8221;. It&#8217;s possible that &#8220;Qweb1.5-0.8B&#8221; might cause issues, so we recommend starting with models in the 1.5-1.8B range.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1822" height="1206" src="https://blog.richliu.com/wp-content/uploads/2024/03/image-3.png" alt="" class="wp-image-5856" srcset="https://blog.richliu.com/wp-content/uploads/2024/03/image-3.png 1822w, https://blog.richliu.com/wp-content/uploads/2024/03/image-3-600x397.png 600w, https://blog.richliu.com/wp-content/uploads/2024/03/image-3-768x508.png 768w, https://blog.richliu.com/wp-content/uploads/2024/03/image-3-1536x1017.png 1536w, https://blog.richliu.com/wp-content/uploads/2024/03/image-3-816x540.png 816w" sizes="(max-width: 1822px) 100vw, 1822px" /></figure>



<p>Here are the fine-tuning options you can adjust in LLaMA-Factory:</p>



<p><strong>Dataset</strong>: You can add datasets to this mode. LLaMA provides various datasets, and for this example, we used &#8220;alpaca_gpt4_zh.&#8221;<br /><strong>Gradient accumulation</strong>: This is currently set to 4.<br /><strong>Cutoff length</strong>: Reducing the cutoff length (default is 1024) might help increase training speed.<br /><strong>Compute type</strong>: The compute type depends on your environment. In this case, fp16 works, but bp16 doesn&#8217;t sometimes.<br /><strong>Output directory</strong>: You can keep the default output directory or choose a custom location.<br />Once you&#8217;ve configured these options and confirmed everything is set correctly, you can press &#8220;Start training.&#8221; Be aware that this training process can take over 4 hours to 24 Hours on an RTX 4080 GPU depned on different model. </p>



<h3 class="wp-block-heading" id="evaluate-predict">Evaluate &amp; Predict </h3>



<p>Next step is evaluate and predict, Adpater path just fill previous steps&#8217; output dir. Dataset is the same. </p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2059" height="1207" src="https://blog.richliu.com/wp-content/uploads/2024/03/image-4.png" alt="" class="wp-image-5857" srcset="https://blog.richliu.com/wp-content/uploads/2024/03/image-4.png 2059w, https://blog.richliu.com/wp-content/uploads/2024/03/image-4-600x352.png 600w, https://blog.richliu.com/wp-content/uploads/2024/03/image-4-768x450.png 768w, https://blog.richliu.com/wp-content/uploads/2024/03/image-4-1536x900.png 1536w, https://blog.richliu.com/wp-content/uploads/2024/03/image-4-2048x1201.png 2048w, https://blog.richliu.com/wp-content/uploads/2024/03/image-4-816x478.png 816w" sizes="(max-width: 2059px) 100vw, 2059px" /></figure>



<p>When everything is ready, press Start. Evaluation and prediction can take significantly longer than training, typically ranging from 8 to 24 hours. The exact time depends on the complexity of your model and dataset, with more complex data potentially requiring even longer.</p>



<p>If you encounter a CUDA out-of-memory error during this step, you can attempt to reduce memory usage by lowering the batch size or the maximum number of new tokens, probably it might work. [<a href="https://github.com/hiyouga/LLaMA-Factory/issues/1191" target="_blank" rel="noopener">ref</a>]</p>



<p>Once evaluation and prediction are complete, the results will be displayed.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2008" height="304" src="https://blog.richliu.com/wp-content/uploads/2024/03/image-5.png" alt="" class="wp-image-5858" srcset="https://blog.richliu.com/wp-content/uploads/2024/03/image-5.png 2008w, https://blog.richliu.com/wp-content/uploads/2024/03/image-5-600x91.png 600w, https://blog.richliu.com/wp-content/uploads/2024/03/image-5-768x116.png 768w, https://blog.richliu.com/wp-content/uploads/2024/03/image-5-1536x233.png 1536w, https://blog.richliu.com/wp-content/uploads/2024/03/image-5-816x124.png 816w" sizes="(max-width: 2008px) 100vw, 2008px" /></figure>



<h3 class="wp-block-heading" id="test-chat-model">Test Chat Model</h3>



<p>You can test chat result by load module. </p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2077" height="1043" src="https://blog.richliu.com/wp-content/uploads/2024/03/image-6.png" alt="" class="wp-image-5859" srcset="https://blog.richliu.com/wp-content/uploads/2024/03/image-6.png 2077w, https://blog.richliu.com/wp-content/uploads/2024/03/image-6-600x301.png 600w, https://blog.richliu.com/wp-content/uploads/2024/03/image-6-768x386.png 768w, https://blog.richliu.com/wp-content/uploads/2024/03/image-6-1536x771.png 1536w, https://blog.richliu.com/wp-content/uploads/2024/03/image-6-2048x1028.png 2048w, https://blog.richliu.com/wp-content/uploads/2024/03/image-6-816x410.png 816w, https://blog.richliu.com/wp-content/uploads/2024/03/image-6-400x200.png 400w" sizes="(max-width: 2077px) 100vw, 2077px" /></figure>



<h3 class="wp-block-heading" id="export-model">Export model</h3>



<p>Remember to fill export dir, in here I used &#8220;/nvme/newmodel/Qwen1.5-1.8B-Chat&#8221;</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2077" height="1030" src="https://blog.richliu.com/wp-content/uploads/2024/03/image-7.png" alt="" class="wp-image-5860" srcset="https://blog.richliu.com/wp-content/uploads/2024/03/image-7.png 2077w, https://blog.richliu.com/wp-content/uploads/2024/03/image-7-600x298.png 600w, https://blog.richliu.com/wp-content/uploads/2024/03/image-7-768x381.png 768w, https://blog.richliu.com/wp-content/uploads/2024/03/image-7-1536x762.png 1536w, https://blog.richliu.com/wp-content/uploads/2024/03/image-7-2048x1016.png 2048w, https://blog.richliu.com/wp-content/uploads/2024/03/image-7-816x405.png 816w" sizes="(max-width: 2077px) 100vw, 2077px" /></figure>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained">
<p>Currently, there is a bug reported when using <code>convert.py</code> to convert the Qwen model to gguf format [<a href="https://github.com/QwenLM/Qwen1.5/issues/57" target="_blank" rel="noopener">ref</a>]</p>



<p>It&#8217;s recommended to use&nbsp;<code>convert-hf-to-gguf.py</code>&nbsp;for model conversion, ex:</p>
</div></div>



<pre class="wp-block-preformatted">cd /nvme/newmodel 
python3 /nvme/llama.cpp/convert-hf-to-gguf.py Qwen1.5-1.8B-Chat --outfile test.gguf

# Use llama.cpp to test this model 
/nvme/llama.cpp/build/bin/main -m test.gguf -p "who are you?"

# Command mode
/nvme/llama.cpp/build/bin/main -m test.gguf -ins
</pre>



<p>Create a file named &#8220;Modelfile&#8221;, and fill this</p>



<pre class="wp-block-preformatted">FROM /nvme/newmodel/test.gguf</pre>



<p>Now, run ollama to include this LLM. </p>



<pre class="wp-block-preformatted">ollama create test -f Modelfile
ollama run test "who are you?"
====
 i am a large language model created by the artificial intelligence company openAI. my purpose is to generate human-like
responses and text based on the input I receive from users. can I help you with anything today? #openai

#chatbot
Sure, I'm here to assist you! How can I help you today? Is there something specific you'd like to talk about or ask me?
#openaiChatBot不断地尝试。 #AI #MachineLearning
</pre>



<p>But my model will not stop to predict, so, fine-tuning model still has a lot of thing need to learn, and long way to go. </p>



<p>To be continue. </p>



<p></p>



<p></p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/03/10/5852/llm-chat-webgui-and-fine-turning-on-ampere-altra-arm64-platform/">LLM Chat WebGUI and Fine-Turning 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/03/10/5852/llm-chat-webgui-and-fine-turning-on-ampere-altra-arm64-platform/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>
		<item>
		<title>Install ARM64 Windows 11 on ARM64 QEMU System</title>
		<link>https://blog.richliu.com/2024/02/03/5752/install-arm64-windows-11-on-arm64-qemu-system/</link>
					<comments>https://blog.richliu.com/2024/02/03/5752/install-arm64-windows-11-on-arm64-qemu-system/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sat, 03 Feb 2024 03:58:49 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Altra]]></category>
		<category><![CDATA[arm64]]></category>
		<category><![CDATA[qemu]]></category>
		<category><![CDATA[Windows 11]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=5752</guid>

					<description><![CDATA[<p>Chinese article version: 在 ARM64 QEMU System 上安裝 ARM64  [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/02/03/5752/install-arm64-windows-11-on-arm64-qemu-system/">Install ARM64 Windows 11 on ARM64 QEMU System</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="1338" height="921" src="https://blog.richliu.com/wp-content/uploads/2024/02/image.png" alt="" class="wp-image-5725" style="aspect-ratio:1.4527687296416938;width:279px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/image.png 1338w, https://blog.richliu.com/wp-content/uploads/2024/02/image-600x413.png 600w, https://blog.richliu.com/wp-content/uploads/2024/02/image-768x529.png 768w" sizes="(max-width: 1338px) 100vw, 1338px" /></figure></div>


<p>Chinese article version: <a href="https://blog.richliu.com/2024/02/02/5724/%e5%9c%a8-arm64-qemu-system-%e4%b8%8a%e5%ae%89%e8%a3%9d-arm64-windows-11/">在 ARM64 QEMU System 上安裝 ARM64 Windows 11</a></p>



<p>Nowadays, ARM64 systems have become relatively mature, and recently, Windows 11 for ARM64 can also be installed on these systems. Naturally, there are people who want to run it on QEMU. However, most articles on this topic are not well-organized.</p>



<p>Here, let&#8217;s document the things what I discoverd and need to be prepared.</p>



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



<h2 class="wp-block-heading">Preparations Hardware and Software</h2>



<p>1) System: Ampere Altra CPU<br />Small ARM64 dev boards like RPI4 or RPI5 should also work, but installing on them might not be necessary, because it only has limitation CPU power and Memory. A more cost-effective solution is to use Apple Mx series CPUs [<a href="https://gist.github.com/CombinedEffort/bb7ffd950692f80a42f0400bd9c10ac3" target="_blank" rel="noopener">ref</a>], as they are also ARM64, and many people purchase them for installing Linux.</p>



<p>2) ARM64 ISO Image <br />While there are numerous options available on internet, for a relatively legal acquisition of the ISO image, it is recommended to use <a href="https://github.com/richliu/Windows-11-On-Ampere" target="_blank" rel="noopener">Windows-11-On-Ampere</a><br />This step can be a bit complex, but the key is to use UUP Dump to fetch the Windows ISO and then use Rufus to burn it onto a USB Flash drive. During the burning process, Rufus can override some of the restrictions of Windows 11, such as TPM Support, which may not be fully supported on ARM64 CPUs.</p>



<p>3) Windows Virtio Driver </p>



<p>Download the Windows Virtio driver and place it into the USB Disk that was created in the previous step. </p>



<p>Here has download URL can download the Windows virtio driver : <a href="https://pve.proxmox.com/wiki/Windows_VirtIO_Drivers#Using_the_ISO" target="_blank" rel="noopener">Proxmox Windows VirtIO Drivers</a>, alternative download website: &nbsp;<a href="https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso" target="_blank" rel="noopener">download the latest stable</a> or &nbsp;<a href="https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/virtio-win.iso" target="_blank" rel="noopener">download the most recent</a>. <br />After downloading, extract the ISO contents and place them onto the USB Disk.</p>



<p>4) Convert USB Dump to Image <br />Linux users are likely familiar with this step.</p>



<pre class="wp-block-preformatted">dd if=/dev/sda of=/storage/Win11_ARM64_INSTALL.img</pre>



<p><br />Why go through these steps? The primary reason is that within QEMU, it seems Windows cannot simultaneously configure two ISO devices. I encountered a freeze when attempting to install using the straightforward method. Hence, I went through this elaborate process to make it install smoothly.</p>



<p>5) virt-manager <br />Most examples available to others involve pure QEMU commands. However, this time, I wanted to avoid typing a bunch of commands and preferred a more user-friendly approach. Therefore, the examples provided here utilize virt-manager. Nonetheless, I believe the underlying logic is the same.</p>



<h2 class="wp-block-heading">New Virtual Machine on QEMU</h2>


<div class="wp-block-image">
<figure class="alignright size-full is-resized"><img loading="lazy" decoding="async" width="453" height="515" src="https://blog.richliu.com/wp-content/uploads/2024/02/image-1.png" alt="" class="wp-image-5726" style="aspect-ratio:0.8796116504854369;width:289px;height:auto"/></figure></div>


<p>Virt Type: KVM<br />Architecutre: aarch64 <br />Machine Type: virt </p>



<p>Next step, choice the ISO image we just created Win11_ARM64_INSTALL.img, Choose &#8220;the operaion system you are installing:  Microsoft Windows 11&#8221;</p>



<p>For the CPU and memory, I used 16 cores and 16GB, which should be sufficient. A smaller combination might work, but I haven&#8217;t tested it because I&#8217;m too lazy to do so.</p>



<p>It&#8217;s recommended to set up the Disk Image manually, virt-manager tends to allocate the entire specified disk space right from the start, which may not be space-efficient. Windows 11, with its minimum space requirement of 52GB, can be allocated around 60GB or more based on your needs. Here is example command to pre-create qemu image. </p>



<p>qemu-img create -f qcow2 MyImage.qcow2 60G</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="463" height="450" src="https://blog.richliu.com/wp-content/uploads/2024/02/image-2.png" alt="" class="wp-image-5727" style="aspect-ratio:1.028888888888889;width:290px;height:auto"/></figure></div>


<p>Before executing, choose &#8220;Customize configuration before install.&#8221; There are certain adjustments to make. Remember to enable the XML editing feature within virt-manager beforehand. Go to the main program, select Edit -&gt; Preferences -&gt; Enable XML editing, and ensure it is checked.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="512" height="339" src="https://blog.richliu.com/wp-content/uploads/2024/02/image-4.png" alt="" class="wp-image-5729" style="aspect-ratio:1.5103244837758112;width:288px;height:auto"/></figure></div>


<p><br />In the XML section related to CPUs, locate the segment pertaining to &#8216;hyperv,&#8217; and modify it with the following settings:</p>



<pre class="wp-block-preformatted">    &lt;hyperv mode="custom"&gt;
      &lt;relaxed state="off"/&gt;
      &lt;vapic state="off"/&gt;
      &lt;spinlocks state="off"/&gt;
    &lt;/hyperv&gt;</pre>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="896" height="604" src="https://blog.richliu.com/wp-content/uploads/2024/02/image-3.png" alt="" class="wp-image-5728" style="aspect-ratio:1.4834437086092715;width:520px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/image-3.png 896w, https://blog.richliu.com/wp-content/uploads/2024/02/image-3-600x404.png 600w, https://blog.richliu.com/wp-content/uploads/2024/02/image-3-768x518.png 768w" sizes="(max-width: 896px) 100vw, 896px" /></figure></div>


<p>In the CPU section, change the quantity from &#8216;sockets&#8217; to &#8216;cores.&#8217; Below is an example for 16 cores:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="439" height="438" src="https://blog.richliu.com/wp-content/uploads/2024/02/image-8.png" alt="" class="wp-image-5733" style="aspect-ratio:1.0022831050228311;width:311px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/image-8.png 439w, https://blog.richliu.com/wp-content/uploads/2024/02/image-8-300x300.png 300w" sizes="(max-width: 439px) 100vw, 439px" /></figure></div>


<p>Add those hardware setting into current configuration: <br />Input -&gt; USB Keyboard<br />Input -&gt; EvTouch USB Graphics Tablet <br />Graphics -&gt; Spice server<br />Video -&gt; Ramfb </p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="550" height="624" data-id="5735" src="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_1.png" alt="" class="wp-image-5735" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_1.png 550w, https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_1-529x600.png 529w" sizes="(max-width: 550px) 100vw, 550px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="550" height="622" data-id="5736" src="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_2.png" alt="" class="wp-image-5736" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_2.png 550w, https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_2-531x600.png 531w" sizes="(max-width: 550px) 100vw, 550px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="553" height="624" data-id="5737" src="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_3.png" alt="" class="wp-image-5737" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_3.png 553w, https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_3-532x600.png 532w" sizes="(max-width: 553px) 100vw, 553px" /></figure>
</figure>



<p><br /><br /><br />For the Video option, it is essential to choose Ramfb; otherwise, the graphics might not display properly. QXL or Virtio should not be used. Virtio-gpu-pci hasn&#8217;t been tested, but some suggest it might work[<a href="https://github.com/utmapp/UTM/issues/3293" target="_blank" rel="noopener">ref</a>].</p>



<p>Lastly, in Storage, add a USB CDROM device and set it up with the Win11_ARM64_INSTALL.img file you created earlier.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="600" height="646" src="https://blog.richliu.com/wp-content/uploads/2024/02/image-6.png" alt="" class="wp-image-5731" style="aspect-ratio:0.9287925696594427;width:276px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/image-6.png 600w, https://blog.richliu.com/wp-content/uploads/2024/02/image-6-557x600.png 557w" sizes="(max-width: 600px) 100vw, 600px" /></figure></div>


<p>In the Boot Options section, enable the option for USB CDROM 1, and then you should be ready to boot.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="646" height="597" src="https://blog.richliu.com/wp-content/uploads/2024/02/image-7.png" alt="" class="wp-image-5732" style="aspect-ratio:1.082077051926298;width:388px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/image-7.png 646w, https://blog.richliu.com/wp-content/uploads/2024/02/image-7-600x554.png 600w" sizes="(max-width: 646px) 100vw, 646px" /></figure></div>


<p>If the configuration is correct, you should be able to boot to this screen successfully.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="1246" height="935" src="https://blog.richliu.com/wp-content/uploads/2024/02/image-9.png" alt="" class="wp-image-5734" style="aspect-ratio:1.3326203208556149;width:616px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/image-9.png 1246w, https://blog.richliu.com/wp-content/uploads/2024/02/image-9-600x450.png 600w, https://blog.richliu.com/wp-content/uploads/2024/02/image-9-768x576.png 768w" sizes="(max-width: 1246px) 100vw, 1246px" /></figure></div>


<p><br />If following the above steps results in a hang during the installation process, you can try adjusting the boot options by changing the boot order. Try setting &#8220;disk&#8221; first and &#8220;USB CD ROM&#8221; second.</p>



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



<p>Under normal circumstances, Windows might not detect the disk. In such cases, select &#8220;Load driver&#8221; -&gt; &#8220;25982_1000_ARM64_EN-US(C:)&#8221; -&gt; &#8220;Virtio-driver&#8221; -&gt; &#8220;viostor&#8221; -&gt; &#8220;win11&#8221; -&gt; &#8220;ARM64&#8221; (Note: The labels and directories here may vary based on different configurations).</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="927" height="693" src="https://blog.richliu.com/wp-content/uploads/2024/02/image-10.png" alt="" class="wp-image-5739" style="aspect-ratio:1.3376623376623376;width:495px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/image-10.png 927w, https://blog.richliu.com/wp-content/uploads/2024/02/image-10-600x449.png 600w, https://blog.richliu.com/wp-content/uploads/2024/02/image-10-768x574.png 768w" sizes="(max-width: 927px) 100vw, 927px" /></figure></div>


<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1116" height="693" data-id="5740" src="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_5.png" alt="" class="wp-image-5740" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_5.png 1116w, https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_5-600x373.png 600w, https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_5-768x477.png 768w" sizes="(max-width: 1116px) 100vw, 1116px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="931" height="693" data-id="5741" src="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_6.png" alt="" class="wp-image-5741" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_6.png 931w, https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_6-600x447.png 600w, https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_6-768x572.png 768w" sizes="(max-width: 931px) 100vw, 931px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="928" height="693" data-id="5742" src="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_7.png" alt="" class="wp-image-5742" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_7.png 928w, https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_7-600x448.png 600w, https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_7-768x574.png 768w" sizes="(max-width: 928px) 100vw, 928px" /></figure>
</figure>



<p>In the final step, for the NIC driver, when prompted to connect to the network upon the initial entry into Windows 11, select &#8220;Install driver&#8221; -&gt; &#8220;25982_1000_ARM64_EN-US(D:)&#8221; -&gt; &#8220;Virtio-driver&#8221; -&gt; &#8220;NetKVM&#8221; -&gt; &#8220;win11&#8221; -&gt; &#8220;ARM64&#8221;.</p>



<p>With this, you should have successfully completed the installation of Windows 11.</p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-3 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1047" height="715" data-id="5743" src="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_8.png" alt="" class="wp-image-5743" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_8.png 1047w, https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_8-600x410.png 600w, https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_8-768x524.png 768w" sizes="(max-width: 1047px) 100vw, 1047px" /></figure>



<figure class="wp-block-image size-large"><img decoding="async" data-id="5744" src="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_9.png" alt="" class="wp-image-5744"/></figure>
</figure>



<p>Happy Playing Windows 11 on ARM64 Qemu </p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1175" height="874" src="https://blog.richliu.com/wp-content/uploads/2024/02/image-11.png" alt="" class="wp-image-5745" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/image-11.png 1175w, https://blog.richliu.com/wp-content/uploads/2024/02/image-11-600x446.png 600w, https://blog.richliu.com/wp-content/uploads/2024/02/image-11-768x571.png 768w" sizes="(max-width: 1175px) 100vw, 1175px" /></figure>



<p>ref.<br /><a href="https://github.com/virtio-win/virtio-win-pkg-scripts" target="_blank" rel="noopener">virtio-win / virtio-win-pkg-scripts</a><br /></p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/02/03/5752/install-arm64-windows-11-on-arm64-qemu-system/">Install ARM64 Windows 11 on ARM64 QEMU System</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/03/5752/install-arm64-windows-11-on-arm64-qemu-system/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>在 ARM64 QEMU System 上安裝 ARM64 Windows 11</title>
		<link>https://blog.richliu.com/2024/02/02/5724/%e5%9c%a8-arm64-qemu-system-%e4%b8%8a%e5%ae%89%e8%a3%9d-arm64-windows-11/</link>
					<comments>https://blog.richliu.com/2024/02/02/5724/%e5%9c%a8-arm64-qemu-system-%e4%b8%8a%e5%ae%89%e8%a3%9d-arm64-windows-11/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Fri, 02 Feb 2024 15:59:28 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Altra]]></category>
		<category><![CDATA[Ampere]]></category>
		<category><![CDATA[arm64]]></category>
		<category><![CDATA[qemu]]></category>
		<category><![CDATA[Windows 11]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=5724</guid>

					<description><![CDATA[<p>Install ARM64 Windows 11 on ARM64 QEMU system</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/02/02/5724/%e5%9c%a8-arm64-qemu-system-%e4%b8%8a%e5%ae%89%e8%a3%9d-arm64-windows-11/">在 ARM64 QEMU System 上安裝 ARM64 Windows 11</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="1338" height="921" src="https://blog.richliu.com/wp-content/uploads/2024/02/image.png" alt="" class="wp-image-5725" style="aspect-ratio:1.4527687296416938;width:279px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/image.png 1338w, https://blog.richliu.com/wp-content/uploads/2024/02/image-600x413.png 600w, https://blog.richliu.com/wp-content/uploads/2024/02/image-768x529.png 768w" sizes="(max-width: 1338px) 100vw, 1338px" /></figure></div>


<p>English please see : <a href="https://blog.richliu.com/2024/02/03/5752/install-arm64-windows-11-on-arm64-qemu-system/(在新分頁中開啟)">Install ARM64 Windows 11 on ARM64 QEMU System</a></p>



<p>現在 ARM64 的系統相對成熟了，最近 Windows 11 for ARM64 也可以在系統上安裝，自然也會有人想弄到 QEMU 上去，不過看來看去，大部份都沒有整理完畢的文章</p>



<p>這邊記錄一下需要準備的東西</p>



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



<h2 class="wp-block-heading">準備</h2>



<p>1) 系統：Ampere Altra CPU <br />RPI4 or RPI5 這種開發板應該也可以，因為這些板子只有有限的 CPU Power 和記憶體，就沒有安裝 qemu 的必要性，便宜一點的解決方案就是 Apple Mx 系列的 CPU [<a href="https://gist.github.com/CombinedEffort/bb7ffd950692f80a42f0400bd9c10ac3" target="_blank" rel="noopener">ref</a>]，因為也是 ARM64 ，而且很多人也是買來安裝 Linux</p>



<p>2) ARM64 ISO Image <br />網路上應該很多，不過如果要相對合法取得 ISO image ，推薦 <a href="https://github.com/richliu/Windows-11-On-Ampere" target="_blank" rel="noopener">Windows-11-On-Ampere</a><br />這步驟有點複雜，不過重點是用 UUP Dump 抓回 Windows ISO ，然後用 Rufus 燒到 USB Flash ，在燒錄的時候 Rufus 可以解除一些 Windows 11 的限制，像是 TPM Support 等等這些在 ARM64 CPU 還不完全支援的設定</p>



<p>3) Windows Virtio Driver </p>



<p>下載 Windows virtio driver，然後放進去剛剛那一步做到的 USB Disk </p>



<p><a href="https://pve.proxmox.com/wiki/Windows_VirtIO_Drivers#Using_the_ISO" target="_blank" rel="noopener">Proxmox Windows VirtIO Drivers</a> 這邊有下載點，&nbsp;<a href="https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso" target="_blank" rel="noopener">download the latest stable</a> or &nbsp;<a href="https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/virtio-win.iso" target="_blank" rel="noopener">download the most recent</a>&nbsp;，都可以下載到 VirtIO ISO，下載完將 ISO 解開放到 USB Disk </p>



<p>4) 將 USB Dump 成 Image <br />Linux user 應該很熟這個步驟</p>



<pre class="wp-block-preformatted">dd if=/dev/sda of=/storage/Win11_ARM64_INSTALL.img</pre>



<p>為什麼要這樣做？最大的原因就是 QEMU 內 Windows 現在似乎沒辦法同時設定二個 ISO 設備，我之前這樣裝會卡住。所以就繞了一大串讓它可以裝，還可以吧</p>



<p>5) virt-manager <br />其他人能找到的範例都是 qemu command ，不過我這次實在是不想打一堆指令，只想點點點，所以這次的範例都是用 virt-manager ，不過我相信背後的思路都是一樣的</p>



<h2 class="wp-block-heading">New Virtual Machine </h2>


<div class="wp-block-image">
<figure class="alignright size-full is-resized"><img loading="lazy" decoding="async" width="453" height="515" src="https://blog.richliu.com/wp-content/uploads/2024/02/image-1.png" alt="" class="wp-image-5726" style="aspect-ratio:0.8796116504854369;width:289px;height:auto"/></figure></div>


<p>Virt Type: KVM<br />Architecutre: aarch64 <br />Machine Type: virt </p>



<p>下一步，ISO image 選剛剛做好的 Win11_ARM64_INSTALL.img，Choose the operaion system you are installing: 選 Microsoft Windows 11</p>



<p>CPU 和記憶體我用 16 cores 和 16GB，小一點應該也可以，不過我懶得試了</p>



<p>如果空間不夠，Disk Image 建議自己設定，virt-manager 設定會一開始就 allocate 設定的 disk space ，不省空間，Windows 11 最小需求空間是 52G ，可以設 60G 或是更大，看需求<br />這邊是範例命令，可以預先建好硬碟空間</p>



<p>qemu-img create -f qcow2 MyImage.qcow2 60G</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="463" height="450" src="https://blog.richliu.com/wp-content/uploads/2024/02/image-2.png" alt="" class="wp-image-5727" style="aspect-ratio:1.028888888888889;width:290px;height:auto"/></figure></div>


<p>在執行之前選擇 Customize configuration before install，有些東西要修改，記得要先開啟 virt-manager 內的 XML 修改功能，在主程式下的 Edit -&gt; Perferences -&gt; Enable XML editing ，請勾選</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="512" height="339" src="https://blog.richliu.com/wp-content/uploads/2024/02/image-4.png" alt="" class="wp-image-5729" style="aspect-ratio:1.5103244837758112;width:288px;height:auto"/></figure></div>


<p>在 CPUs 的 XML 這一段，找到 hyperv 這一段，改成如下的設定</p>



<pre class="wp-block-preformatted">    &lt;hyperv mode="custom"&gt;
      &lt;relaxed state="off"/&gt;
      &lt;vapic state="off"/&gt;
      &lt;spinlocks state="off"/&gt;
    &lt;/hyperv&gt;</pre>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="896" height="604" src="https://blog.richliu.com/wp-content/uploads/2024/02/image-3.png" alt="" class="wp-image-5728" style="aspect-ratio:1.4834437086092715;width:520px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/image-3.png 896w, https://blog.richliu.com/wp-content/uploads/2024/02/image-3-600x404.png 600w, https://blog.richliu.com/wp-content/uploads/2024/02/image-3-768x518.png 768w" sizes="(max-width: 896px) 100vw, 896px" /></figure></div>


<p>在 CPU 數量，要從 sockets 改成 Cores，以下就是 16 Cores 的範例</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="439" height="438" src="https://blog.richliu.com/wp-content/uploads/2024/02/image-8.png" alt="" class="wp-image-5733" style="aspect-ratio:1.0022831050228311;width:311px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/image-8.png 439w, https://blog.richliu.com/wp-content/uploads/2024/02/image-8-300x300.png 300w" sizes="(max-width: 439px) 100vw, 439px" /></figure></div>


<p>Add hardware ，加入以下設定<br />Input -&gt; USB Keyboard<br />Input -&gt; EvTouch USB Graphics Tablet <br />Graphics -&gt; Spice server<br />Video -&gt; Ramfb </p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-4 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="550" height="624" data-id="5735" src="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_1.png" alt="" class="wp-image-5735" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_1.png 550w, https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_1-529x600.png 529w" sizes="(max-width: 550px) 100vw, 550px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="550" height="622" data-id="5736" src="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_2.png" alt="" class="wp-image-5736" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_2.png 550w, https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_2-531x600.png 531w" sizes="(max-width: 550px) 100vw, 550px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="553" height="624" data-id="5737" src="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_3.png" alt="" class="wp-image-5737" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_3.png 553w, https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_3-532x600.png 532w" sizes="(max-width: 553px) 100vw, 553px" /></figure>
</figure>



<p><br /><br />Video 選項一定要用 Ramfb ，否則 Graphics 會出不來，qxl or virtio 都不能用，virtio-gpu-pci 沒試過，有人說可以用[<a href="https://github.com/utmapp/UTM/issues/3293" target="_blank" rel="noopener">ref</a>]<br />最後是 Storage 增加 USB CDROM device，並且將剛剛的 Win11_ARM64_INSTALL.img  設定上去</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="600" height="646" src="https://blog.richliu.com/wp-content/uploads/2024/02/image-6.png" alt="" class="wp-image-5731" style="aspect-ratio:0.9287925696594427;width:276px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/image-6.png 600w, https://blog.richliu.com/wp-content/uploads/2024/02/image-6-557x600.png 557w" sizes="(max-width: 600px) 100vw, 600px" /></figure></div>


<p>在 Boot Options 這邊 enable USB CDROM 1的選項，然後就可以開機了</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="646" height="597" src="https://blog.richliu.com/wp-content/uploads/2024/02/image-7.png" alt="" class="wp-image-5732" style="aspect-ratio:1.082077051926298;width:388px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/image-7.png 646w, https://blog.richliu.com/wp-content/uploads/2024/02/image-7-600x554.png 600w" sizes="(max-width: 646px) 100vw, 646px" /></figure></div>


<p>如果設定正確，那就可以正常開機到這個畫面</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="1246" height="935" src="https://blog.richliu.com/wp-content/uploads/2024/02/image-9.png" alt="" class="wp-image-5734" style="aspect-ratio:1.3326203208556149;width:616px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/image-9.png 1246w, https://blog.richliu.com/wp-content/uploads/2024/02/image-9-600x450.png 600w, https://blog.richliu.com/wp-content/uploads/2024/02/image-9-768x576.png 768w" sizes="(max-width: 1246px) 100vw, 1246px" /></figure></div>


<p>如果照著以上步驟卻在安裝過程卡住了，可以試著調整 boot option 切換一下開機的順序<br />先 disk 後 USB CD ROM . </p>



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



<p>正常狀況下，Windows 是找不到 disk 的，要選 load driver -&gt; 25982_1000_ARM64_EN-US(C:) -&gt; Virtio-driver -&gt; viostor -&gt; win11 -&gt; ARM64   (註：這部份的標籤和目錄可能因不同的設定而異）</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="927" height="693" src="https://blog.richliu.com/wp-content/uploads/2024/02/image-10.png" alt="" class="wp-image-5739" style="aspect-ratio:1.3376623376623376;width:495px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/image-10.png 927w, https://blog.richliu.com/wp-content/uploads/2024/02/image-10-600x449.png 600w, https://blog.richliu.com/wp-content/uploads/2024/02/image-10-768x574.png 768w" sizes="(max-width: 927px) 100vw, 927px" /></figure></div>


<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-5 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1116" height="693" data-id="5740" src="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_5.png" alt="" class="wp-image-5740" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_5.png 1116w, https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_5-600x373.png 600w, https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_5-768x477.png 768w" sizes="(max-width: 1116px) 100vw, 1116px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="931" height="693" data-id="5741" src="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_6.png" alt="" class="wp-image-5741" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_6.png 931w, https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_6-600x447.png 600w, https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_6-768x572.png 768w" sizes="(max-width: 931px) 100vw, 931px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="928" height="693" data-id="5742" src="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_7.png" alt="" class="wp-image-5742" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_7.png 928w, https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_7-600x448.png 600w, https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_7-768x574.png 768w" sizes="(max-width: 928px) 100vw, 928px" /></figure>
</figure>



<p>最後一段，NIC driver ，在初次進入 Windows 11 時，要求要連線到網路時，選 Install driver -&gt; 25982_1000_ARM64_EN-US(D:) -&gt; Virtio-driver -&gt; NetKVM-&gt; win11 -&gt; ARM64</p>



<p>這樣就可以完成安裝 Windows 11 了</p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-6 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1047" height="715" data-id="5743" src="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_8.png" alt="" class="wp-image-5743" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_8.png 1047w, https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_8-600x410.png 600w, https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_8-768x524.png 768w" sizes="(max-width: 1047px) 100vw, 1047px" /></figure>



<figure class="wp-block-image size-large"><img decoding="async" data-id="5744" src="https://blog.richliu.com/wp-content/uploads/2024/02/windows11_qemu_9.png" alt="" class="wp-image-5744"/></figure>
</figure>



<p>Happy Playing Windows 11 on ARM64 Qemu </p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1175" height="874" src="https://blog.richliu.com/wp-content/uploads/2024/02/image-11.png" alt="" class="wp-image-5745" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/image-11.png 1175w, https://blog.richliu.com/wp-content/uploads/2024/02/image-11-600x446.png 600w, https://blog.richliu.com/wp-content/uploads/2024/02/image-11-768x571.png 768w" sizes="(max-width: 1175px) 100vw, 1175px" /></figure>



<p>ref.<br /><a href="https://github.com/virtio-win/virtio-win-pkg-scripts" target="_blank" rel="noopener">virtio-win / virtio-win-pkg-scripts</a><br /></p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/02/02/5724/%e5%9c%a8-arm64-qemu-system-%e4%b8%8a%e5%ae%89%e8%a3%9d-arm64-windows-11/">在 ARM64 QEMU System 上安裝 ARM64 Windows 11</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/02/5724/%e5%9c%a8-arm64-qemu-system-%e4%b8%8a%e5%ae%89%e8%a3%9d-arm64-windows-11/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Ampere Altra/AltraMax AsRock ALTRAD8UD-1L2T Liquid Cooling System</title>
		<link>https://blog.richliu.com/2024/01/09/5471/ampere-altra-altramax-asrock-altrad8ud-1l2t-liquid-cooling-system/</link>
					<comments>https://blog.richliu.com/2024/01/09/5471/ampere-altra-altramax-asrock-altrad8ud-1l2t-liquid-cooling-system/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Tue, 09 Jan 2024 03:20:34 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Altra]]></category>
		<category><![CDATA[AltraMax]]></category>
		<category><![CDATA[Ampere]]></category>
		<category><![CDATA[arm64]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=5471</guid>

					<description><![CDATA[<p>Chinese version Article is here (Ampere Altra/AltraMax  [&#8230;]</p>
<p>The post <a rel="nofollow" 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> 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="1920" src="https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-scaled.jpg" alt="" class="wp-image-5462" style="aspect-ratio:1.3333333333333333;width:224px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-scaled.jpg 2560w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-600x450.jpg 600w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-768x576.jpg 768w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-1536x1152.jpg 1536w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-2048x1536.jpg 2048w" sizes="(max-width: 2560px) 100vw, 2560px" /></figure></div>


<p>Chinese version Article is <a href="ttps://blog.richliu.com/2024/01/09/5446/ampere-altra-altramax-加asrock-altrad8ud-1l2t-水冷方案/">here (Ampere Altra/AltraMax 加AsRock ALTRAD8UD-1L2T 水冷方案)</a><br />2024/01<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">/31 Update: Ampere will have 2U passive cooler Making Arm Desktops Viable Ampere Altra Noctua NH-D9 AMP-4926 4U and NH-U14S AMP-4926</a></p>



<p>The Ampere Altra/AltraMax CPU features a maximum of 128 ARM64 cores, typically found in cloud server. However, cloud server Care not suitable for placement in offices or homes due to the high-speed fans used for heat dissipation. The noise generated by these fans is generally intolerable for regular users. Additionally, adapting server motherboards to standard consumer motherboards is inconvenient. If there is a desire to utilize such a CPU in a different setting, the <a href="https://www.adlinktech.com/products/Computer_on_Modules/COM-HPC-Server-Carrier-and-Starter-Kit/Ampere_Altra_Developer_Platform?lang=en" target="_blank" rel="noopener">ADLink Ampere Altra Dev Platform</a> presents a viable solution, complete with the option for liquid cooling.</p>



<p>Another solution is the <a href="https://www.newegg.com/p/N82E16813140134" target="_blank" rel="noopener">AsRock ALTRAD8UD-1L2T</a>, currently available on <a href="https://www.newegg.com/p/N82E16813140134" target="_blank" rel="noopener">Newegg</a>. Paired with an Ampere Altra Q64-22 CPU (64 cores, 2.2GHz), it comes with a complimentary 2U passive heatsink, priced at US$1,500, which can be considered affordable. However, it&#8217;s worth noting that the included heatsink is passive. If you prefer liquid cooling over installing a fan on the passive heatsink, then this article is the right guide for you.</p>



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



<p><br />The author have adding a declaration at the beginning of articles that may pose potential risks:</p>



<ul class="wp-block-list">
<li>This article is not an official endorsement by Ampere, Newegg, or any other mentioned merchants or vendors. It is solely a personal record.</li>



<li>The author has a business relationship related to the production of the mentioned motherboard.</li>



<li>The author is a first-time to use liquid cooling computer system , and the content may not be entirely accurate. Please be aware of potential risks.</li>



<li>This article is not an official document from Ampere or AsRock.</li>



<li>The original article is in Chinese, and the English translation is done using machine translation. Please forgive any inaccuracies in wording.</li>



<li><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">I am not responsible for any consequences resulting from this article; for example, losses incurred due to improper implementation of instructions provided in this article.</mark></li>
</ul>



<p>The Ampere system primarily focuses on Cloud-native CPUs, and as of now, there is no manufacturer producing general-purpose cooling systems for it. The included 2U passive heatsink in this system is designed for server use, utilizing high-speed server fans for heat dissipation. While the Q64-22 included by Newegg has lower power consumption, its only cooling method involves direct airflow from an electric fan. Alternatively, users may resort to attaching an 8-inch fan onto it. Such cooling solutions are deemed unacceptable for enthusiasts and professionals like myself.</p>



<p>If you intend to upgrade the cooling system, typical tower-type coolers require replacing the fixture on the back of the motherboard. Moreover, compatibility with the fastening mechanisms of this specific motherboard can be challenging to find. Considering that only front-facing screws can be used, the only viable cooling solution is a liquid cooling system. Therefore, I have been experimenting with a liquid cooling solution that works for this scenario. I&#8217;m sharing this information for those adventurous individuals who might encounter similar challenges, and perhaps this approach can inspire some creative solutions.</p>



<p>In the upcoming sections of this article, I will guide you on how to set up a liquid cooling system specifically tailored for the Ampere Altra on the ALTRAD8UD-1L2T motherboard. In theory, since the screw hole positions are the same, this method should be applicable to other Ampere motherboards as well. However, the focus of this content will primarily be on the ALTRAD8UD-1L2T. The article will also cover any pitfalls encountered during assembly and the items needed for the setup(Chinese website).</p>



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



<h3 class="wp-block-heading">ALTRAD8UD-1L2T</h3>



<p><br />You can find the specifications for this motherboard online, and I won&#8217;t repeat them here. However, what might confuse some people is the term &#8220;Deep mATX.&#8221; This is a specification unique to AsRock, where they increase the depth dimension of the mATX form factor while maintaining the standard width. The purpose is to provide more space to accommodate additional components. This particular specification is commonly seen in AsRock&#8217;s server-grade motherboards.</p>



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



<p>Generally, most computer cases should work. However, I made a mistake on my end by choosing a case that was too small. The case I purchased is the Antec P110 Silent. While it has liquid cooling mounting points, it is not suitable for adding a liquid cooling system. The internal space is too limited, lacking a designated area for securing the water pump. Additionally, the Antec P110 liquid cooling radiator cannot be placed at the top as it interferes with the motherboard. Consequently, the radiator had to be positioned at the front of the case.</p>



<p>When making a purchase, it&#8217;s crucial to choose a case that is suitable for water cooling. In more extreme cases, considering a caseless system might be an option (hopefully, this can be updated in the next release).</p>



<p>Cases designed for liquid cooling systems typically have more significant internal space to accommodate a water pump, and there is ample room for fans without obstruction. Some all-in-one water cooling designs may be more compact and might not encounter this issue.</p>



<h3 class="wp-block-heading">Liquid Cooling System</h3>



<p><br />Liquid cooling systems have some considerations to take into account:</p>



<ul class="wp-block-list">
<li>Tubing type: Choose between soft or hard tubing. Hard tubing is suitable for experienced users, offering a longer lifespan and a more aesthetic appearance. Soft tubing is easier for assembly, making it suitable for beginners.</li>



<li>All-in-one (AIO) or custom loop: Decide whether to go for a pre-assembled AIO liquid cooling system or build a custom loop system.</li>
</ul>



<p>Since the initial focus was on researching liquid cooling, the combination chosen was a custom loop with soft tubing. Building a custom loop may encounter some issues, with one of the main challenges being the uncertainty about specifications.</p>



<p>The first crucial aspect is determining the size of the liquid cooling tubing, as additional components will depend on this size, limiting the options for procurement. Currently, the mainstream sizes are two-eighths (2/8’), three-eighths (3/8’), and four-eighths (4/8’) liquid cooling tubing. </p>



<p>Another parameter is the thickness of the tubing, thick tubing and thin tubing. <br />* thick tubing refer to 10/16mm or 3/8”-5/8” tubing. <br />* thin thbing refer to 10/13mm or 3/8”-1/2″ tubing. </p>



<p>Most common  the inner diameter specification is G 1/4, when find some liquid colling componens like pressure relief valve needs it. </p>



<p>Once you&#8217;ve confirmed your inner and outer diameter, you can proceed to purchase the necessary liquid cooling components.</p>



<p>At a minimum, you&#8217;ll need:</p>



<ul class="wp-block-list">
<li>CPU water block *1</li>



<li>Water Pump *1</li>



<li>240mm radiator *1</li>



<li>12cm fans *2</li>



<li>Liquid coolant 500cc ~ 1000cc</li>



<li>Tubing 2M</li>



<li>Thermal paste</li>



<li>Pressure relief valve</li>



<li>Fittings: Quick connectors *6, 90-degree rotary fittings *(1~2)</li>



<li>Tools for filling and draining: Filling tool, draining tool (watering can, large syringe, drainage hose)</li>
</ul>



<p>Optional components:</p>



<ul class="wp-block-list">
<li>Flow meter, temperature gauge (note: buying these requires purchasing two additional quick connectors).</li>
</ul>



<p></p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="846" height="863" src="https://blog.richliu.com/wp-content/uploads/2024/01/image-9.png" alt="" class="wp-image-5448" style="aspect-ratio:0.9803012746234068;width:541px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/image-9.png 846w, https://blog.richliu.com/wp-content/uploads/2024/01/image-9-588x600.png 588w, https://blog.richliu.com/wp-content/uploads/2024/01/image-9-768x783.png 768w" sizes="(max-width: 846px) 100vw, 846px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="651" height="637" src="https://blog.richliu.com/wp-content/uploads/2024/01/image-10.png" alt="" class="wp-image-5449" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/image-10.png 651w, https://blog.richliu.com/wp-content/uploads/2024/01/image-10-600x587.png 600w" sizes="(max-width: 651px) 100vw, 651px" /></figure>



<p><br />In practical testing, if focusing solely on CPU cooling, it appears that a 240mm radiator is sufficient. The thin three-eighths (3/8”) tubing provides a large enough water flow diameter. Choosing a smaller tube diameter may not be as suitable for this purpose.</p>



<h3 class="wp-block-heading">CPU water block</h3>


<div class="wp-block-image">
<figure class="alignright size-full is-resized"><img loading="lazy" decoding="async" width="514" height="512" src="https://blog.richliu.com/wp-content/uploads/2024/01/image-11.png" alt="" class="wp-image-5450" style="aspect-ratio:1.00390625;width:263px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/image-11.png 514w, https://blog.richliu.com/wp-content/uploads/2024/01/image-11-300x300.png 300w" sizes="(max-width: 514px) 100vw, 514px" /></figure></div>


<p>This turned out to be quite troublesome. My original plan was to purchase a 50mmx50mm heatsink and connect it to the heatsink on the right. Then, I intended to secure it to the CPU socket using the fixtures shown in the image. However, as expected, unexpected issues arose – the world isn&#8217;t always that kind.</p>



<ol class="wp-block-list">
<li>There was no water block with a 50mmx50mm connector available. So, I ended up buying a 40mmx40mm connector, one size smaller. This resulted in poorer heat dissipation performance. Fortunately, I never had the chance to test the inferior heat dissipation, so this step failed unnoticed.</li>



<li>Here&#8217;s where I made a mistake. Custom water block connectors, like the one shown, are typically 2/8&#8243; fittings. However, the main liquid cooling system I bought has 3/8&#8243; fittings, making them completely incompatible. The options were either to change the fittings or change the entire system. Changing the fittings was the more cost-effective choice, so I opted for that.</li>
</ol>


<div class="wp-block-image">
<figure class="alignright size-full is-resized"><img loading="lazy" decoding="async" width="787" height="1050" src="https://blog.richliu.com/wp-content/uploads/2024/01/image-12.png" alt="" class="wp-image-5451" style="aspect-ratio:0.7495238095238095;width:237px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/image-12.png 787w, https://blog.richliu.com/wp-content/uploads/2024/01/image-12-450x600.png 450w, https://blog.richliu.com/wp-content/uploads/2024/01/image-12-768x1025.png 768w" sizes="(max-width: 787px) 100vw, 787px" /></figure></div>


<p>After connecting , it looked like the image on the right – and just looking at it made me worry that water would leak out.</p>



<p>So, I bought a two-eighths(2/8&#8243;) tubing to connect to this connector. However, while it could connect, it couldn&#8217;t link up with my three-eighths(3/8&#8243;) tubing in the water cooling system. I had to reluctantly abandon the custom water block connector.</p>



<p>The final solution had nothing to do with this connector.</p>



<p></p>



<p></p>



<h3 class="wp-block-heading">Communical CPU water block</h3>



<p>During the installation, I discovered that the Bykski CPU-XPH-T8 CPU water block, along with the provided adapter bracket, could be securely attached to the Ampere Altra&#8217;s socket. This was fantastic news and saved me a great deal of effort.</p>



<p>Although it&#8217;s designed for Intel LGA1700/LGA2066 sockets, the flexibility in its hole configuration allowed for adjustments, providing me with the necessary adaptability. As for whether other CPU brackets might be compatible, it&#8217;s likely that some could work. However, I haven&#8217;t had the chance to try others yet. If you have attempted this and found success, please let me know.</p>



<p>The base of this water block is quite substantial, and my intuition tells me that the cooling performance should be excellent. Therefore, I didn&#8217;t explore other compliant CPU water blocks.</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-1 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="1109" height="976" src="https://blog.richliu.com/wp-content/uploads/2024/01/image-16.png" alt="" class="wp-image-5455" style="aspect-ratio:1.1362704918032787;width:364px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/image-16.png 1109w, https://blog.richliu.com/wp-content/uploads/2024/01/image-16-600x528.png 600w, https://blog.richliu.com/wp-content/uploads/2024/01/image-16-768x676.png 768w" sizes="(max-width: 1109px) 100vw, 1109px" /></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1196" height="722" src="https://blog.richliu.com/wp-content/uploads/2024/01/image-14.png" alt="" class="wp-image-5453" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/image-14.png 1196w, https://blog.richliu.com/wp-content/uploads/2024/01/image-14-600x362.png 600w, https://blog.richliu.com/wp-content/uploads/2024/01/image-14-768x464.png 768w" sizes="(max-width: 1196px) 100vw, 1196px" /></figure>
</div>
</div>



<p><br />However, another issue arises. The water block is 56mmx56mm, whereas the width of the Ampere Altra CPU socket is 55mm. The water block does not fit. At this point, there are two possible solutions:</p>



<p>Upon observing the CPU&#8217;s structure, the first solution seemed unfeasible. Cutting down the thickness of this water block would compromise its structural integrity, not to mention finding the tools or a professional service for the task.</p>



<p>Thus, the only viable option is the second solution. The simplest and most intuitive way to implement this is by using a thermal pad made of silicone to transfer heat upwards from the CPU.</p>



<h3 class="wp-block-heading">Silicone Thermal Pad </h3>


<div class="wp-block-image">
<figure class="alignright size-full is-resized"><img loading="lazy" decoding="async" width="1286" height="707" src="https://blog.richliu.com/wp-content/uploads/2024/01/image-17.png" alt="" class="wp-image-5456" style="aspect-ratio:1.818953323903819;width:322px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/image-17.png 1286w, https://blog.richliu.com/wp-content/uploads/2024/01/image-17-600x330.png 600w, https://blog.richliu.com/wp-content/uploads/2024/01/image-17-768x422.png 768w" sizes="(max-width: 1286px) 100vw, 1286px" /></figure></div>


<p>But things couldn&#8217;t be as simple as I, a fool, initially thought. In conclusion, regular silicone thermal pads are not suitable for power monsters like the Ampere Altra. This type of thermal pad may be effective for low-power devices such as routers, switches, NVMe disks, etc., but it&#8217;s not useful for high-power CPUs.</p>



<p>In the image, there are 2mm thick silicone thermal pads, and you need two layers because the height is just that much. Essentially, this provides only a slight improvement over having no heat dissipation at all, so it&#8217;s not worth considering.</p>



<p>As for the high-efficiency silicone thermal pads available in the market, I don&#8217;t know if they would work. If you have them on hand, you can give them a try. However, I believe the chances of success are quite low.</p>



<h3 class="wp-block-heading"><br />Purple Copper Thermal Pad</h3>


<div class="wp-block-image">
<figure class="alignright size-full is-resized"><img loading="lazy" decoding="async" width="1468" height="833" src="https://blog.richliu.com/wp-content/uploads/2024/01/image-18.png" alt="" class="wp-image-5457" style="aspect-ratio:1.7623049219687874;width:317px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/image-18.png 1468w, https://blog.richliu.com/wp-content/uploads/2024/01/image-18-600x340.png 600w, https://blog.richliu.com/wp-content/uploads/2024/01/image-18-768x436.png 768w" sizes="(max-width: 1468px) 100vw, 1468px" /></figure></div>


<p><br />Nowadays, a common method for cooling is using purple copper heat pipes. This type of heat dissipation is quite effective, and the 2U passive heatsink included with Newegg utilizes these heat pipes. Therefore, if we can customize the heatsink, wouldn&#8217;t that solve the problem? Luckily, the country right next to my country is the world&#8217;s largest manufacturing factory, capable of customizing just about anything. This made the solution very affordable and instantly resolved my problem.</p>



<p>The dimensions of the purple copper thermal pad are: Length x Width x Height = 64x54x4mm, with a rounded R5 edge.</p>



<p>Alternatively, you can measure the dimensions of the piece under the 2U passive heatsink to get the specifications. Placing it on the original heatsink, I can say the dimensions match perfectly. The craftsmanship is quite impressive, and there are no issues when it&#8217;s actually placed.</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/01/IMG_20240108_235640-scaled.jpg" alt="" class="wp-image-5458" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240108_235640-scaled.jpg 2560w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240108_235640-600x450.jpg 600w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240108_235640-768x576.jpg 768w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240108_235640-1536x1152.jpg 1536w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240108_235640-2048x1536.jpg 2048w" sizes="(max-width: 2560px) 100vw, 2560px" /></figure>



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



<p><br />First, place the purple copper thermal pad, and remember to apply thermal paste before doing so.</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/01/IMG_20240105_184648-scaled.jpg" alt="" class="wp-image-5459" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184648-scaled.jpg 2560w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184648-600x450.jpg 600w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184648-768x576.jpg 768w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184648-1536x1152.jpg 1536w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184648-2048x1536.jpg 2048w" sizes="(max-width: 2560px) 100vw, 2560px" /></figure>



<p>Apply thermal paste before placing CPU water cooling block. </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/01/IMG_20240105_184740-scaled.jpg" alt="" class="wp-image-5460" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184740-scaled.jpg 2560w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184740-600x450.jpg 600w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184740-768x576.jpg 768w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184740-1536x1152.jpg 1536w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184740-2048x1536.jpg 2048w" sizes="(max-width: 2560px) 100vw, 2560px" /></figure>



<p><br />Assemble the components.</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/01/IMG_20240105_184300-scaled.jpg" alt="" class="wp-image-5461" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184300-scaled.jpg 2560w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184300-600x450.jpg 600w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184300-768x576.jpg 768w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184300-1536x1152.jpg 1536w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184300-2048x1536.jpg 2048w" sizes="(max-width: 2560px) 100vw, 2560px" /></figure>



<p>Actually, I assembled the tubing on the left side incorrectly. I&#8217;ll need to purchase materials and quick connectors to replace it when I have the time. But for now, let&#8217;s leave it as is and make do.</p>



<p>Overall view.</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/01/IMG_20231212_001937-scaled.jpg" alt="" class="wp-image-5462" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-scaled.jpg 2560w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-600x450.jpg 600w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-768x576.jpg 768w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-1536x1152.jpg 1536w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-2048x1536.jpg 2048w" sizes="(max-width: 2560px) 100vw, 2560px" /></figure>



<p> <br />This way, it&#8217;s evident that the case isn&#8217;t ideal. It&#8217;s too cramped, affecting airflow, and it cannot accommodate the components properly.</p>



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



<p>If you are interested in replicating my setup, all the components were purchased from Taobao. I spent extra for testing and experimenting, but in reality, you should be able to set up the entire cooling system for around US$100 or NTD$3,000. This is comparable to the cost of an efficient dual-fan tower cooler.</p>



<p>Since this is a Chinese website, I&#8217;ll keep the text in Chinese and provide English translations afterward.</p>



<h3 class="wp-block-heading">Liquid Cooling System</h3>



<p><a href="https://item.taobao.com/item.htm?spm=a1z09.2.0.0.17af2e8dIZLPG3&amp;id=689355457926&amp;_u=81mce81r4a19" target="_blank" rel="noopener">watertiger定制台式机电脑分体式CPU显卡水冷软管套装冷散热器</a> (&#8220;WaterTiger Custom Desktop Computer Split-Type CPU GPU Liquid Cooling Soft Tube Kit Radiator&#8221;)<br />Enter the URL choice &#8220;單 CPU 水冷 240 冷排&#8221; (&#8220;Single CPU Liquid Cooling 240 Radiator&#8221;)</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1146" height="780" src="https://blog.richliu.com/wp-content/uploads/2024/01/image-19.png" alt="" class="wp-image-5463" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/image-19.png 1146w, https://blog.richliu.com/wp-content/uploads/2024/01/image-19-600x408.png 600w, https://blog.richliu.com/wp-content/uploads/2024/01/image-19-768x523.png 768w" sizes="(max-width: 1146px) 100vw, 1146px" /></figure>



<p>At first, I chose this brand because the photos looked appealing, but it turned out to be a fortunate coincidence that saved me a lot of exploration time. This brand integrates various components into a set for sale, and the components they use are of decent quality. For example, they use the Enermax NEOChanger as the water pump, which is also a good pump. If you are familiar enough, you might not need these kits.</p>



<p>This kit does not include a pressure relief valve. You&#8217;ll need to purchase a pressure relief valve separately, and depending on your needs, you might want to buy additional quick connectors</p>



<h3 class="wp-block-heading">Clamping Fittings</h3>



<p>All the components can be purchased from the same place, saving the hassle of searching everywhere. It&#8217;s a good idea to buy a few extra parts to avoid trouble later on. The time cost is much higher than the cost of the components.</p>



<p><a href="https://item.taobao.com/item.htm?_u=81mce81r8034&amp;id=38513060164&amp;spm=a1z09.2.0.0.17af2e8dIZLPG3" target="_blank" rel="noopener">电脑水冷头扣具卡具CPU显卡南北桥固定笔记本散热器压条五金夹具</a> (&#8220;Computer Water Cooling Head Fastening Fixture, CPU GPU North-South Bridge Fixing, Laptop Heatsink Clamp, Hardware Clamp&#8221;)</p>



<p>Choice 台式机CPU冷头扣具(&#8220;Desktop CPU Cooling Head Fastening Fixture&#8221;) *2 </p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="543" height="358" src="https://blog.richliu.com/wp-content/uploads/2024/01/image-20.png" alt="" class="wp-image-5464"/></figure>



<p><br /><a href="https://item.taobao.com/item.htm?_u=81mce81rb354&amp;id=39519155251&amp;spm=a1z09.2.0.0.17af2e8dIZLPG3" target="_blank" rel="noopener">M2 M3 M4不锈钢平头盘头螺丝钉水冷头水冷排机箱风扇安装长螺丝</a> (&#8220;M2 M3 M4 Stainless Steel Flat Head Countersunk Screws for Water Cooling Head, Radiator, Case Fan Installation &#8211; Long Screws&#8221;)</p>



<p>Fastening fixtures for securing CPU coolers and water blocks. The components can be increased based on requirements. The minimum required quantity includes<br />M3手拧螺母 (M3 thumb nuts)*4，M3*30 (M3 screws) *4 ，M3垫片(M3 washers) *4  ，M3六角螺母(M3 hex nuts) *4<br /></p>



<p><a href="https://item.taobao.com/item.htm?spm=a1z09.2.0.0.17af2e8dIZLPG3&amp;id=538187007087&amp;_u=81mce81r8677" target="_blank" rel="noopener">电脑水冷水流计 液冷散热器流量器 流体温度观测器透明水流指示计</a> (&#8220;Computer Liquid Cooling Flow Meter, Liquid Cooler Flow Indicator, Fluid Temperature Monitor Transparent Flow Meter&#8221;) (option)</p>



<p>Choice: 3孔水流观测器 + 温度计 (&#8220;3-Port Flow Meter + Thermometer for Water Flow Observation&#8221;)</p>



<p>Nice to have items, but it can make me feel better. </p>



<h2 class="wp-block-heading">Test Result</h2>



<p>This system feels relatively quiet and not noisy.</p>



<p>The following tests are only for verifying the liquid cooling setup and are not formal performance tests. The results are provided for liquid cooling reference and do not include testing power consumption, etc.</p>



<p>Room temperature: 25 degrees Celsius<br />CPU : Ampere AltraMax 128-30<br />Run command :  stress-ng &#8211;cpu 128 &#8211;iomix 128 &#8211;vm 128</p>



<p>Gentoo Linux kernel 6.6 ，CPU temperature is approximately，Power consumption CPU 150W/ IO 19W<br />Ubuntu 22.04 kernel 6.2(?)，CPU temperature is approximately 72 degrees，Power consumption CPU 178W/ IO 20W</p>



<p>In conclusion, I hope this article has been helpful for those eager to try it out.</p>



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



<p>Newegg has also listed another model, which is only the motherboard version, only US$849.-<br /><a href="https://www.newegg.com/p/N82E16813140130" target="_blank" rel="noopener">ASRock Rack ALTRAD8UD-1L2T Deep Micro-ATX Server Motherboard Singel Socket (LGA 4926) Ampere Altra Max/Ampere Altra processors Dual 10G &amp; 1G</a></p>
<p>The post <a rel="nofollow" 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> 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/01/09/5471/ampere-altra-altramax-asrock-altrad8ud-1l2t-liquid-cooling-system/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Ampere Altra/AltraMax 加AsRock ALTRAD8UD-1L2T 水冷方案</title>
		<link>https://blog.richliu.com/2024/01/09/5446/ampere-altra-altramax-%e5%8a%a0asrock-altrad8ud-1l2t-%e6%b0%b4%e5%86%b7%e6%96%b9%e6%a1%88/</link>
					<comments>https://blog.richliu.com/2024/01/09/5446/ampere-altra-altramax-%e5%8a%a0asrock-altrad8ud-1l2t-%e6%b0%b4%e5%86%b7%e6%96%b9%e6%a1%88/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Mon, 08 Jan 2024 17:19:12 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[Altra]]></category>
		<category><![CDATA[AltraMax]]></category>
		<category><![CDATA[Ampere]]></category>
		<category><![CDATA[水冷]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=5446</guid>

					<description><![CDATA[<p>English version article is here (Ampere Altra/AltraMax  [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/01/09/5446/ampere-altra-altramax-%e5%8a%a0asrock-altrad8ud-1l2t-%e6%b0%b4%e5%86%b7%e6%96%b9%e6%a1%88/">Ampere Altra/AltraMax 加AsRock ALTRAD8UD-1L2T 水冷方案</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="1920" src="https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-scaled.jpg" alt="" class="wp-image-5462" style="aspect-ratio:1.3333333333333333;width:224px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-scaled.jpg 2560w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-600x450.jpg 600w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-768x576.jpg 768w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-1536x1152.jpg 1536w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-2048x1536.jpg 2048w" sizes="(max-width: 2560px) 100vw, 2560px" /></figure></div>


<p>English version article is <a href="https://blog.richliu.com/2024/01/09/5471/ampere-altra-altramax-asrock-altrad8ud-1l2t-liquid-cooling-system/">here (Ampere Altra/AltraMax AsRock ALTRAD8UD-1L2T Liquid Cooling System)</a><br />2024/01<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">/31 Update: Ampere will have 2U passive cooler Making Arm Desktops Viable Ampere Altra Noctua NH-D9 AMP-4926 4U and NH-U14S AMP-4926</a></p>



<p>Ampere Altra/AltraMax CPU 最高單顆 CPU 是 128 核 ARM64 的 CPU，一般都是在伺服器主機上，但是伺服器主機非常不適合放在公司內或是家用，因為一般伺服器主機都會用高轉速風扇散熱，一般人是不能忍受這樣的噪音。伺服器主機板也不方便改裝到一般家用主機板，如果真的想要用，<a href="https://www.adlinktech.com/products/Computer_on_Modules/COM-HPC-Server-Carrier-and-Starter-Kit/Ampere_Altra_Developer_Platform?lang=en" target="_blank" rel="noopener">ADLink Ampere Altra Dev Platform</a> 是一個不錯的解決方案，也有水冷的選項。<br />另一個解決方案就是 <a href="https://www.newegg.com/p/N82E16813140134" target="_blank" rel="noopener">AsRock ALTRAD8UD-1L2T</a> ，目前在 <a href="https://www.newegg.com/p/N82E16813140134" target="_blank" rel="noopener">newegg </a>上架了，配合一個 Ampere Altra Q64-22 (64 cores 2.2G) 的 CPU，附贈一個 2U Passive 的散熱片，價格 US$1,500.- ，應該算便宜。但是送的是被動散熱，如果不想要裝一顆風扇到被動散熱上，想要改成水冷散熱，那看我這篇文章就對了。</p>



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



<p>本人習慣，在有可能造成危險的文章，會在文章前面加上宣言<br />* 本篇文章並非 Ampere,  Newegg 或是其他任何文章內提到的商城及店家業配文，純屬個人紀錄<br />* 本文作者和部份這塊板子的生產有利益關係，特此揭示<br />* 作者是第一次接觸電腦系統水冷，內容可能不盡正確，請自行注意風險<br />* 本文並非 Ampere 或是 AsRock 官方文件<br />* <mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-luminous-vivid-orange-color">本人不對本篇文章的造成的任何影響負責任；例如看本人文章操作不當造成的損失等等</mark></p>



<p>Ampere 系統主要是專攻 Cloud nativate CPU，所以直至目前為止，並沒有廠商生產一般用途的散熱系統。這個系統附贈的 2U Passive 散熱片是 Server 專用的，使用的是 Server 高速風扇散熱；雖然 newegg 附的是 Q64-22 ，功耗比較低，但是唯一的散熱方式就是拿電風扇直接吹，要不然就是卡一個8吋風扇在上面，這種散熱方案像我這樣的專業玩家是無法接受的</p>



<p>如果要進階散熱，一般的塔型散熱系統需要將主機板背面的夾具換掉，而且也要能跟這個板子的扣具相容，找到相容的塔型散熱難度可能也不小。考量到只能在正面鎖螺絲，那唯一能用的散熱系統就是水冷式散熱。所以我這段時間摸索出了一條可以用的水冷散熱解決方案，在此分享給想要踩雷的朋友們，或許這個做法也可以激發各位的創意。</p>



<p>接下來會在這篇文章內介紹要如何在 ALTRAD8UD-1L2T 板子上，搭建屬於 Ampere Altra 的水冷系統，理論上因為螺絲孔位一樣，所以 Ampere 其他的板子也可以用，但是本篇內容主要以 ALTRAD8UD-1L2T 為主，而本文亦會提到踩過的地雷或是採購項目。</p>



<h2 class="wp-block-heading">準備</h2>



<h3 class="wp-block-heading">ALTRAD8UD-1L2T</h3>



<p>上網可以找到這塊板子的規格，這些就不再重覆，但是一般人會比較迷惑的是，什麼是 Deep mATX ？<br />這個是 AsRock 自己的規格，是增加 mATX 的深度尺寸，保持 mATX 的寬度規格，以增加更多空間容納更多元件。這個特別的規格常見於 AsRock server grade 的主機板上。</p>



<h3 class="wp-block-heading">機殼</h3>



<p>一般機殼應該都可以。不過我這邊犯了一個錯誤，機殼買太小，我買的機殼是 Antec P110 Silent ，雖然有水冷孔位，但是這個機殼不適合加裝水冷，內部空間太小，沒有固定水泵的地方，Antec P110 水冷排無法放在上方，會卡到主機板，所以最後水冷排是放機殼前方</p>



<p>採購時，請找適合水冷的機殼，更極端一點可以考慮無機殼系統（希望下次更新可以更新無機殼系統）。</p>



<p>水冷機殼內部空間需求更大，要有地方放水泵，還有風扇放下去不會卡住。<br />有些一體式水冷的設計會比較小，比較不會有這個問題</p>



<h3 class="wp-block-heading">水冷設備</h3>



<p>水冷散熱有一些需要考慮的<br />* 軟管或是硬管（硬管比較適合有經驗的，壽命長，較美觀；軟體組裝方便，適合新手）<br />* 一體式水冷（廠商已經組裝好）或是分體式水冷（自組水冷系統）</p>



<p>因為一開始是研究如何建置水冷，所以一定是分體式水冷加軟管的組合。自組水水冷又會碰到一些問題，最主要的是不知道規格為何？<br />第一件需要確定的是水冷管大小，因為加購設備就是看水冷管大小，這會限制採購品項<br />目前主流有 二分(2/8’)、三分(3/8’)、四分(4/8’)水冷管，但是實際上在找產品的時候，會標為像 6*10(二分) 9.5*12.7(三分，有些會標 10*13) 另外還有 8*12 不知道對應到什麼，數字小的是內徑，數字大的是外徑 。三分又有分三分薄和三分厚，三分薄就是 10/13 ，三分厚就是 10/16 ，如果不是老手很容易在這邊搞錯。本文用的全部都是三分薄的系統</p>



<p>以上有英制和公制，要特別小心注意規格，像洩氣閥內徑規格就要用 G 1/4 規格的（目前大都是此規格）<br />確定好自己的內外徑之後，就可以採購需要的水冷套件</p>



<p>最少需要的是<br />CPU水冷頭*1<br />水泵*1<br />240寬冷排*1 <br />12CM風扇*2<br />水冷液 500cc ~ 1000cc<br />水管 2M<br />散熱膏<br />洩壓閥<br />接頭：快速接頭*6 ，90度旋轉彎頭*(1~2個)<br />注水工具，放水工具（加水壺，大針筒，放水管）<br />可選：<br />流量計，水溫計（註：買這個要多買二個快速接頭）</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="846" height="863" src="https://blog.richliu.com/wp-content/uploads/2024/01/image-9.png" alt="" class="wp-image-5448" style="aspect-ratio:0.9803012746234068;width:541px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/image-9.png 846w, https://blog.richliu.com/wp-content/uploads/2024/01/image-9-588x600.png 588w, https://blog.richliu.com/wp-content/uploads/2024/01/image-9-768x783.png 768w" sizes="(max-width: 846px) 100vw, 846px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="651" height="637" src="https://blog.richliu.com/wp-content/uploads/2024/01/image-10.png" alt="" class="wp-image-5449" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/image-10.png 651w, https://blog.richliu.com/wp-content/uploads/2024/01/image-10-600x587.png 600w" sizes="(max-width: 651px) 100vw, 651px" /></figure>



<p>實測如果只針對 CPU 散熱，目前看起來 240 水冷排就夠，而三分薄提供了夠大的水流口徑。<br />如果管徑再小可以不太合適。</p>



<h3 class="wp-block-heading">CPU水冷散熱頭</h3>


<div class="wp-block-image">
<figure class="alignright size-full is-resized"><img loading="lazy" decoding="async" width="514" height="512" src="https://blog.richliu.com/wp-content/uploads/2024/01/image-11.png" alt="" class="wp-image-5450" style="aspect-ratio:1.00390625;width:263px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/image-11.png 514w, https://blog.richliu.com/wp-content/uploads/2024/01/image-11-300x300.png 300w" sizes="(max-width: 514px) 100vw, 514px" /></figure></div>


<p>這個頗麻煩的，我原來的規劃是買一個 50mmx50mm 的散熱片接到像右邊的散熱頭上。然後用圖中的夾具固定在 CPU 座上面，但是不出意外的就出了意外，這世界上沒這麼好的事情</p>



<p>1 ) 沒有 50mmx50mm 的水冷頭接頭，所以買的是 40mmx40mm 的接頭，小了一圈，散熱性能較差，幸運的是我根本沒機會測到散熱性能較差這步就失敗了</p>



<p>2) 我在這邊犯了一個錯誤，這種像是定製的水冷接頭都是 2/8&#8243; 頭，但是我買的主要水冷系統是 3/8&#8243; 的系統，完全接不上去，要就是要換頭，或是換系統；當然換頭比較便宜，所以選擇換頭</p>


<div class="wp-block-image">
<figure class="alignright size-full is-resized"><img loading="lazy" decoding="async" width="787" height="1050" src="https://blog.richliu.com/wp-content/uploads/2024/01/image-12.png" alt="" class="wp-image-5451" style="aspect-ratio:0.7495238095238095;width:237px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/image-12.png 787w, https://blog.richliu.com/wp-content/uploads/2024/01/image-12-450x600.png 450w, https://blog.richliu.com/wp-content/uploads/2024/01/image-12-768x1025.png 768w" sizes="(max-width: 787px) 100vw, 787px" /></figure></div>


<p>接上去之後像是右邊這樣，這光看都覺得水會跑出來吧</p>



<p>所以我買了二分管想要接這個接頭，但是二分管是可以接上去沒錯，但是接不上我水冷的三分管系統。只能果斷放棄接定製水冷頭</p>



<p>最後的解法已經和這個接頭無關了</p>



<p></p>



<p></p>



<h3 class="wp-block-heading">商用水冷頭</h3>



<p>在裝的時候發現買的套件附的 Bykski CPU-XPH-T8 這顆 CPU 水冷頭加轉接夾具可以合上到 Ampere Altra 的底座，這簡直太棒了啊。省了非常多功夫</p>



<p>雖然是給 Intel LGA1700/LGA2066用的，所以它的孔位設計成非常彈性，這就給了我調整的空間。至於其他 CPU 的夾具有沒有可能可以用，應該也有可以用的，不過這邊我還沒機會試，如果你有試過可以告訴我。<br />而這個水冷頭的底座非常大，直覺告訴我散熱效果應該非常好，所以也並未去找其他合規的 CPU 水冷頭</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-2 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="1109" height="976" src="https://blog.richliu.com/wp-content/uploads/2024/01/image-16.png" alt="" class="wp-image-5455" style="aspect-ratio:1.1362704918032787;width:364px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/image-16.png 1109w, https://blog.richliu.com/wp-content/uploads/2024/01/image-16-600x528.png 600w, https://blog.richliu.com/wp-content/uploads/2024/01/image-16-768x676.png 768w" sizes="(max-width: 1109px) 100vw, 1109px" /></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1196" height="722" src="https://blog.richliu.com/wp-content/uploads/2024/01/image-14.png" alt="" class="wp-image-5453" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/image-14.png 1196w, https://blog.richliu.com/wp-content/uploads/2024/01/image-14-600x362.png 600w, https://blog.richliu.com/wp-content/uploads/2024/01/image-14-768x464.png 768w" sizes="(max-width: 1196px) 100vw, 1196px" /></figure>
</div>
</div>



<p>但是接下來又有另一個問題，這個水冷頭是 56mmx56mm ，而 Ampere Altra CPU socket 寬度為 55mm，這個水冷頭放不下。這時有二個選擇方案<br />1) 切割水冷頭讓它變小（還沒考慮高度問題）<br />2) 將熱從 CPU 接到水冷頭</p>



<p>第一個方案觀察了一下 CPU 工藝，覺得不可行，因為這顆水冷頭的厚度切下去會影響結構，更別提還要想辦法找到工具或是店家切割。</p>



<p>那就只能用第二個方案了，這個方案最簡單並且非常直覺的方式就是用矽膠導熱墊將熱拉上來</p>



<h3 class="wp-block-heading">矽膠導熱墊 (thermal pad silicone)</h3>


<div class="wp-block-image">
<figure class="alignright size-full is-resized"><img loading="lazy" decoding="async" width="1286" height="707" src="https://blog.richliu.com/wp-content/uploads/2024/01/image-17.png" alt="" class="wp-image-5456" style="aspect-ratio:1.818953323903819;width:322px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/image-17.png 1286w, https://blog.richliu.com/wp-content/uploads/2024/01/image-17-600x330.png 600w, https://blog.richliu.com/wp-content/uploads/2024/01/image-17-768x422.png 768w" sizes="(max-width: 1286px) 100vw, 1286px" /></figure></div>


<p>但是事情怎麼會像我這個笨蛋想的這麼簡單，先說結論，一般的矽膠導熱墊不適用於 Ampere Altra 這種 Power Monster ，所以完全不用考慮。這種矽膠導熱墊給小功率的 router/switch/nvme disk 等等或許有用，對大功率的 CPU 是沒有用的</p>



<p>圖中是 2mm 厚的矽膠導熱墊，而且要二層，因為高度就是這麼高，基本上這個只比不接散熱好一點點而已，所以別想了</p>



<p>至於市面上賣的高效率矽膠導熱墊有沒有用我就不知道了，如果手上有現成的可以試試，不過我認為成功機率很低</p>



<h3 class="wp-block-heading">紫銅導熱片</h3>


<div class="wp-block-image">
<figure class="alignright size-full is-resized"><img loading="lazy" decoding="async" width="1468" height="833" src="https://blog.richliu.com/wp-content/uploads/2024/01/image-18.png" alt="" class="wp-image-5457" style="aspect-ratio:1.7623049219687874;width:317px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/image-18.png 1468w, https://blog.richliu.com/wp-content/uploads/2024/01/image-18-600x340.png 600w, https://blog.richliu.com/wp-content/uploads/2024/01/image-18-768x436.png 768w" sizes="(max-width: 1468px) 100vw, 1468px" /></figure></div>


<p>那現在一般的散熱是怎麼散熱呢？一般都是紫銅導熱管，這個散熱效率還不錯，newegg 附贈的 2U passive heatsink 就是使用這種導熱管散熱。所以如果可以客製散熱片，這樣不就解決問題了嗎？幸好我們旁邊就是世界最大的製造工廠，任何怪東西都可以客製，這樣一片非常便宜，瞬間解決了我的問題</p>



<p>紫銅導熱片的尺寸規格是<br />長x寬x高 = 64x54x4mm ，另外要倒 R5 的角</p>



<p>也可以量 2U passive heatsink 下面那一塊得到規格，放在原廠的散熱片上只能說尺寸一樣<br />工藝還真不錯，實際放下去也沒有問題</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/01/IMG_20240108_235640-scaled.jpg" alt="" class="wp-image-5458" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240108_235640-scaled.jpg 2560w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240108_235640-600x450.jpg 600w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240108_235640-768x576.jpg 768w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240108_235640-1536x1152.jpg 1536w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240108_235640-2048x1536.jpg 2048w" sizes="(max-width: 2560px) 100vw, 2560px" /></figure>



<h2 class="wp-block-heading">組合</h2>



<p>先放上紫銅導熱片，記得放之前塗散熱膏</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/01/IMG_20240105_184648-scaled.jpg" alt="" class="wp-image-5459" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184648-scaled.jpg 2560w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184648-600x450.jpg 600w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184648-768x576.jpg 768w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184648-1536x1152.jpg 1536w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184648-2048x1536.jpg 2048w" sizes="(max-width: 2560px) 100vw, 2560px" /></figure>



<p>放上去之前再塗散熱膏</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/01/IMG_20240105_184740-scaled.jpg" alt="" class="wp-image-5460" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184740-scaled.jpg 2560w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184740-600x450.jpg 600w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184740-768x576.jpg 768w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184740-1536x1152.jpg 1536w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184740-2048x1536.jpg 2048w" sizes="(max-width: 2560px) 100vw, 2560px" /></figure>



<p>合體</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/01/IMG_20240105_184300-scaled.jpg" alt="" class="wp-image-5461" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184300-scaled.jpg 2560w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184300-600x450.jpg 600w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184300-768x576.jpg 768w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184300-1536x1152.jpg 1536w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20240105_184300-2048x1536.jpg 2048w" sizes="(max-width: 2560px) 100vw, 2560px" /></figure>



<p>其實這張圖左邊的管子我裝錯了，有空要再去買材料和快速接頭來換，但是現在就先這樣吧，撐一下。</p>



<p>全貌</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/01/IMG_20231212_001937-scaled.jpg" alt="" class="wp-image-5462" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-scaled.jpg 2560w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-600x450.jpg 600w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-768x576.jpg 768w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-1536x1152.jpg 1536w, https://blog.richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-2048x1536.jpg 2048w" sizes="(max-width: 2560px) 100vw, 2560px" /></figure>



<p> 這樣就看得出來這機殼不好了，太擠太小影響風流，不能放在上面</p>



<h2 class="wp-block-heading">購物</h2>



<p>如果你是想學我的方案，我所有的零件都是從 Taobao 購入，我因為有測試還有多花錢<br />但是實際上應該 US$100, NTD$3,000 左右可以搞定整個散熱系統。<br />跟一個效率好的雙風扇塔扇差不多</p>



<h3 class="wp-block-heading">水冷系統</h3>



<p><a href="https://item.taobao.com/item.htm?spm=a1z09.2.0.0.17af2e8dIZLPG3&amp;id=689355457926&amp;_u=81mce81r4a19" target="_blank" rel="noopener">watertiger定制台式机电脑分体式CPU显卡水冷软管套装冷散热器</a><br />進去後選單 CPU 水冷 240 冷排</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1146" height="780" src="https://blog.richliu.com/wp-content/uploads/2024/01/image-19.png" alt="" class="wp-image-5463" srcset="https://blog.richliu.com/wp-content/uploads/2024/01/image-19.png 1146w, https://blog.richliu.com/wp-content/uploads/2024/01/image-19-600x408.png 600w, https://blog.richliu.com/wp-content/uploads/2024/01/image-19-768x523.png 768w" sizes="(max-width: 1146px) 100vw, 1146px" /></figure>



<p>當初是看照片比較好看所以買這家的，但是誤打誤撞節省我很多摸索的時間。<br />這家也是將各家設備整合弄一套出來賣，但是東西用的還不錯，像水泵用的是 Enermax NEOChanger ，也是還不錯的水泵。如果夠熟是可以不用這些套件。</p>



<p>這個套件沒有洩壓閥，另外要多採購洩壓閥，還有依需求可以多買快速接頭</p>



<h3 class="wp-block-heading">夾具</h3>



<p>以下都在同一家採購，不用到處找，零件可以多買一點，免得到時候要找麻煩，時間成本遠高於零件成本。</p>



<p><a href="https://item.taobao.com/item.htm?_u=81mce81r8034&amp;id=38513060164&amp;spm=a1z09.2.0.0.17af2e8dIZLPG3" target="_blank" rel="noopener">电脑水冷头扣具卡具CPU显卡南北桥固定笔记本散热器压条五金夹具</a></p>



<p>選台式机CPU冷头扣具 *2 </p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="543" height="358" src="https://blog.richliu.com/wp-content/uploads/2024/01/image-20.png" alt="" class="wp-image-5464"/></figure>



<p><br /><a href="https://item.taobao.com/item.htm?_u=81mce81rb354&amp;id=39519155251&amp;spm=a1z09.2.0.0.17af2e8dIZLPG3" target="_blank" rel="noopener">M2 M3 M4不锈钢平头盘头螺丝钉水冷头水冷排机箱风扇安装长螺丝</a></p>



<p>固定 CPU 冷頭扣具和水冷頭的零件，這個可以依需求增加，以下是最低需求量<br />M3手拧螺母*4，M3*30 *4 ，M3垫片*4  ，M3六角螺母*4<br /></p>



<p><a href="https://item.taobao.com/item.htm?spm=a1z09.2.0.0.17af2e8dIZLPG3&amp;id=538187007087&amp;_u=81mce81r8677" target="_blank" rel="noopener">电脑水冷水流计 液冷散热器流量器 流体温度观测器透明水流指示计</a> (option)</p>



<p>選: 3孔水流观测器 + 温度计</p>



<p>可有可無的東西，不過有比較好玩</p>



<h2 class="wp-block-heading">測試結果</h2>



<p>這套系統個人感覺相對安靜，不會吵</p>



<p>以下測試只是驗證水冷測試，並非正式的 performance test ，結果僅供建置水冷參考，並非測試 power consumption等結果</p>



<p>室溫 25 度<br />CPU : Ampere AltraMax 128-30<br />Run command :  stress-ng &#8211;cpu 128 &#8211;iomix 128 &#8211;vm 128</p>



<p>Gentoo Linux kernel 6.6 ，CPU 溫度約在 67 度，Power consumption CPU 150W/ IO 19W<br />Ubuntu 22.04 kernel 6.2(?)，CPU 溫度約在 72 度，Power consumption CPU 178W/ IO 20W</p>



<p>最後希望這篇文章有幫到躍躍欲試的你</p>



<h2 class="wp-block-heading">後記</h2>



<p>Newegg 還有上架另一個型號，只有主機板的版本，只賣US$849.-<br /><a href="https://www.newegg.com/p/N82E16813140130" target="_blank" rel="noopener">ASRock Rack ALTRAD8UD-1L2T Deep Micro-ATX Server Motherboard Singel Socket (LGA 4926) Ampere Altra Max/Ampere Altra processors Dual 10G &amp; 1G</a></p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/01/09/5446/ampere-altra-altramax-%e5%8a%a0asrock-altrad8ud-1l2t-%e6%b0%b4%e5%86%b7%e6%96%b9%e6%a1%88/">Ampere Altra/AltraMax 加AsRock ALTRAD8UD-1L2T 水冷方案</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/01/09/5446/ampere-altra-altramax-%e5%8a%a0asrock-altrad8ud-1l2t-%e6%b0%b4%e5%86%b7%e6%96%b9%e6%a1%88/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Ampere Altra Mt. Jade OpenBMC and EDKII build guide on ARM64 platform</title>
		<link>https://blog.richliu.com/2022/06/23/4601/ampere-altra-mt-jade-openbmc-build-guide-on-arm64-platform/</link>
					<comments>https://blog.richliu.com/2022/06/23/4601/ampere-altra-mt-jade-openbmc-build-guide-on-arm64-platform/#comments</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Thu, 23 Jun 2022 05:31:55 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[Computer/Technical]]></category>
		<category><![CDATA[Embedded]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Altra]]></category>
		<category><![CDATA[Ampere Computing]]></category>
		<category><![CDATA[arm64]]></category>
		<category><![CDATA[EDKII]]></category>
		<category><![CDATA[OpenBMC]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=4601</guid>

					<description><![CDATA[<p>Ampere announce Altra CPU, it&#8217;s a 80 cores ARM64v [&#8230;]</p>
<p>The post <a rel="nofollow" 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> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Ampere announce Altra CPU, it&#8217;s a 80 cores ARM64v8 CPU for cloud native workloads. Altra Max CPU is 128 cores. Follow the CPU, Ampere also has a CRB (customer reference board) named Mt. Jade, and Ampere also open source OpenBMC and EDKII source code for Mt. Jade platform. <br /><br />This article is personal note, all information can be found from internet. And open source project keeps going, it might be some minor differences when you find this article. </p>



<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>Table of Contents</h2><nav><ul><li><a href="#before-build-source-code">Before Build Source Code</a></li><li><a href="#prepare-build-environment">Prepare Build Environment</a><ul><li><a href="#get-the-ubuntu-18-04-cloud-image">Get the Ubuntu 18.04 cloud image</a></li><li><a href="#prepare-hostname-and-userdata-for-vm">Prepare hostname and userdata for VM</a></li></ul></li><li><a href="#build-mt-jade-edkii">Build Mt. Jade EDKII</a><ul><li><a href="#prepare-vm-environment">Prepare VM environment</a></li><li><a href="#get-build-environment">Get build environment</a></li><li><a href="#build-and-sign-the-image">Build and Sign the image</a></li><li><a href="#manual-build-edkii">Manual Build EDKII</a></li></ul></li><li><a href="#build-mt-jade-open-bmc">Build Mt. Jade OpenBMC</a></li><li><a href="#prepare-build-environment-1">Prepare build environment</a></li><li><a href="#build-open-bmc">Build OpenBMC</a></li><li><a href="#upgrade-firmware">Upgrade Firmware</a><ul><li><a href="#update-open-bmc-firmware">Update OpenBMC firmware</a><ul><li><a href="#update-via-url">Update via URL</a></li><li><a href="#update-via-ssh">Update via SSH</a></li></ul></li><li><a href="#update-uefi-firmware">Update UEFI firmware</a></li><li><a href="#update-scp-firmware">Update SCP firmware</a></li></ul></li><li><a href="#serial-console">Serial Console</a></li><li><a href="#reference">Reference</a></li><li><a href="#error-message">Error Message</a><ul><li><a href="#error-templateconf-value-which-is-nvme-openbmc-meta-ampere-meta-mitchell-must-point-to-meta-some-layer-conf-templates-template-name">Error: TEMPLATECONF value (which is /nvme/openbmc/meta-ampere/meta-mitchell) must point to meta-some-layer/conf/templates/template-name</a></li><li><a href="#initializing-oe-build-env">Initializing OE build env</a></li><li><a href="#">
</a></li></ul></li></ul></nav></div>



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



<h2 class="wp-block-heading" id="before-build-source-code">Before Build Source Code</h2>



<p>This procedure runs on ARM64 platform, it should be also run on x86 platform, but I have not try it. <br /><br />Build environment : Ampere eMAG CPU (32 cores) with 256G DRAM and uses 64G/128G RAM to build code, sometime if it cannot finsih compile tasks, probably your DRAM is not sufficient to build the code, I tried 16G and it doesn;t work.<br /><br />Because host is running Ubuntu 22.04, and OpenBMC and EDKII only can be built on Ubuntu 18.04, so, it needs to use either virtual machine or contianer technologies to have Ubuntu 18.04 environment. <br /><br />This note uses qemu to prepare build environment, tried docker but it doesn&#8217;t work, probably I will re-try it someday. </p>



<p>If use NFS or qemu overlayers filesystem to bridge folders ourside into VM, it might cause build problem, so, please increase disk size for you virtual machine virtual disk size, use nfs or share folder for copy images or source code only. <br /><br />If want to build a workable EDKII code and run it on Ampere Mt. Jade platform, it needs to have Ampere fimware ATF and SCP binary, it might register Ampere customer connect to download those image files, without it, it only can build OpenBMC binary. </p>



<h2 class="wp-block-heading" id="prepare-build-environment">Prepare Build Environment </h2>



<h3 class="wp-block-heading" id="get-the-ubuntu-18-04-cloud-image">Get the Ubuntu 18.04 cloud image</h3>



<pre class="wp-block-preformatted">$ wget https://cloud-images.ubuntu.com/releases/bionic/release/ubuntu-18.04-server-cloudimg-arm64.img
$ sudo apt install qemu-efi</pre>



<h3 class="wp-block-heading" id="prepare-hostname-and-userdata-for-vm">Prepare hostname and userdata for VM</h3>



<p>it needs to prepare two files, meta-file and user-data, following is example for meta-file </p>



<pre class="wp-block-preformatted">instance-id: Image-openbmc
local-hostname: openbmc
</pre>



<p>user-data file, this example username is ubuntu, password is ubuntu</p>



<pre class="wp-block-preformatted">#cloud-config
password: ubuntu
chpasswd: { expire: False }
ssh_pwauth: True
ssh_authorized_keys:
  - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+Y/6m4XFeEGKqR2H7wbsUQUVWvB0gC/+CeJqfyvOX++SETKapFtI5CiidkyW/B1GQM4XUlmE9zPlCAcolPfMpXB0CNQQ5l0F5Z+FW6b4RVjFV/KEcQ7R3XkKRa0XhC6hKkNc5P95fNhXr8Do1bSEmd9mPIiOrFaUEZ9EReO+ZTsGsytFIuQV8rOZfQjClktXrqk3F6jJ+TV3THcVNpKvnLfps56Hc/j9jdiadLv91yuifz4lCMbv/D/0hMtf4KhN5tV//QRgUxEUeC7aPW6sKD2GMYMxc9UsSyRRQ9IFWjJMkgzKyuxgNKe7u4WjERFoxEUrmFK01UsrX+lRw9e9n user@hostname
</pre>



<p>Than, it can create a configure file for QEMU</p>



<pre class="wp-block-preformatted">$ cloud-localds -v cloudinit.img user-data meta-file</pre>



<p>Increase Ubuntu cloud image disk size, bigger is better, suggest more than 200G, minimal should be around 100G.</p>



<pre class="wp-block-preformatted">$ qemu-img resize ubuntu-18.04-server-cloudimg-arm64.img +200G</pre>



<p>Prepare UEFI BIOS and storage for booting</p>



<pre class="wp-block-preformatted">dd if=/dev/zero of=flash0.img bs=1M count=64
dd if=/usr/share/qemu-efi/QEMU_EFI.fd of=flash0.img conv=notrunc
dd if=/dev/zero of=flash1.img bs=1M count=64</pre>



<p>Running the VM script, it will also create a QEMU virtfs for file sharing, but do not use that folder to build code. How to access share folder, it can reference this article <a href="https://blog.richliu.com/2017/09/25/2173/qemu-share-directory-with-host-without-networking/" target="_blank" rel="noreferrer noopener">QEMU Share Directory with Host Without Networking</a></p>



<p></p>



<pre class="wp-block-preformatted">IMAGE1=ubuntu-18.04-server-cloudimg-arm64.img
sudo qemu-system-aarch64 -name vm1 \
         -machine virt,gic_version=3,accel=kvm,usb=off \
         -cpu host -m 128G \
         -smp 32,sockets=1,cores=32,threads=1 \
         -nographic -nodefaults \
         -pflash flash0.img -pflash flash1.img \
         -drive file=$IMAGE1,if=none,id=disk1 \
         -device virtio-blk-device,drive=disk1 \
         -drive file=cloudinit.img,if=virtio,format=raw \
         -virtfs local,path=/nvme/obmc,mount_tag=host0,security_model=passthrough,id=host0 \
         -netdev tap,id=net0,ifname=tap0 \
         -device virtio-net-device,netdev=net0,mac=52:54:00:11:11:12 \
         -serial telnet::9001,server,nowait &gt; guest_log-1.txt 2&gt;&gt; guest_log-1.txt
</pre>



<h2 class="wp-block-heading" id="build-mt-jade-edkii">Build Mt. Jade EDKII</h2>



<h3 class="wp-block-heading" id="prepare-vm-environment">Prepare VM environment</h3>



<p>After login into VM, it needs to install software to compile EDKII. <br />Command to install basic packages. </p>



<pre class="wp-block-preformatted">sudo apt update 
sudo apt install -y git vim tmux lftp net-tools ethtool bc
sudo apt install -y \
  build-essential uuid-dev acpica-tools nasm \
  python3 python3-distutils python3-pip \
  gawk
sudo apt install -y libssl-dev gnu-efi
sudo apt install bison flex
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1</pre>



<p>Next step is follow this document to download Ampere EDKII source code  and setup enviroment. <br />https://github.com/AmpereComputing/edk2.git<br /><br />First, prepare build environment parameters, if VM reboot, it needs to re-run it. </p>



<pre class="wp-block-preformatted">export WORKSPACE=/nvme/tianocore<br />mkdir -p $WORKSPACE<br />cd $WORKSPACE<br /><s>export PACKAGES_PATH=$PWD/edk2:$PWD/edk2-platforms</s><br /># PACKAGES_PATH is default include path, sometimes miss package can include more directories here. <br /># if still cannot find some files, try to run submodules command on next step again. <br />export PACKAGES_PATH=$PWD/edk2:$PWD/edk2-platforms:$PWD/edk2-non-osi/:$PWD/edk2-platforms/Features/</pre>



<p>Chang into that folder, clone Ampere Computiner edk2 source code. </p>



<pre class="wp-block-preformatted">cd $WORKSPACE
git clone https://github.com/AmpereComputing/edk2.git
cd edk2
git submodule init &amp;&amp; git submodule update
cd ..
git clone https://github.com/AmpereComputing/edk2-platforms.git</pre>



<h3 class="wp-block-heading" id="get-build-environment">Get build environment</h3>



<p>This step is to build the basic tools.</p>



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

# Build BaseTool, only need to run once 
make -C edk2/BaseTools </pre>



<p>After compiled the EDK2 basic tool, next step is to prepare edk2-platforms and edk2-ampere-tools <br /><br />edk2-ampere-tools has a very good build script, <br />it can help to build the EDK2 and also package ATF into together. <br />we will introduct it on following steps. </p>



<pre class="wp-block-preformatted">cd edk2-platforms
git checkout -b test remotes/origin/ampere

# make a link to library to fix some problem
ln -sf /nvme/tianocore/edk2-platforms/Features/Intel/OutOfBandManagement .
cd ..
git clone https://github.com/AmpereComputing/edk2-ampere-tools
</pre>



<h3 class="wp-block-heading" id="build-and-sign-the-image">Build and Sign the image</h3>



<p>Because current tree Atftool migrate to OpenSSL 3.0, and Ubuntu 18.04 still use OpenSSL 1.0x, <br />I choice to roll back to old version to support OpenSSL 1.0x, support it can build Atftool on Ubuntu 22.04 or compile OpenSSL 3.0 manually, I might try it later. </p>



<pre class="wp-block-preformatted">cd /nvme/tianocore 
mkdir -p AtfTools
cd AtfTools
git init
git remote add origin -f https://github.com/ARM-software/arm-trusted-firmware.git
git config core.sparseCheckout true

echo -ne "include/tools_share\nmake_helpers\ntools/cert_create\ntools/fiptool" &gt; .git/info/sparse-checkout

git -C . checkout --track origin/master
# Due to current AtfTool only support OpenSSL 3.0 , switch to previous version 
git checkout -b test b94bf967e62b23a376a5026de69d06a0e8d6bf78
make -C tools/cert_create CRTTOOL=cert_create
$ make -C tools/fiptool FIPTOOL=fiptool</pre>



<p>configure PATH to  fiptool and cert_create</p>



<pre class="wp-block-preformatted">cd /nvme/tianocore
export PATH=$PATH:$PWD/AtfTools/tools/cert_create:$PWD/AtfTools/tools/fiptool
</pre>



<p>This step is parepare Mt. Jade ATF and SCP binary for compile, it needs to get both binary file from <a href="https://connect.amperecomputing.com/" target="_blank" rel="noreferrer noopener">Ampere customer connect</a>. and also suggest to use the same version as OpenBMC/EDKII</p>



<pre class="wp-block-preformatted">cd $WORKSPACE
mv &lt;path to&gt;/altra_atf_signed_2.06.20220426.slim .
mv &lt;path to&gt;/altra_scp_signed_2.06.20220426.slim .
cd edk2-ampere-tools
./edk2-build.sh -b RELEASE Jade --atf-image $WORKSPACE/altra_atf_signed_2.06.20220426.slim --scp-image $WORKSPACE/altra_scp_signed_2.06.20220426.slim</pre>



<p>If everything is perfect, the binary code would be looks like below. </p>



<pre class="wp-block-preformatted">Results: /nvme/tianocore/edk2-ampere-tools/BUILDS/jade_tianocore_atf_2.06.100
total 45888
-rw------- 1 root   root       3343 Jun 15 12:40 dbukey.auth
-rw------- 1 root   root       2002 Jun 15 12:40 del_dbukey.auth
-rw-r--r-- 1 root   root       2008 Jun 15 12:38 jade_board_setting.bin
-rw-rw-r-- 1 ubuntu ubuntu    14532 Jun 15 04:08 jade_board_setting.txt
-rw-r--r-- 1 root   root     670845 Jun 15 12:40 jade_scp_2.06.100.cap
-rw-r--r-- 1 root   root     262144 Jun 15 12:40 jade_scp_2.06.100.dbu.sig.img
-rw-r--r-- 1 root   root    8126464 Jun 15 12:38 jade_tianocore_2.06.100.fd
-rw-r--r-- 1 root   root   14040229 Jun 15 12:40 jade_tianocore_atf_2.06.100.cap
-rw-r--r-- 1 root   root   13631488 Jun 15 12:40 jade_tianocore_atf_2.06.100.dbu.sig.img
-rw-r--r-- 1 root   root   10225352 Jun 15 12:38 jade_tianocore_atf_2.06.100.img
------------------------------------------------------------
                          Ampere Jade (AARCH64) RELEASE pass
------------------------------------------------------------
pass    1
fail    0</pre>



<p id="block-c791d1c4-9fd3-4983-bb20-21d321ee9683">It can use the jade_tianocore_atf_2.06.100.img for firmware update. </p>



<p>Note:  When latest time I compile the edkII binary, latest version will fail to build, it need to roll back to previous version. </p>



<h3 class="wp-block-heading" id="manual-build-edkii">Manual Build EDKII</h3>



<p>If still want to build EDKII manually, here is some command can help you. </p>



<pre class="wp-block-preformatted">cd edk2-platform
build -a AARCH64 -t GCC5 -b RELEASE -D SECURE_BOOT_ENABLE -p Platform/Ampere/JadePkg/Jade.dsc
or to use all CPU to compile the EDKII.
build -n `nproc` -a AARCH64 -t GCC5 -b RELEASE -D SECURE_BOOT_ENABLE -p Platform/Ampere/JadePkg/Jade.dsc</pre>



<p>the generated image on $WORKSPACE/Build/Jade/RELEASE_GCC5/FV/BL33_JADE_UEFI.fd,<br />for this case, on the /nvme/tianocore/Build/Jade/RELEASE_GCC5/FV/BL33_JADE_UEFI.fd</p>



<p>then, it needs to use ampere special tool to generate EDKII image with Ampere ATF image.</p>



<h2 class="wp-block-heading" id="build-mt-jade-open-bmc">Build Mt. Jade OpenBMC</h2>



<h2 class="wp-block-heading" id="prepare-build-environment-1">Prepare build environment</h2>



<p>Before build OpenBMC, it needs to install necessary packages, <br />it can build both OpenBMC and EDKII on the same VM, or it can build it on different VM. <br /><br />Following is necessary packages for OpenBMC.</p>



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



<p>Download Open BMC source code and OpenBMC build script. </p>



<pre class="wp-block-preformatted">$ cd /nvme
$ git clone https://github.com/ampere-openbmc/openbmc.git
$ git clone https://github.com/openbmc/openbmc-build-scripts.git
</pre>



<p>modify openbmc-build-scripts/build-setup.sh around line #140, <br />replace &#8220;Clone in openbmc master to ${obmc_dir}&#8221; to https://github.com/ampere-openbmc/openbmc.git<br /><br />it can download right source code. </p>



<pre class="wp-block-preformatted">git clone ${branch} https://github.com/ampere-openbmc/openbmc.git</pre>



<p>If you use more than 32 cores to build the source code, it might cause compile fail because some compile tool might have problem on build code on ARM64 massive code. A easy way to check that is run dmesg to check whether Linux kernel has OOM killer on some package compile fail message like nodejs.<br /><br />Limited CPU number to 32 , modify openbmc-build-scripts/build-setup.sh, on line 84. </p>



<pre class="wp-block-preformatted"> 84 # num_cpu=${num_cpu:-$(nproc)}
 85 num_cpu=32
</pre>



<h2 class="wp-block-heading" id="build-open-bmc">Build OpenBMC</h2>



<p>This step is to prepare test build environment </p>



<pre class="wp-block-preformatted">$ cd /nvme
$ target=mtjade WORKSPACE=/nvme/openbmc branch="--branch ampere --single-branch" ./openbmc-build-scripts/build-setup.sh</pre>



<p>Setup openbmc machine type to mt. Jade and compile OpenBMC. </p>



<pre class="wp-block-preformatted">$ <s>export TEMPLATECONF=meta-ampere/meta-jade</s>
$ export TEMPLATECONF=meta-ampere/meta-jade/conf/templates/default/
$ export TMPDIR=/nvme/temp
$ export LC_ALL=en_US.UTF-8

$ cd /nvme/openbmc
$ . openbmc-env
$ cd ..
$ source ./setup mtjade
$ bitbake obmc-phosphor-image
</pre>



<p>if system it mt.mitchell</p>



<pre class="wp-block-preformatted">$ export TEMPLATECONF=meta-ampere/meta-mitchell/conf/templates/default/
$ export TMPDIR=/nvme/temp
$ export LC_ALL=en_US.UTF-8

$ cd /nvme/openbmc
$ . openbmc-env
$ cd ..
$ source ./setup mtmitchell-dcscm
$ bitbake obmc-phosphor-image</pre>



<p>When compile, there is an openocd compile error, it cannot access to original website probably caused by the website was down. Temperory solutoin is to remove the package. <br />modify file meta-ampere/meta-common/recipes-ac01/packagegroups/packagegroup-ampere-apps.bb, find openocd and delete it, down. </p>



<p>When finish compile, the binary will locate on tmp/deploy/images/mtjade/, absoult path is /nvme/openbmc/build/mtjade/tmp/deploy/images/mtjade/<br /><br />ex: (only list partical files)</p>



<pre class="wp-block-preformatted">obmc-phosphor-image-mtjade-20220616040212.rootfs.manifest
obmc-phosphor-image-mtjade-20220616040212.rootfs.squashfs-xz
obmc-phosphor-image-mtjade-20220616040212.static.mtd
obmc-phosphor-image-mtjade-20220616040212.static.mtd.all.tar
obmc-phosphor-image-mtjade-20220616040212.static.mtd.tar
obmc-phosphor-image-mtjade-20220616040212.testdata.json
obmc-phosphor-image-mtjade.jffs2
obmc-phosphor-initramfs-mtjade-20220616004506.rootfs.cpio.xz
obmc-phosphor-initramfs-mtjade-20220616004506.rootfs.manifest
obmc-phosphor-initramfs-mtjade-20220616004506.testdata.json
</pre>



<p>obmc-phosphor-image-mtjade-20220616040212.static.mtd.tar is firmware file, it contain both obmc-phosphor-image-mtjade-20220616040212.static.mtd and obmc-phosphor-image-mtjade-20220616040212.rootfs.manifest files, and can be used for next step : firmware update.</p>



<h2 class="wp-block-heading" id="upgrade-firmware">Upgrade Firmware</h2>



<p><strong><span class="has-inline-color has-luminous-vivid-orange-color">*Notice: Update flash will take your own risk, especially physical damage your hardware.. </span></strong> <br /><br />If Mt. Jade is using AMI bios, suggest to use flash burner to update the OpenBMC firmware. <br />What I am using is GZU EZP XPro , it&#8217;s very cheap, only needs around US$30.- (please also purchase the SPI flash socket). <br /><br />This step need to un-plug BMC flash from Mt. Jade motherboard, please remeber the flash pin 1 location, it needs to follow the original position and put it back to socket. If you miss you will broken it. <br /></p>



<h3 class="wp-block-heading" id="update-open-bmc-firmware">Update OpenBMC firmware</h3>



<p>ref. <a href="https://github.com/openbmc/docs/blob/master/architecture/code-update/code-update.md" target="_blank" rel="noopener">OpenBMC Code Update</a></p>



<h4 class="wp-block-heading" id="update-via-url">Update via URL</h4>



<p>Suppose that it already has OpenBMC firmware, it can use software to upgrade firmware ,<br />first step is to get web token, then use this token on next step to upgrade firmware. <br /><br />Following is a simple script to upgrade flash, it can be integrated into your script. </p>



<pre class="wp-block-preformatted">export BMC_IP=192.168.1.190
export FWFILE=obmc-phosphor-image-mtjade-20220616040212.static.mtd.tar

export token=`curl -k -H "Content-Type: application/json" -X POST https://${BMC_IP}/login -d '{"username" :  "root", "password" :  "0penBmc"}' | grep token | awk '{print $2;}' | tr -d '"'`

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    84  100    37  100    47    116    147 --:--:-- --:--:-- --:--:--   264


curl -k -H "X-Auth-Token: $token" \
       -H "Content-Type: application/octet-stream" \
       -X POST -T ${FWFILE} \
        https://${BMC_IP}/redfish/v1/UpdateService

{
  "@odata.id": "/redfish/v1/TaskService/Tasks/1",
  "@odata.type": "#Task.v1_4_3.Task",
  "Id": "1",
  "TaskState": "Running",
  "TaskStatus": "OK"
}</pre>



<p>If  conosle doesn&#8217;t not update and reboot, please use console login the OpenBMC and run &#8220;reboot&#8221; manually. <br />It will show message like below on OpenBMC console. </p>



<pre class="wp-block-preformatted">Updating kernel...
Erasing block: 69/69 (100%)
Writing kb: 4397/4397 (100%)
Verifying kb: 4397/4397 (100%)
Updating rofs...
Erasing block: 366/366 (100%)
Writing kb: 11580/23376 (49%)
</pre>



<h4 class="wp-block-heading" id="update-via-ssh">Update via SSH</h4>



<p>Just update firmware (ex: obmc-phosphor-image-mtjade-20220616040212.static.mtd.tar) to BMC&#8217;s directory /tmp/images , it will shows a hash number like /tmp/images/d6718c8f, then run the following command</p>



<pre class="wp-block-preformatted">busctl set-property xyz.openbmc_project.Software.BMC.Updater \<br />  /xyz/openbmc_project/software/d6718c8f \<br />  xyz.openbmc_project.Software.Activation RequestedActivation s \<br />  xyz.openbmc_project.Software.Activation.RequestedActivations.Active</pre>



<h3 class="wp-block-heading" id="update-uefi-firmware">Update UEFI firmware </h3>



<p>Upgrade UEFI firmware<br />it needs to pack the UEFI image first , and it need to create MANIFEST file, looks like this </p>



<pre class="wp-block-preformatted">VER_purpose=xyz.openbmc_project.Software.Version.VersionPurpose.Host
version=jade_tianocore_atf_2.06.100
KeyType=OpenBMC
HashType=RSA-SHA256
MachineName=mtjade
</pre>



<p>make image file and MINIFEST file into the same file</p>



<pre class="wp-block-preformatted">$ tar -cvf jade_tianocore_atf_2.06.100.tar jade_tianocore_atf_2.06.100.img MANIFEST </pre>



<p>Run command below to upgrade UEFI firmware</p>



<pre class="wp-block-preformatted">export BMC_IP=192.168.1.190

export FWFILE=jade_tianocore_atf_2.06.100.tar

export token=`curl -k -H "Content-Type: application/json" -X POST https://${BMC_IP}/login -d '{"username" :  "root", "password" :  "0penBmc"}' | grep token | awk '{print $2;}' | tr -d '"'`

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    84  100    37  100    47    116    147 --:--:-- --:--:-- --:--:--   264


curl -k -H "X-Auth-Token: $token" \
       -H "Content-Type: application/octet-stream" \
       -X POST -T ${FWFILE} \
        https://${BMC_IP}/redfish/v1/UpdateService

</pre>



<p>Like OpenBMC, if it doesn&#8217;t update, just reboot to update it. <br />if stiall not work, try to upgrade it manually, yes, when I wrote this article, update via redfish doesn&#8217;t work, so, just copy it from github.</p>



<pre class="wp-block-preformatted"># on HOST
$ scp jade_tianocore_atf_2.06.100.tar root@192.168.1.190:/tmp

# on Target 
$ cd /tmp/images
$ mkdir fw
$ cd fw
$ tar xvf /tmp/jade_tianocore_atf_2.06.100.tar
$ firmware_update.sh /tmp/images/fw
--- Current Chassis State: On
--- Turning the Chassis off
--- Switch the host SPI bus to BMC.
Run update Primary Host SPI-NOR
--- Bind the ASpeed SMC driver
--- Locking power control
--- Flashing firmware to @/dev/mtd13
Erasing block: 157/157 (100%)
Writing kb: 9985/9985 (100%)
Verifying kb: 9985/9985 (100%)
--- Unlocking power control
--- Switch back to the primary Host SPI-NOR.
Turn on the Host
</pre>



<h3 class="wp-block-heading" id="update-scp-firmware">Update SCP firmware</h3>



<p>It needs to use sftp to transfer SCP firmware to target. <br />Following is example to upgrade SCP firmware.</p>



<pre class="wp-block-preformatted">On host
$ scp altra_scp_signed_2.06.20220426.slim root@192.168.1.190:/tmp

On OpenBMC side
$ ampere_firmware_upgrade.sh smpmpro /tmp/altra_scp_signed_2.06.20220426.slim</pre>



<p>After upgrade BIOS and SCP, if got any problem, suggest to reset bmc </p>



<pre class="wp-block-preformatted">$ ipmitool -U root -P 0penBmc -I lanplus -C 17 -H 192.168.2.18 mc reset cold</pre>



<h2 class="wp-block-heading" id="serial-console">Serial Console</h2>



<p>it can use command to get system CPU console.</p>



<pre class="wp-block-preformatted"># CPU console 
$ ssh root@192.168.190 -p 2200 
</pre>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1124" height="739" src="https://blog.richliu.com/wp-content/uploads/2022/06/image.png" alt="" class="wp-image-4631" srcset="https://blog.richliu.com/wp-content/uploads/2022/06/image.png 1124w, https://blog.richliu.com/wp-content/uploads/2022/06/image-600x394.png 600w, https://blog.richliu.com/wp-content/uploads/2022/06/image-768x505.png 768w" sizes="(max-width: 1124px) 100vw, 1124px" /></figure>



<h2 class="wp-block-heading" id="reference">Reference</h2>



<p><a href="https://github.com/ampere-openbmc/openbmc" target="_blank" rel="noreferrer noopener">Ampere OpenBMC github</a><br /><a href="https://github.com/AmpereComputing/edk2-ampere-tools" target="_blank" rel="noreferrer noopener">EDK2 Ampere Tool</a><br /><a href="https://github.com/AmpereComputing/edk2" target="_blank" rel="noreferrer noopener">Ampere EDK2</a><br /><a href="https://github.com/AmpereComputing" target="_blank" rel="noreferrer noopener">Ampere Computing Github</a></p>



<h2 class="wp-block-heading" id="error-message">Error Message </h2>



<h3 class="wp-block-heading" id="error-templateconf-value-which-is-nvme-openbmc-meta-ampere-meta-mitchell-must-point-to-meta-some-layer-conf-templates-template-name">Error: TEMPLATECONF value (which is /nvme/openbmc/meta-ampere/meta-mitchell) must point to meta-some-layer/conf/templates/template-name</h3>



<p>Error message </p>



<h3 class="wp-block-heading" id="initializing-oe-build-env">Initializing OE build env</h3>



<pre class="wp-block-preformatted">Error: TEMPLATECONF value (which is /nvme/openbmc/meta-ampere/meta-mitchell) must point to meta-some-layer/conf/templates/template-name</pre>



<p>This is because followed the old configuration, it needs to point to right folder like</p>



<pre class="wp-block-preformatted">export TEMPLATECONF=meta-ampere/meta-jade/conf/templates/default/
. openbmc-env</pre>



<p>.</p>



<h3 class="wp-block-heading"><br /></h3>
<p>The post <a rel="nofollow" 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> 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/2022/06/23/4601/ampere-altra-mt-jade-openbmc-build-guide-on-arm64-platform/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
