<?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>Nvidia &#8211; richliu&#039;s blog</title>
	<atom:link href="https://richliu.com/tag/nvidia/feed/" rel="self" type="application/rss+xml" />
	<link>https://richliu.com</link>
	<description>Linux, 工作, 生活, 家人</description>
	<lastBuildDate>Wed, 12 Feb 2025 09:18:26 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>GPU Passthrough on ARM64 with Libvirt/Virt-manager</title>
		<link>https://richliu.com/2025/02/12/6182/gpu-passthrough-on-arm64-with-libvirt-virt-manager/</link>
					<comments>https://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://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://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://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://richliu.com/wp-content/uploads/2025/02/image-4.png" alt="" class="wp-image-6183" srcset="https://richliu.com/wp-content/uploads/2025/02/image-4.png 1280w, https://richliu.com/wp-content/uploads/2025/02/image-4-600x361.png 600w, https://richliu.com/wp-content/uploads/2025/02/image-4-768x462.png 768w, https://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://richliu.com/wp-content/uploads/2025/02/image-5.png" alt="" class="wp-image-6184" srcset="https://richliu.com/wp-content/uploads/2025/02/image-5.png 1023w, https://richliu.com/wp-content/uploads/2025/02/image-5-600x371.png 600w, https://richliu.com/wp-content/uploads/2025/02/image-5-768x474.png 768w, https://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://richliu.com/wp-content/uploads/2025/02/image-6.png" alt="" class="wp-image-6185" srcset="https://richliu.com/wp-content/uploads/2025/02/image-6.png 1046w, https://richliu.com/wp-content/uploads/2025/02/image-6-600x371.png 600w, https://richliu.com/wp-content/uploads/2025/02/image-6-768x474.png 768w, https://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://richliu.com/wp-content/uploads/2025/02/image-7.png" alt="" class="wp-image-6186" srcset="https://richliu.com/wp-content/uploads/2025/02/image-7.png 973w, https://richliu.com/wp-content/uploads/2025/02/image-7-600x390.png 600w, https://richliu.com/wp-content/uploads/2025/02/image-7-768x499.png 768w, https://richliu.com/wp-content/uploads/2025/02/image-7-816x530.png 816w" sizes="auto, (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://richliu.com/wp-content/uploads/2025/02/image-8.png" alt="" class="wp-image-6188" srcset="https://richliu.com/wp-content/uploads/2025/02/image-8.png 1280w, https://richliu.com/wp-content/uploads/2025/02/image-8-600x241.png 600w, https://richliu.com/wp-content/uploads/2025/02/image-8-768x309.png 768w, https://richliu.com/wp-content/uploads/2025/02/image-8-816x328.png 816w" sizes="auto, (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://richliu.com/wp-content/uploads/2025/02/image-9.png" alt="" class="wp-image-6189" srcset="https://richliu.com/wp-content/uploads/2025/02/image-9.png 1280w, https://richliu.com/wp-content/uploads/2025/02/image-9-600x362.png 600w, https://richliu.com/wp-content/uploads/2025/02/image-9-768x463.png 768w, https://richliu.com/wp-content/uploads/2025/02/image-9-816x492.png 816w" sizes="auto, (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://richliu.com/wp-content/uploads/2025/02/image-10.png" alt="" class="wp-image-6190" srcset="https://richliu.com/wp-content/uploads/2025/02/image-10.png 1280w, https://richliu.com/wp-content/uploads/2025/02/image-10-600x270.png 600w, https://richliu.com/wp-content/uploads/2025/02/image-10-768x346.png 768w, https://richliu.com/wp-content/uploads/2025/02/image-10-816x368.png 816w" sizes="auto, (max-width: 1280px) 100vw, 1280px" /></figure>



<p></p>



<p></p>



<p></p>



<p></p>
<p>The post <a rel="nofollow" href="https://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://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://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>How to Install Stable Diffusion GUI on ARM64 Nvidia RTX platform</title>
		<link>https://richliu.com/2024/02/21/5808/how-to-install-stable-diffusion-gui-on-arm64-nvidia-rtx-platform/</link>
					<comments>https://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://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://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://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://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://richliu.com/wp-content/uploads/2024/02/image-16.png 1744w, https://richliu.com/wp-content/uploads/2024/02/image-16-600x405.png 600w, https://richliu.com/wp-content/uploads/2024/02/image-16-768x518.png 768w, https://richliu.com/wp-content/uploads/2024/02/image-16-1536x1037.png 1536w, https://richliu.com/wp-content/uploads/2024/02/image-16-816x551.png 816w" sizes="auto, (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://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://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://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>Run Keras or TensorFlow in WSL2 with Nvidia GPU</title>
		<link>https://richliu.com/2023/06/23/5238/run-keras-or-tensorflow-in-wsl2-with-nvidia-gpu/</link>
					<comments>https://richliu.com/2023/06/23/5238/run-keras-or-tensorflow-in-wsl2-with-nvidia-gpu/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Fri, 23 Jun 2023 07:17:00 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[CUDA]]></category>
		<category><![CDATA[gpu]]></category>
		<category><![CDATA[Keras]]></category>
		<category><![CDATA[Nvidia]]></category>
		<category><![CDATA[Tensorflow]]></category>
		<category><![CDATA[WSL2]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=5238</guid>

					<description><![CDATA[<p>When this article is finished, it will still be unable  [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2023/06/23/5238/run-keras-or-tensorflow-in-wsl2-with-nvidia-gpu/">Run Keras or TensorFlow in WSL2 with Nvidia GPU</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>When this article is finished, it will still be unable to run Keras or TensorFlow within Conda or a virtual environment. This is because TensorFlow/Keras will display an error message similar to the one below (cut):</p>



<pre class="wp-block-preformatted">Node: 'model_3/conv1d_24/Conv1D' 
DNN library is not found. 	 [[{{node model_3/conv1d_24/Conv1D}}]] [Op:__inference_train_function_34509]</pre>



<p>It seems that there may be compatibility issues between the versions of TensorFlow/Keras installed outside of Conda and those installed within Conda. But it maybe also cause by tensorflow 2.12 has issue, please re-install 2.10 and try again . <br />Specified version can work well cuDNN 8.9, CUDA 11.8 and TensorFlow 2.10. <br />Here is how to re-install tensorflow 2.10 instruction.<br /></p>



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



<pre class="wp-block-preformatted">pip uninstall tensorflow
pip install tensorflow-gpu
pip install tensorflow-gpu==2.10 </pre>



<p><br />ref. <br /><a href="https://github.com/tensorflow/tensorflow/issues/60101" target="_blank" rel="noreferrer noopener">TensorFlow 2.12.0 WSL2 GPU support</a></p>



<p>Have tried someother way, all of them doesn&#8217;t work when you use 2.12 tensorflow. Don&#8217;t try this. ex:</p>



<pre class="wp-block-preformatted">sudo cp cuda/include/cudnn*.h   /anaconda3/envs/&lt;your environment here&gt;/include
sudo cp cuda/lib64/libcudnn*    /anaconda3/envs/&lt;your environment here&gt;/lib
sudo chmod a+r /usr/local/cuda/include/cudnn*.h    /anaconda3/envs/&lt;your environment here&gt;/lib/libcudnn*</pre>



<p>ref.<br /><a href="https://stackoverflow.com/questions/55256671/how-to-install-latest-cudnn-to-conda" target="_blank" rel="noreferrer noopener">How to install latest cuDNN to conda?</a></p>



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



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



<p>Suppose it already install WSL2 on your system, please follow the <a href="https://docs.nvidia.com/cuda/wsl-user-guide/index.html" target="_blank" rel="noreferrer noopener">CUDA on WSL User Guide</a> to install WSL, for Tensorflow 2.12, suggestion CUDA version is 11.8. <a href="https://developer.nvidia.com/cuda-11-8-0-download-archive?target_os=Linux&amp;target_arch=x86_64&amp;Distribution=WSL-Ubuntu&amp;target_version=2.0&amp;target_type=deb_local" target="_blank" rel="noreferrer noopener">Can be found here CUDA Toolkit 11.8 Downloads</a></p>



<pre class="wp-block-preformatted">wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-wsl-ubuntu.pin
sudo mv cuda-wsl-ubuntu.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda-repo-wsl-ubuntu-11-8-local_11.8.0-1_amd64.deb
sudo dpkg -i cuda-repo-wsl-ubuntu-11-8-local_11.8.0-1_amd64.deb
sudo cp /var/cuda-repo-wsl-ubuntu-11-8-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda</pre>



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



<p>It still needs to install CUDNN, follow this instruction to download CUDNN 8.9.x, <a href="https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html#install-linux" target="_blank" rel="noopener">Installing cuDNN on Linux</a>. Download cuDNN needs to register Nvidia account. <br />Download address : <a href="https://developer.nvidia.com/rdp/cudnn-download" target="_blank" rel="noreferrer noopener">cuDNN Download</a>, it has cuDNN for CUDA 12 and CUDA 11, download for CUDA 11. </p>



<h3 class="wp-block-heading">Add Path to System Path</h3>



<p>Put following seting into ~/.bashrc, thus it can update when get bash console </p>



<pre class="wp-block-preformatted">export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH</pre>



<h3 class="wp-block-heading">Follow tensorflow install guide to install tensorflow.</h3>



<p><a href="https://www.tensorflow.org/install/pip#windows-wsl2_1" target="_blank" rel="noreferrer noopener">Tensorflow step by step instructions for WSL2</a></p>



<h2 class="wp-block-heading">Python Virtual Environment</h2>



<p>if use virtual venv, it also can work, just need to install right version tensorflow. and it needs to configure cuDNN path on activate script </p>



<pre class="wp-block-preformatted">vim &lt;path to venv&gt;/bin/activate

# After get VIRTUAL_ENV, include the CUDNN path
export VIRTUAL_ENV

CUDNN_PATH=$(dirname $(python -c "import nvidia.cudnn;print(nvidia.cudnn.__file__)"))
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$VIRTUAL_ENV/lib/:$CUDNN_PATH/lib
</pre>



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



<p><a href="https://hackmd.io/@Kailyn/HkSTXL9xK" target="_blank" rel="noreferrer noopener">WSL2 安裝 CUDA Toolkit、cuDNN</a></p>



<p><br /></p>
<p>The post <a rel="nofollow" href="https://richliu.com/2023/06/23/5238/run-keras-or-tensorflow-in-wsl2-with-nvidia-gpu/">Run Keras or TensorFlow in WSL2 with Nvidia GPU</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2023/06/23/5238/run-keras-or-tensorflow-in-wsl2-with-nvidia-gpu/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>FauxPilot local Copilot Server</title>
		<link>https://richliu.com/2022/08/07/4784/fauxpilot-local-copilot-server/</link>
					<comments>https://richliu.com/2022/08/07/4784/fauxpilot-local-copilot-server/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sun, 07 Aug 2022 14:24:36 +0000</pubDate>
				<category><![CDATA[隨手札記]]></category>
		<category><![CDATA[copilot]]></category>
		<category><![CDATA[Fauxpilot]]></category>
		<category><![CDATA[Nvidia]]></category>
		<category><![CDATA[VScode]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=4784</guid>

					<description><![CDATA[<p>FauxPiolt 是一個採用 SalesForce CodeGen 模型加上 Nvidia Triton I [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2022/08/07/4784/fauxpilot-local-copilot-server/">FauxPilot local Copilot Server</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p><a href="https://github.com/moyix/fauxpilot" target="_blank" rel="noreferrer noopener">FauxPiolt </a>是一個採用 SalesForce CodeGen 模型加上 Nvidia Triton Inference Server 的 Copilot server 取代品. 也就是說，不需要使用 github 的 copilot 的服務就可以使用 copilot 了<br /></p>



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



<p>因為之前想要在 Windows 玩遊戲，又想要學一些 AI 的東西，所以後來裝了 WSL2 加上 Nvidia driver <br /><br />如果要在這個環境下跑 FauxPilot ，那就要裝 Docker Windows 版，然後開啟 WSL2 的支援，雖然 Microsoft 也有說明，我覺得 <a href="https://docs.docker.com/desktop/windows/wsl/" target="_blank" rel="noreferrer noopener">Docker 這邊的說明比較好</a></p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" src="https://richliu.com/wp-content/uploads/2022/08/image.png" alt="" class="wp-image-4785" width="379" height="224" srcset="https://richliu.com/wp-content/uploads/2022/08/image.png 1055w, https://richliu.com/wp-content/uploads/2022/08/image-600x355.png 600w, https://richliu.com/wp-content/uploads/2022/08/image-768x455.png 768w" sizes="auto, (max-width: 379px) 100vw, 379px" /></figure>



<p>現在 FauxPilot 的版本已經可以支援 8GB 的顯示卡了，選 7GB 的 codegen 就可以了<br />如果更大 codegen model 的可以用二張顯示卡，這樣就可以支援了<br /><br />我照圖中的步驟安裝沒有什麼問題，有問題的應該是 VSCode copilot 的部份，按照 Fauxpilot 設定，並不會轉到 localhost:5000 ，猜測可能已經拿掉支援了或是我沒設定好<br /><br />不過上面那個 openai 的 Sample code 就是可以直接存取，那個 sample code 不需要取得 openai 的 api key，直接用就可以，應該是 Nvidia server 自帶的功能</p>



<p>有人寫了一個 vscode-fauxpilot 的 extension ，下載位置在<strong><a href="https://github.com/Venthe/vscode-fauxpilot/releases" target="_blank" rel="noreferrer noopener">這邊</a></strong>，試了一下可以玩，簡單的測試了一下<br />要什麼功能就先 ### 你要的的功能，接下來就會顯示程式碼，再用 tab 就可以補完了，還頗有趣的</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="568" height="227" src="https://richliu.com/wp-content/uploads/2022/08/image-1.png" alt="" class="wp-image-4805"/></figure>



<p>ref.<br /><a href="https://blog.gslin.org/archives/2022/08/04/10822/%E8%B7%91%E5%9C%A8%E6%9C%AC%E6%A9%9F%E7%9A%84-github-copilot-%E6%9B%BF%E4%BB%A3%E5%93%81/" target="_blank" rel="noopener">跑在本機的 GitHub Copilot 替代品</a></p>
<p>The post <a rel="nofollow" href="https://richliu.com/2022/08/07/4784/fauxpilot-local-copilot-server/">FauxPilot local Copilot Server</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2022/08/07/4784/fauxpilot-local-copilot-server/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>KDE Plasma CPU High Usage After Install Nvidia Driver</title>
		<link>https://richliu.com/2021/03/07/4401/kde-plasma-cpu-high-usage-after-install-nvidia-driver/</link>
					<comments>https://richliu.com/2021/03/07/4401/kde-plasma-cpu-high-usage-after-install-nvidia-driver/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sun, 07 Mar 2021 03:36:16 +0000</pubDate>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[Nvidia]]></category>
		<category><![CDATA[plasma]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=4401</guid>

					<description><![CDATA[<p>My notebook with RTX3060 has this issue after do someth [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2021/03/07/4401/kde-plasma-cpu-high-usage-after-install-nvidia-driver/">KDE Plasma CPU High Usage After Install Nvidia Driver</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>My notebook with RTX3060 has this issue after do something I don&#8217;t know. OS is Ubuntu 18.04<br /><br />Everything is ok after first time install RTX3060, there is no high cpu issue, but after install IME(gcin), nomachine and anydesk and do something I don&#8217;t remember, plasma high cpu usage issue happened. </p>



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



<p>Tried to uninstall anydesk, nomachine and gcin, but those actions cannot solve this issue. <br /><br />but one time, when plasma cpu usage 100%, the nvidia-smi command shows GPU usage 100%, so I think whether if prevent plasma to use nvidia, it might solve this issue temporary ? </p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="990" height="566" src="https://richliu.com/wp-content/uploads/2021/03/plasma-nvidia-normal.png" alt="" class="wp-image-4402" srcset="https://richliu.com/wp-content/uploads/2021/03/plasma-nvidia-normal.png 990w, https://richliu.com/wp-content/uploads/2021/03/plasma-nvidia-normal-600x343.png 600w, https://richliu.com/wp-content/uploads/2021/03/plasma-nvidia-normal-768x439.png 768w" sizes="auto, (max-width: 990px) 100vw, 990px" /><figcaption>Plasma CPU / GPU usage is normal</figcaption></figure>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="989" height="574" src="https://richliu.com/wp-content/uploads/2021/03/plasma-nvidia-cpu-high.png" alt="" class="wp-image-4403" srcset="https://richliu.com/wp-content/uploads/2021/03/plasma-nvidia-cpu-high.png 989w, https://richliu.com/wp-content/uploads/2021/03/plasma-nvidia-cpu-high-600x348.png 600w, https://richliu.com/wp-content/uploads/2021/03/plasma-nvidia-cpu-high-768x446.png 768w" sizes="auto, (max-width: 989px) 100vw, 989px" /><figcaption>Plasma CPU / GPU usage is high.</figcaption></figure>



<p>Notebook has intel i915 driver, so, prevent plasma to use GPU can solve this issue. <br /><br />First modify <code>/usr/share/X11/xorg.conf.d/11-nvidia-prime.conf</code> and replace it with text below </p>



<pre class="wp-block-code"><code># DO NOT EDIT. AUTOMATICALLY GENERATED BY gpu-manager

Section "OutputClass"
    Identifier "Nvidia Prime"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    Option "IgnoreDisplayDevices" "CRT"
    # Option "PrimaryGPU" "Yes"
    ModulePath "/x86_64-linux-gnu/nvidia/xorg"
EndSection


Section "OutputClass"
    Identifier "intel"
    MatchDriver "i915"
    Driver "modesetting"
    Option "PrimaryGPU" "yes"
EndSection
</code></pre>



<p>Protect the file will not be overwrite by gpu-manager</p>



<pre class="wp-block-code"><code>chattr +i /usr/share/X11/xorg.conf.d/11-nvidia-prime.conf</code></pre>



<p>Reboot system and run nvidia-smi, plasma will not use nvidia GPU, so my plasma cpu usage 100% issue disappear. <br /><br />this solution might not solve all plasma 100% cpu usage issue, but might be one possible solution.</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="990" height="493" src="https://richliu.com/wp-content/uploads/2021/03/plasma-without-gpu.png" alt="" class="wp-image-4404" srcset="https://richliu.com/wp-content/uploads/2021/03/plasma-without-gpu.png 990w, https://richliu.com/wp-content/uploads/2021/03/plasma-without-gpu-600x299.png 600w, https://richliu.com/wp-content/uploads/2021/03/plasma-without-gpu-768x382.png 768w" sizes="auto, (max-width: 990px) 100vw, 990px" /><figcaption>Plasma without GPU</figcaption></figure>



<p>Detail information which can refer to this url  <a href="https://askubuntu.com/questions/1061551/how-to-configure-igpu-for-xserver-and-nvidia-gpu-for-cuda-work" target="_blank" rel="noopener">How to configure iGPU for xserver and nvidia GPU for CUDA work</a><br /></p>
<p>The post <a rel="nofollow" href="https://richliu.com/2021/03/07/4401/kde-plasma-cpu-high-usage-after-install-nvidia-driver/">KDE Plasma CPU High Usage After Install Nvidia Driver</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2021/03/07/4401/kde-plasma-cpu-high-usage-after-install-nvidia-driver/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>T420s Windows Firefox 速度奇慢的問題</title>
		<link>https://richliu.com/2013/01/17/1370/t420s-windows-firefox-%e9%80%9f%e5%ba%a6%e5%a5%87%e6%85%a2%e7%9a%84%e5%95%8f%e9%a1%8c/</link>
					<comments>https://richliu.com/2013/01/17/1370/t420s-windows-firefox-%e9%80%9f%e5%ba%a6%e5%a5%87%e6%85%a2%e7%9a%84%e5%95%8f%e9%a1%8c/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Thu, 17 Jan 2013 13:15:21 +0000</pubDate>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Nvidia]]></category>
		<category><![CDATA[slow]]></category>
		<category><![CDATA[T420s]]></category>
		<category><![CDATA[慢]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=1370</guid>

					<description><![CDATA[<p>不知道什麼時候開始, 我的 Firefox 就變得奇慢無比, 有時速度又很正常. 我找來找去都找不到原因, 有 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2013/01/17/1370/t420s-windows-firefox-%e9%80%9f%e5%ba%a6%e5%a5%87%e6%85%a2%e7%9a%84%e5%95%8f%e9%a1%8c/">T420s Windows Firefox 速度奇慢的問題</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>不知道什麼時候開始, 我的 Firefox 就變得奇慢無比, 有時速度又很正常.<br />
我找來找去都找不到原因, 有時一開始正常, 都是用一陣子之後又變慢了, 有時關掉重開可以恢復, 有時又不行.<br />
Chrome 和 IE 都比 Firefox 順. </p>
<p>有看過官網的文章 <a href="http://support.mozilla.org/zh-TW/kb/firefox-slow-how-make-it-faster" target="_blank" rel="noopener">Firefox is slow &#8211; How to make it faster</a>, 但是仍然無效. </p>
<p>最近心血來潮, 用 Google 找 Firefox Nvidia slow, 發現很多人都和我遇到相同的問題, 但是大多數都是在 Linux 平台, 少數是在 Windows 平台, </p>
<p>大家都提到關掉 Nvidia 3D 加速的功能可以讓 Firefox 恢復正常, 實際執行之後, Firefox 終於恢復正常速度了. </p>
<p>因為我用的是 Thinkpad T420s, 有個 <a href="http://www.nvidia.com/object/notebook-nvs.html" target="_blank" rel="noopener">Notebook Nvs Optimus </a>技術, 所以可能是使用內建顯卡時, 速度就會正常, 如果是用 Nvidia 顯示時, 速度就會變慢.<br />
具體狀況我也是沒有查到, 如果知道的人還望通知. </p>
<p>下載新版的 Nvidia Driver 有改善，但是經過一天的測試, 認為預設設定還是該使用 Intel 內顯效能比較好, 不要再用 Nvidia 3D 加速. </p>
<p>此圖是 Nvidia Firefox 的設定<br />
<a href="http://www.flickr.com/photos/richliu_tw/8388613199/" title="nvidia-2 by richliu(有錢劉), on Flickr" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="http://farm9.staticflickr.com/8326/8388613199_6aba3cd2a6.jpg" width="500" height="353" alt="nvidia-2"/></a><br />
照著設就好了. </p>
<p>留此文供大家 Google.</p>
<p>Ref<br />
<a href="http://support.mozilla.org/zh-TW/questions/924050" target="_blank" rel="noopener">Why is Firefox running super slow and IE runs great? New details 03/29</a></p>
<p>The post <a rel="nofollow" href="https://richliu.com/2013/01/17/1370/t420s-windows-firefox-%e9%80%9f%e5%ba%a6%e5%a5%87%e6%85%a2%e7%9a%84%e5%95%8f%e9%a1%8c/">T420s Windows Firefox 速度奇慢的問題</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2013/01/17/1370/t420s-windows-firefox-%e9%80%9f%e5%ba%a6%e5%a5%87%e6%85%a2%e7%9a%84%e5%95%8f%e9%a1%8c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
