<?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>Software &#8211; richliu&#039;s blog</title>
	<atom:link href="https://richliu.com/category/computer/software/feed/" rel="self" type="application/rss+xml" />
	<link>https://richliu.com</link>
	<description>Linux, 工作, 生活, 家人</description>
	<lastBuildDate>Sat, 31 May 2025 04:23:13 +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>CyberPower UPS + Apcupsd + Gafana + InfluxDB</title>
		<link>https://richliu.com/2025/05/31/6302/cyberpower-ups-apcupsd-gafana-influxdb/</link>
					<comments>https://richliu.com/2025/05/31/6302/cyberpower-ups-apcupsd-gafana-influxdb/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sat, 31 May 2025 04:23:11 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[apcupsd]]></category>
		<category><![CDATA[Gafana]]></category>
		<category><![CDATA[influxdb]]></category>
		<category><![CDATA[UPS]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=6302</guid>

					<description><![CDATA[<p>因為最近想到不能只是接上 apcupsd ，應該要接上 Gafana 看一下 UPS 的狀況，不過目前 Gaf [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2025/05/31/6302/cyberpower-ups-apcupsd-gafana-influxdb/">CyberPower UPS + Apcupsd + Gafana + InfluxDB</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>因為最近想到不能只是接上 apcupsd ，應該要接上 Gafana 看一下 UPS 的狀況，不過目前 Gafana 預設的 Dashboard 都沒有支援 CyberPower UPS 的，所以就自己改一個，還有點怪怪的問題，不過至少主要數據都是正確的</p>



<p>用 AI 產出來的 configuration files ，DeepSeek 看起來比較正確，只是 Dashboard 跟 Grox 一樣都會錯，到是 Grox 在設定 Gafana 的 influxdB data source 的地方講對了，查詢種類要選 flux 才可以查到資料</p>



<p>試過了 Prometheus，結果發現可用的 Dashboard 更少，感覺沒過幾年世界就變了</p>



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



<p>設定檔我覺得可以丟給 AI ，畢竟我跑在 VM 內部又用 docker 跑，相對上還是麻煩了一點</p>



<p>至於 Gafana 的設定檔我就丟在這邊，堪用還有些小問題但是懶得修了，我只想看 input output 狀態而已<br /><a href="https://github.com/richliu/cp_apc_dash" target="_blank" rel="noopener">https://github.com/richliu/cp_apc_dash</a></p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="2345" height="968" src="https://richliu.com/wp-content/uploads/2025/05/image-28.png" alt="" class="wp-image-6303" srcset="https://richliu.com/wp-content/uploads/2025/05/image-28.png 2345w, https://richliu.com/wp-content/uploads/2025/05/image-28-600x248.png 600w, https://richliu.com/wp-content/uploads/2025/05/image-28-768x317.png 768w, https://richliu.com/wp-content/uploads/2025/05/image-28-1536x634.png 1536w, https://richliu.com/wp-content/uploads/2025/05/image-28-2048x845.png 2048w, https://richliu.com/wp-content/uploads/2025/05/image-28-816x337.png 816w" sizes="(max-width: 2345px) 100vw, 2345px" /></figure>
<p>The post <a rel="nofollow" href="https://richliu.com/2025/05/31/6302/cyberpower-ups-apcupsd-gafana-influxdb/">CyberPower UPS + Apcupsd + Gafana + InfluxDB</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/05/31/6302/cyberpower-ups-apcupsd-gafana-influxdb/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Ｗindows 11 瀏覽器圖片無法顯示/ERR_SSL_PROTOCOL_ERROR</title>
		<link>https://richliu.com/2024/07/21/6002/%ef%bd%97indows-11-%e7%80%8f%e8%a6%bd%e5%99%a8%e5%9c%96%e7%89%87%e7%84%a1%e6%b3%95%e9%a1%af%e7%a4%ba-err_ssl_protocol_error/</link>
					<comments>https://richliu.com/2024/07/21/6002/%ef%bd%97indows-11-%e7%80%8f%e8%a6%bd%e5%99%a8%e5%9c%96%e7%89%87%e7%84%a1%e6%b3%95%e9%a1%af%e7%a4%ba-err_ssl_protocol_error/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sun, 21 Jul 2024 05:09:23 +0000</pubDate>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Windows 11]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=6002</guid>

					<description><![CDATA[<p>這幾天碰到的一個怪問題，就是在瀏覽很多網站的時候，很多照片會出不來，但是又不是完全出不來。偶爾會出現幾張 如果 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2024/07/21/6002/%ef%bd%97indows-11-%e7%80%8f%e8%a6%bd%e5%99%a8%e5%9c%96%e7%89%87%e7%84%a1%e6%b3%95%e9%a1%af%e7%a4%ba-err_ssl_protocol_error/">Ｗindows 11 瀏覽器圖片無法顯示/ERR_SSL_PROTOCOL_ERROR</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>這幾天碰到的一個怪問題，就是在瀏覽很多網站的時候，很多照片會出不來，但是又不是完全出不來。偶爾會出現幾張</p>



<p>如果清楚瀏覽紀錄和同步系統時間也沒有用，那就有可能是系統安裝的憑證作怪</p>



<p>沒有將解決過程截圖，但是大概講一下解決思路</p>



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



<p>首先就是用 Chrome or Edge ，排除掉 Plugin 的問題，如果不知道也沒關係，先關掉自己知道的 Plugin 就好，像是 ublock </p>



<p>然後開 F12 進 debug 模式，選 Network 標籤（以下非出事機器，僅為示意圖）</p>



<figure class="wp-block-image size-full"><img decoding="async" width="2450" height="1164" src="https://richliu.com/wp-content/uploads/2024/07/image.png" alt="" class="wp-image-6003" srcset="https://richliu.com/wp-content/uploads/2024/07/image.png 2450w, https://richliu.com/wp-content/uploads/2024/07/image-600x285.png 600w, https://richliu.com/wp-content/uploads/2024/07/image-768x365.png 768w, https://richliu.com/wp-content/uploads/2024/07/image-1536x730.png 1536w, https://richliu.com/wp-content/uploads/2024/07/image-2048x973.png 2048w, https://richliu.com/wp-content/uploads/2024/07/image-816x388.png 816w" sizes="(max-width: 2450px) 100vw, 2450px" /></figure>



<p>然後按 Reload (or Ctrl+R) 重讀頁面，記得是在 Status 的地方會顯示原因，我碰到的是 net::ERR_SSL_PROTOCOL_ERROR</p>



<p>如果運氣好直接在頁面無法顯示，並且出現 ERR_SSL_PROTOCOL_ERROR 在首頁，那應該也適用</p>



<p><strong>解法就是移除掉系統內不明的認證</strong></p>



<p>打開 Edge ，選右上角三個點 […]出現選單，選[設定]，在設定內搜尋 SSL ，找到之後，在管理憑證，打開 IP-HTTPS/SSL 憑證和設定那個選項，刪除所有奇怪的憑證</p>



<figure class="wp-block-image size-full"><img decoding="async" width="1756" height="906" src="https://richliu.com/wp-content/uploads/2024/07/image-1.png" alt="" class="wp-image-6004" srcset="https://richliu.com/wp-content/uploads/2024/07/image-1.png 1756w, https://richliu.com/wp-content/uploads/2024/07/image-1-600x310.png 600w, https://richliu.com/wp-content/uploads/2024/07/image-1-768x396.png 768w, https://richliu.com/wp-content/uploads/2024/07/image-1-1536x792.png 1536w, https://richliu.com/wp-content/uploads/2024/07/image-1-816x421.png 816w" sizes="(max-width: 1756px) 100vw, 1756px" /></figure>



<p><mark style="background-color:rgba(0, 0, 0, 0);color:#f90606" class="has-inline-color">這個步驟有可能會刪除系統內重要憑證，像是券商或是金融憑證，使用時請小心，刪除前請備份</mark>，以下是示意圖，非出事機器的憑證</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="912" height="814" src="https://richliu.com/wp-content/uploads/2024/07/image-2.png" alt="" class="wp-image-6005" srcset="https://richliu.com/wp-content/uploads/2024/07/image-2.png 912w, https://richliu.com/wp-content/uploads/2024/07/image-2-600x536.png 600w, https://richliu.com/wp-content/uploads/2024/07/image-2-768x685.png 768w, https://richliu.com/wp-content/uploads/2024/07/image-2-816x728.png 816w" sizes="auto, (max-width: 912px) 100vw, 912px" /></figure>



<p>我是刪完就正常了</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2024/07/21/6002/%ef%bd%97indows-11-%e7%80%8f%e8%a6%bd%e5%99%a8%e5%9c%96%e7%89%87%e7%84%a1%e6%b3%95%e9%a1%af%e7%a4%ba-err_ssl_protocol_error/">Ｗindows 11 瀏覽器圖片無法顯示/ERR_SSL_PROTOCOL_ERROR</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/07/21/6002/%ef%bd%97indows-11-%e7%80%8f%e8%a6%bd%e5%99%a8%e5%9c%96%e7%89%87%e7%84%a1%e6%b3%95%e9%a1%af%e7%a4%ba-err_ssl_protocol_error/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Bye-Bye ICQ</title>
		<link>https://richliu.com/2024/06/30/5993/bye-bye-icq/</link>
					<comments>https://richliu.com/2024/06/30/5993/bye-bye-icq/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sun, 30 Jun 2024 14:16:40 +0000</pubDate>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[隨手札記]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=5993</guid>

					<description><![CDATA[<p>本來以為會持續到六月底，我還掛了一下 ICQ ，想說會不會有人傳給我。不過到最結束之前也沒有人傳訊息給我，也沒 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2024/06/30/5993/bye-bye-icq/">Bye-Bye ICQ</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<span id="more-5993"></span>



<p>本來以為會持續到六月底，我還掛了一下 ICQ ，想說會不會有人傳給我。<br />不過到最結束之前也沒有人傳訊息給我，也沒有人上線；看了 ICQ 上的諸多暱稱，少部份還在FB或其他平台連絡，但是大部份都失連了</p>



<p>人生嘛，總是在某個時候有所交集，在某個時間點遠離而去，留下來的很少很少，尤其是現在大部份都是網路的朋友，那來去就更容易。ICQ 能撐這麼久也是不容易，台灣自己的 CICQ 20 多年前(2001年)就消失了[<a href="https://www.ithome.com.tw/news/5999" target="_blank" rel="noopener">ref1,</a> <a href="https://www.ithome.com.tw/news/12695" target="_blank" rel="noopener">ref2</a>]，比起 ICQ，對我們來說，CICQ 才有更多回憶</p>



<p>ICQ 成立於 1996 年，1998 年賣給 AOL，2010 年賣給俄羅斯公司 mail.ru ，所以圖中才會要人移到 VK (俄羅斯版 Facebook)，2024 年 6 月底結束營運</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1426" height="934" src="https://richliu.com/wp-content/uploads/2024/06/image.png" alt="" class="wp-image-5994" srcset="https://richliu.com/wp-content/uploads/2024/06/image.png 1426w, https://richliu.com/wp-content/uploads/2024/06/image-600x393.png 600w, https://richliu.com/wp-content/uploads/2024/06/image-768x503.png 768w, https://richliu.com/wp-content/uploads/2024/06/image-816x534.png 816w" sizes="auto, (max-width: 1426px) 100vw, 1426px" /></figure>



<p></p>
<p>The post <a rel="nofollow" href="https://richliu.com/2024/06/30/5993/bye-bye-icq/">Bye-Bye ICQ</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/06/30/5993/bye-bye-icq/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>WordPress Fatal error: Uncaught TypeError: count()</title>
		<link>https://richliu.com/2024/05/29/5982/wordpress-fatal-error-uncaught-typeerror-count/</link>
					<comments>https://richliu.com/2024/05/29/5982/wordpress-fatal-error-uncaught-typeerror-count/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Wed, 29 May 2024 02:13:12 +0000</pubDate>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=5982</guid>

					<description><![CDATA[<p>Shorter message: Fatal error: Uncaught TypeError: count [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2024/05/29/5982/wordpress-fatal-error-uncaught-typeerror-count/">WordPress Fatal error: Uncaught TypeError: count()</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<span id="more-5982"></span>



<p>Shorter message:</p>



<pre class="wp-block-preformatted">Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, false given in formatting.php</pre>



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



<p>Root cause is WordPress uses the regular expression to convert content text smilies to images. It will exhaust the php pcre library backtrack quickly. Especially when the images in the the article over 500. </p>



<p>Just keep the images number under 500 or separate&nbsp; it into several articles. </p>



<p>if unfortunately, it happend, add &#8220;pcre.backtrack_limit=1000000000&#8221; to php.ini and restart website, it might make it work again, would be very very very slow to load the page. </p>



<p>If still cannot solve this problem, or too slow, probably use the number &#8220;pcre.backtrack_limit=10000000&#8221; can make it work. because default value is not so big like, when it can edit the article again, just remove some images can make it work. </p>



<h2 class="wp-block-heading">How to Get the debug message? </h2>



<p>Enable the debug in the wp-config.php, turn on following messages in the file. </p>



<pre class="wp-block-preformatted">define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', true );
define( 'WP_DEBUG_LOG', true );
</pre>



<p>Or check the web server error log. <br />Original Message</p>



<pre class="wp-block-preformatted">Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, false given in formatting.php

PHP Fatal error:  Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, false given in /var/www/htdocs/wp-includes/formatting.php:3507\nStack trace:\n#0 /var/www/htdocs/wp-includes/class-wp-hook.php(324): convert_smilies()\n#1 /var/www/htdocs/wp-includes/plugin.php(205): WP_Hook-&gt;apply_filters()\n#2 /var/www/htdocs/wp-content/plugins/seo-by-rank-math/includes/modules/links/class-links.php(171): apply_filters()\n#3 /var/www/htdocs/wp-content/plugins/seo-by-rank-math/includes/modules/links/class-links.php(59): RankMath\\Links\\Links-&gt;process()\n#4 /var/www/htdocs/wp-includes/class-wp-hook.php(326): RankMath\\Links\\Links-&gt;save_post()\n#5 /var/www/htdocs/wp-includes/class-wp-hook.php(348): WP_Hook-&gt;apply_filters()\n#6 /var/www/htdocs/wp-includes/plugin.php(517): WP_Hook-&gt;do_action()\n#7 /var/www/htdocs/wp-includes/post.php(4828): do_action()\n#8 /var/www/htdocs/wp-includes/post.php(4930): wp_insert_post()\n#9 /var/www/htdocs/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(880): wp_update_post()\n#10 /var/www/htdocs/wp-includes/rest-api/class-wp-rest-server.php(1230): WP_REST_Posts_Controller-&gt;update_item()\n#11 /var/www/htdocs/wp-includes/rest-api/class-wp-rest-server.php(1063): WP_REST_Server-&gt;respond_to_request()\n#12 /var/www/htdocs/wp-includes/rest-api/class-wp-rest-server.php(439): WP_REST_Server-&gt;dispatch()\n#13 /var/www/htdocs/wp-includes/rest-api.php(428): WP_REST_Server-&gt;serve_request()\n#14 /var/www/htdocs/wp-includes/class-wp-hook.php(324): rest_api_loaded()\n#15 /var/www/htdocs/wp-includes/class-wp-hook.php(348): WP_Hook-&gt;apply_filters()\n#16 /var/www/htdocs/wp-includes/plugin.php(565): WP_Hook-&gt;do_action()\n#17 /var/www/htdocs/wp-includes/class-wp.php(418): do_action_ref_array()\n#18 /var/www/htdocs/wp-includes/class-wp.php(813): WP-&gt;parse_request()\n#19 /var/www/htdocs/wp-includes/functions.php(1336): WP-&gt;main()\n#20 /var/www/htdocs/wp-blog-header.php(16): wp()\n#21 /var/www/htdocs/index.php(17): require('...')\n#22 {main}\n  thrown in /var/www/htdocs/wp-includes/formatting.php</pre>



<p>ref.<br /><a href="https://wordpress.org/support/topic/fatal-error-uncaught-typeerror-count-3/" target="_blank" rel="noopener">Fatal error: Uncaught TypeError: count():</a></p>
<p>The post <a rel="nofollow" href="https://richliu.com/2024/05/29/5982/wordpress-fatal-error-uncaught-typeerror-count/">WordPress Fatal error: Uncaught TypeError: count()</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/05/29/5982/wordpress-fatal-error-uncaught-typeerror-count/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://richliu.com/2024/03/10/5852/llm-chat-webgui-and-fine-turning-on-ampere-altra-arm64-platform/</link>
					<comments>https://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://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://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://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://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://richliu.com/wp-content/uploads/2024/03/image.png" alt="" class="wp-image-5853" srcset="https://richliu.com/wp-content/uploads/2024/03/image.png 1307w, https://richliu.com/wp-content/uploads/2024/03/image-600x402.png 600w, https://richliu.com/wp-content/uploads/2024/03/image-768x514.png 768w, https://richliu.com/wp-content/uploads/2024/03/image-816x546.png 816w" sizes="auto, (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://richliu.com/wp-content/uploads/2024/03/image-1.png" alt="" class="wp-image-5854" srcset="https://richliu.com/wp-content/uploads/2024/03/image-1.png 2205w, https://richliu.com/wp-content/uploads/2024/03/image-1-600x207.png 600w, https://richliu.com/wp-content/uploads/2024/03/image-1-768x265.png 768w, https://richliu.com/wp-content/uploads/2024/03/image-1-1536x530.png 1536w, https://richliu.com/wp-content/uploads/2024/03/image-1-2048x707.png 2048w, https://richliu.com/wp-content/uploads/2024/03/image-1-816x282.png 816w" sizes="auto, (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://richliu.com/wp-content/uploads/2024/03/image-2.png" alt="" class="wp-image-5855" srcset="https://richliu.com/wp-content/uploads/2024/03/image-2.png 1506w, https://richliu.com/wp-content/uploads/2024/03/image-2-600x341.png 600w, https://richliu.com/wp-content/uploads/2024/03/image-2-768x437.png 768w, https://richliu.com/wp-content/uploads/2024/03/image-2-816x464.png 816w" sizes="auto, (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://richliu.com/wp-content/uploads/2024/03/image-3.png" alt="" class="wp-image-5856" srcset="https://richliu.com/wp-content/uploads/2024/03/image-3.png 1822w, https://richliu.com/wp-content/uploads/2024/03/image-3-600x397.png 600w, https://richliu.com/wp-content/uploads/2024/03/image-3-768x508.png 768w, https://richliu.com/wp-content/uploads/2024/03/image-3-1536x1017.png 1536w, https://richliu.com/wp-content/uploads/2024/03/image-3-816x540.png 816w" sizes="auto, (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://richliu.com/wp-content/uploads/2024/03/image-4.png" alt="" class="wp-image-5857" srcset="https://richliu.com/wp-content/uploads/2024/03/image-4.png 2059w, https://richliu.com/wp-content/uploads/2024/03/image-4-600x352.png 600w, https://richliu.com/wp-content/uploads/2024/03/image-4-768x450.png 768w, https://richliu.com/wp-content/uploads/2024/03/image-4-1536x900.png 1536w, https://richliu.com/wp-content/uploads/2024/03/image-4-2048x1201.png 2048w, https://richliu.com/wp-content/uploads/2024/03/image-4-816x478.png 816w" sizes="auto, (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://richliu.com/wp-content/uploads/2024/03/image-5.png" alt="" class="wp-image-5858" srcset="https://richliu.com/wp-content/uploads/2024/03/image-5.png 2008w, https://richliu.com/wp-content/uploads/2024/03/image-5-600x91.png 600w, https://richliu.com/wp-content/uploads/2024/03/image-5-768x116.png 768w, https://richliu.com/wp-content/uploads/2024/03/image-5-1536x233.png 1536w, https://richliu.com/wp-content/uploads/2024/03/image-5-816x124.png 816w" sizes="auto, (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://richliu.com/wp-content/uploads/2024/03/image-6.png" alt="" class="wp-image-5859" srcset="https://richliu.com/wp-content/uploads/2024/03/image-6.png 2077w, https://richliu.com/wp-content/uploads/2024/03/image-6-600x301.png 600w, https://richliu.com/wp-content/uploads/2024/03/image-6-768x386.png 768w, https://richliu.com/wp-content/uploads/2024/03/image-6-1536x771.png 1536w, https://richliu.com/wp-content/uploads/2024/03/image-6-2048x1028.png 2048w, https://richliu.com/wp-content/uploads/2024/03/image-6-816x410.png 816w, https://richliu.com/wp-content/uploads/2024/03/image-6-400x200.png 400w" sizes="auto, (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://richliu.com/wp-content/uploads/2024/03/image-7.png" alt="" class="wp-image-5860" srcset="https://richliu.com/wp-content/uploads/2024/03/image-7.png 2077w, https://richliu.com/wp-content/uploads/2024/03/image-7-600x298.png 600w, https://richliu.com/wp-content/uploads/2024/03/image-7-768x381.png 768w, https://richliu.com/wp-content/uploads/2024/03/image-7-1536x762.png 1536w, https://richliu.com/wp-content/uploads/2024/03/image-7-2048x1016.png 2048w, https://richliu.com/wp-content/uploads/2024/03/image-7-816x405.png 816w" sizes="auto, (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://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://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://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>Ampere Altra ARM64 Grub Cannot Output Message To Serial Console</title>
		<link>https://richliu.com/2024/03/08/5866/ampere-altra-arm64-grub-cannot-output-message-to-serial-console/</link>
					<comments>https://richliu.com/2024/03/08/5866/ampere-altra-arm64-grub-cannot-output-message-to-serial-console/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Fri, 08 Mar 2024 11:35:47 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[grub]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=5866</guid>

					<description><![CDATA[<p>This issue is a little bit anomalous. Different boards  [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2024/03/08/5866/ampere-altra-arm64-grub-cannot-output-message-to-serial-console/">Ampere Altra ARM64 Grub Cannot Output Message To Serial Console</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>This issue is a little bit anomalous. Different boards and different combinations have different results.</p>



<p>For current ARM64 systems, most of the time they will use the serial console as the debug console. So, when there is no output from the serial console, it confuses me.</p>



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



<p>CPU: Ampere Altra Family<br />Board: AsRock ALTRAD8UD<br />For example, on my Gentoo system, only need to configure /etc/default/grub to following configuration.</p>



<pre class="wp-block-preformatted">GRUB_TIMEOUT=30
GRUB_TIMEOUT_STYLE=menu
GRUB_CMDLINE_LINUX_DEFAULT="domdadm console=ttyAMA0 pcie_aspm=off"
GRUB_TERMINAL=console</pre>



<p>Output to serial console will be no problem, but on the Ubuntu 22.04, it cannot output to serial console. </p>



<p>So, on Ubuntu, if you only can see grub menu on VGA and cannot see it on serial console, try this configuration, it will output to serial console and VGA console at the same time.</p>



<pre class="wp-block-preformatted">GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=10
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
</pre>



<p>Don&#8217;t forget to update grub.cfg</p>



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



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1377" height="808" src="https://richliu.com/wp-content/uploads/2024/03/image-8.png" alt="" class="wp-image-5906" srcset="https://richliu.com/wp-content/uploads/2024/03/image-8.png 1377w, https://richliu.com/wp-content/uploads/2024/03/image-8-600x352.png 600w, https://richliu.com/wp-content/uploads/2024/03/image-8-768x451.png 768w, https://richliu.com/wp-content/uploads/2024/03/image-8-816x479.png 816w" sizes="auto, (max-width: 1377px) 100vw, 1377px" /></figure>



<p>ref.<br />https://help.ubuntu.com/community/SerialConsoleHowto</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2024/03/08/5866/ampere-altra-arm64-grub-cannot-output-message-to-serial-console/">Ampere Altra ARM64 Grub Cannot Output Message To Serial Console</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/03/08/5866/ampere-altra-arm64-grub-cannot-output-message-to-serial-console/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Play Game On Ampere Altra ARM64 Platform</title>
		<link>https://richliu.com/2024/02/25/5816/play-game-on-ampere-altra-arm64-platform/</link>
					<comments>https://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://richliu.com/?p=5816</guid>

					<description><![CDATA[<p>Setup Steam on Ampere Altra platform. </p>
<p>The post <a rel="nofollow" href="https://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://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://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://richliu.com/wp-content/uploads/2024/02/IMG_20240223_154907-1-scaled.jpg 2560w, https://richliu.com/wp-content/uploads/2024/02/IMG_20240223_154907-1-600x358.jpg 600w, https://richliu.com/wp-content/uploads/2024/02/IMG_20240223_154907-1-768x458.jpg 768w, https://richliu.com/wp-content/uploads/2024/02/IMG_20240223_154907-1-1536x916.jpg 1536w, https://richliu.com/wp-content/uploads/2024/02/IMG_20240223_154907-1-2048x1222.jpg 2048w, https://richliu.com/wp-content/uploads/2024/02/IMG_20240223_154907-1-816x487.jpg 816w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /></figure>
</div>


<p>In previous article on <a 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> , 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://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://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://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://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://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>Install ARM64 Windows 11 on ARM64 QEMU System</title>
		<link>https://richliu.com/2024/02/03/5752/install-arm64-windows-11-on-arm64-qemu-system/</link>
					<comments>https://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://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://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://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://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://richliu.com/wp-content/uploads/2024/02/image.png 1338w, https://richliu.com/wp-content/uploads/2024/02/image-600x413.png 600w, https://richliu.com/wp-content/uploads/2024/02/image-768x529.png 768w" sizes="auto, (max-width: 1338px) 100vw, 1338px" /></figure>
</div>


<p>Chinese article version: <a href="https://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://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://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://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://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://richliu.com/wp-content/uploads/2024/02/image-3.png 896w, https://richliu.com/wp-content/uploads/2024/02/image-3-600x404.png 600w, https://richliu.com/wp-content/uploads/2024/02/image-3-768x518.png 768w" sizes="auto, (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://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://richliu.com/wp-content/uploads/2024/02/image-8.png 439w, https://richliu.com/wp-content/uploads/2024/02/image-8-300x300.png 300w" sizes="auto, (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://richliu.com/wp-content/uploads/2024/02/windows11_qemu_1.png" alt="" class="wp-image-5735" srcset="https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_1.png 550w, https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_1-529x600.png 529w" sizes="auto, (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://richliu.com/wp-content/uploads/2024/02/windows11_qemu_2.png" alt="" class="wp-image-5736" srcset="https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_2.png 550w, https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_2-531x600.png 531w" sizes="auto, (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://richliu.com/wp-content/uploads/2024/02/windows11_qemu_3.png" alt="" class="wp-image-5737" srcset="https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_3.png 553w, https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_3-532x600.png 532w" sizes="auto, (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://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://richliu.com/wp-content/uploads/2024/02/image-6.png 600w, https://richliu.com/wp-content/uploads/2024/02/image-6-557x600.png 557w" sizes="auto, (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://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://richliu.com/wp-content/uploads/2024/02/image-7.png 646w, https://richliu.com/wp-content/uploads/2024/02/image-7-600x554.png 600w" sizes="auto, (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://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://richliu.com/wp-content/uploads/2024/02/image-9.png 1246w, https://richliu.com/wp-content/uploads/2024/02/image-9-600x450.png 600w, https://richliu.com/wp-content/uploads/2024/02/image-9-768x576.png 768w" sizes="auto, (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://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://richliu.com/wp-content/uploads/2024/02/image-10.png 927w, https://richliu.com/wp-content/uploads/2024/02/image-10-600x449.png 600w, https://richliu.com/wp-content/uploads/2024/02/image-10-768x574.png 768w" sizes="auto, (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://richliu.com/wp-content/uploads/2024/02/windows11_qemu_5.png" alt="" class="wp-image-5740" srcset="https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_5.png 1116w, https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_5-600x373.png 600w, https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_5-768x477.png 768w" sizes="auto, (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://richliu.com/wp-content/uploads/2024/02/windows11_qemu_6.png" alt="" class="wp-image-5741" srcset="https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_6.png 931w, https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_6-600x447.png 600w, https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_6-768x572.png 768w" sizes="auto, (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://richliu.com/wp-content/uploads/2024/02/windows11_qemu_7.png" alt="" class="wp-image-5742" srcset="https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_7.png 928w, https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_7-600x448.png 600w, https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_7-768x574.png 768w" sizes="auto, (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://richliu.com/wp-content/uploads/2024/02/windows11_qemu_8.png" alt="" class="wp-image-5743" srcset="https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_8.png 1047w, https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_8-600x410.png 600w, https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_8-768x524.png 768w" sizes="auto, (max-width: 1047px) 100vw, 1047px" /></figure>



<figure class="wp-block-image size-large"><img decoding="async" data-id="5744" src="https://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://richliu.com/wp-content/uploads/2024/02/image-11.png" alt="" class="wp-image-5745" srcset="https://richliu.com/wp-content/uploads/2024/02/image-11.png 1175w, https://richliu.com/wp-content/uploads/2024/02/image-11-600x446.png 600w, https://richliu.com/wp-content/uploads/2024/02/image-11-768x571.png 768w" sizes="auto, (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://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://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://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://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://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://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://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://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://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://richliu.com/wp-content/uploads/2024/02/image.png 1338w, https://richliu.com/wp-content/uploads/2024/02/image-600x413.png 600w, https://richliu.com/wp-content/uploads/2024/02/image-768x529.png 768w" sizes="auto, (max-width: 1338px) 100vw, 1338px" /></figure>
</div>


<p>English please see : <a href="https://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://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://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://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://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://richliu.com/wp-content/uploads/2024/02/image-3.png 896w, https://richliu.com/wp-content/uploads/2024/02/image-3-600x404.png 600w, https://richliu.com/wp-content/uploads/2024/02/image-3-768x518.png 768w" sizes="auto, (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://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://richliu.com/wp-content/uploads/2024/02/image-8.png 439w, https://richliu.com/wp-content/uploads/2024/02/image-8-300x300.png 300w" sizes="auto, (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://richliu.com/wp-content/uploads/2024/02/windows11_qemu_1.png" alt="" class="wp-image-5735" srcset="https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_1.png 550w, https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_1-529x600.png 529w" sizes="auto, (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://richliu.com/wp-content/uploads/2024/02/windows11_qemu_2.png" alt="" class="wp-image-5736" srcset="https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_2.png 550w, https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_2-531x600.png 531w" sizes="auto, (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://richliu.com/wp-content/uploads/2024/02/windows11_qemu_3.png" alt="" class="wp-image-5737" srcset="https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_3.png 553w, https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_3-532x600.png 532w" sizes="auto, (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://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://richliu.com/wp-content/uploads/2024/02/image-6.png 600w, https://richliu.com/wp-content/uploads/2024/02/image-6-557x600.png 557w" sizes="auto, (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://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://richliu.com/wp-content/uploads/2024/02/image-7.png 646w, https://richliu.com/wp-content/uploads/2024/02/image-7-600x554.png 600w" sizes="auto, (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://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://richliu.com/wp-content/uploads/2024/02/image-9.png 1246w, https://richliu.com/wp-content/uploads/2024/02/image-9-600x450.png 600w, https://richliu.com/wp-content/uploads/2024/02/image-9-768x576.png 768w" sizes="auto, (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://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://richliu.com/wp-content/uploads/2024/02/image-10.png 927w, https://richliu.com/wp-content/uploads/2024/02/image-10-600x449.png 600w, https://richliu.com/wp-content/uploads/2024/02/image-10-768x574.png 768w" sizes="auto, (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://richliu.com/wp-content/uploads/2024/02/windows11_qemu_5.png" alt="" class="wp-image-5740" srcset="https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_5.png 1116w, https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_5-600x373.png 600w, https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_5-768x477.png 768w" sizes="auto, (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://richliu.com/wp-content/uploads/2024/02/windows11_qemu_6.png" alt="" class="wp-image-5741" srcset="https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_6.png 931w, https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_6-600x447.png 600w, https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_6-768x572.png 768w" sizes="auto, (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://richliu.com/wp-content/uploads/2024/02/windows11_qemu_7.png" alt="" class="wp-image-5742" srcset="https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_7.png 928w, https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_7-600x448.png 600w, https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_7-768x574.png 768w" sizes="auto, (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://richliu.com/wp-content/uploads/2024/02/windows11_qemu_8.png" alt="" class="wp-image-5743" srcset="https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_8.png 1047w, https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_8-600x410.png 600w, https://richliu.com/wp-content/uploads/2024/02/windows11_qemu_8-768x524.png 768w" sizes="auto, (max-width: 1047px) 100vw, 1047px" /></figure>



<figure class="wp-block-image size-large"><img decoding="async" data-id="5744" src="https://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://richliu.com/wp-content/uploads/2024/02/image-11.png" alt="" class="wp-image-5745" srcset="https://richliu.com/wp-content/uploads/2024/02/image-11.png 1175w, https://richliu.com/wp-content/uploads/2024/02/image-11-600x446.png 600w, https://richliu.com/wp-content/uploads/2024/02/image-11-768x571.png 768w" sizes="auto, (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://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://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://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>Windows 11 移除 USB 出現此裝置正在使用中的問題</title>
		<link>https://richliu.com/2024/01/07/5427/windows-11-%e7%a7%bb%e9%99%a4-usb-%e5%87%ba%e7%8f%be%e6%ad%a4%e8%a3%9d%e7%bd%ae%e6%ad%a3%e5%9c%a8%e4%bd%bf%e7%94%a8%e4%b8%ad%e7%9a%84%e5%95%8f%e9%a1%8c/</link>
					<comments>https://richliu.com/2024/01/07/5427/windows-11-%e7%a7%bb%e9%99%a4-usb-%e5%87%ba%e7%8f%be%e6%ad%a4%e8%a3%9d%e7%bd%ae%e6%ad%a3%e5%9c%a8%e4%bd%bf%e7%94%a8%e4%b8%ad%e7%9a%84%e5%95%8f%e9%a1%8c/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sat, 06 Jan 2024 16:55:20 +0000</pubDate>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[usb]]></category>
		<category><![CDATA[windows]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=5427</guid>

					<description><![CDATA[<p>這個每次都會出現，有點煩，筆記一下以後可能還會用到 如果出現，退出 USB 時發生問題此裝置目前正在使用中。請 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2024/01/07/5427/windows-11-%e7%a7%bb%e9%99%a4-usb-%e5%87%ba%e7%8f%be%e6%ad%a4%e8%a3%9d%e7%bd%ae%e6%ad%a3%e5%9c%a8%e4%bd%bf%e7%94%a8%e4%b8%ad%e7%9a%84%e5%95%8f%e9%a1%8c/">Windows 11 移除 USB 出現此裝置正在使用中的問題</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>這個每次都會出現，有點煩，筆記一下以後可能還會用到<br /><br />如果出現，退出 USB 時發生問題<br />此裝置目前正在使用中。請關閉任何可能正在使用該裝置的程式或視窗，然後再試一次<br />的解決方案</p>



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



<p>1. 確定你的 USB 磁碟機，例如 E: <br />2. 叫出工作管理員，在效能 -> CPU 的右上角的三個點（更多），選資源監視器</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1575" height="910" src="https://richliu.com/wp-content/uploads/2024/01/image.png" alt="" class="wp-image-5428" srcset="https://richliu.com/wp-content/uploads/2024/01/image.png 1575w, https://richliu.com/wp-content/uploads/2024/01/image-600x347.png 600w, https://richliu.com/wp-content/uploads/2024/01/image-768x444.png 768w, https://richliu.com/wp-content/uploads/2024/01/image-1536x887.png 1536w" sizes="auto, (max-width: 1575px) 100vw, 1575px" /></figure>



<p>2. 叫出資源監視器之後，在 CPU -> 關聯控制代碼，打上磁碟機代號:\ ，例如 E:\<br />3. 在出現的影像(應該叫應用程式)上，按右鍵選結束處理程序</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1914" height="880" src="https://richliu.com/wp-content/uploads/2024/01/image-1.png" alt="" class="wp-image-5429" srcset="https://richliu.com/wp-content/uploads/2024/01/image-1.png 1914w, https://richliu.com/wp-content/uploads/2024/01/image-1-600x276.png 600w, https://richliu.com/wp-content/uploads/2024/01/image-1-768x353.png 768w, https://richliu.com/wp-content/uploads/2024/01/image-1-1536x706.png 1536w" sizes="auto, (max-width: 1914px) 100vw, 1914px" /></figure>



<p>4. 結束完應用程式之後再移除 USB 裝置，應該就可以了</p>



<p>ref.<br /><a href="https://answers.microsoft.com/zh-hant/windows/forum/all/%E8%A1%8C%E5%8B%95%E7%A1%AC%E7%A2%9Fusb%E7%84%A1/8989fb07-58b4-4601-ae78-320bc81b1d33" target="_blank" rel="noopener">行動硬碟&amp;USB無法退出</a></p>
<p>The post <a rel="nofollow" href="https://richliu.com/2024/01/07/5427/windows-11-%e7%a7%bb%e9%99%a4-usb-%e5%87%ba%e7%8f%be%e6%ad%a4%e8%a3%9d%e7%bd%ae%e6%ad%a3%e5%9c%a8%e4%bd%bf%e7%94%a8%e4%b8%ad%e7%9a%84%e5%95%8f%e9%a1%8c/">Windows 11 移除 USB 出現此裝置正在使用中的問題</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/01/07/5427/windows-11-%e7%a7%bb%e9%99%a4-usb-%e5%87%ba%e7%8f%be%e6%ad%a4%e8%a3%9d%e7%bd%ae%e6%ad%a3%e5%9c%a8%e4%bd%bf%e7%94%a8%e4%b8%ad%e7%9a%84%e5%95%8f%e9%a1%8c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>2023 Youtube 禁止使用廣告攔劫器 block adblocker</title>
		<link>https://richliu.com/2023/10/15/5384/2023-youtube-%e7%a6%81%e6%ad%a2%e4%bd%bf%e7%94%a8%e5%bb%a3%e5%91%8a%e6%94%94%e5%8a%ab%e5%99%a8-block-adblocker/</link>
					<comments>https://richliu.com/2023/10/15/5384/2023-youtube-%e7%a6%81%e6%ad%a2%e4%bd%bf%e7%94%a8%e5%bb%a3%e5%91%8a%e6%94%94%e5%8a%ab%e5%99%a8-block-adblocker/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sun, 15 Oct 2023 03:29:18 +0000</pubDate>
				<category><![CDATA[Software]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=5384</guid>

					<description><![CDATA[<p>如果有用 ublock origin 加上以下敘述，又可以將廣告計數器歸零（視窗還是會跳出來） 如果有用 ub [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2023/10/15/5384/2023-youtube-%e7%a6%81%e6%ad%a2%e4%bd%bf%e7%94%a8%e5%bb%a3%e5%91%8a%e6%94%94%e5%8a%ab%e5%99%a8-block-adblocker/">2023 Youtube 禁止使用廣告攔劫器 block adblocker</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>如果有用 ublock origin 加上以下敘述，又可以將廣告計數器歸零（視窗還是會跳出來）<br /><br />如果有用 ublock origin 加上以下敘述，又可以擋廣告了</p>



<pre class="wp-block-preformatted">youtube.com##+js(set, yt.config_.openPopupConfig.supportedPopups.adBlockMessageViewModel, false)
youtube.com##+js(set, Object.prototype.adBlocksFound, 0)
youtube.com##+js(set, ytplayer.config.args.raw_player_response.adPlacements, [])
youtube.com##+js(set, Object.prototype.hasAllowedInstreamAd, true)</pre>



<p>If it doesn&#8217;t work, try to remove this line<br /><br />youtube.com##+js(set, yt.config_.openPopupConfig.supportedPopups.adBlockMessageViewModel, false)</p>



<p>後記：這方式似乎不是很穩定</p>



<h2 class="wp-block-heading">廣告加速器</h2>



<p>另一個思路是廣告加速器 fadblock ，不能停止廣告就加速廣告，這個會加速到 50ms 就撥完廣告。這是 chrome 連結，其他平台(firefox)也有</p>



<p><a href="https://chrome.google.com/webstore/detail/fadblock/mdadjjfmjhfcibgfhfjbaiiljpllkbfc?utm_source=ext_sidebar&amp;hl=zh-TW" target="_blank" rel="noopener">https://chrome.google.com/webstore/detail/fadblock/mdadjjfmjhfcibgfhfjbaiiljpllkbfc?utm_source=ext_sidebar&amp;hl=zh-TW</a></p>



<p>ref.<br />https://twitter.com/endermanch/status/1713129854818742684<br /><br /></p>
<p>The post <a rel="nofollow" href="https://richliu.com/2023/10/15/5384/2023-youtube-%e7%a6%81%e6%ad%a2%e4%bd%bf%e7%94%a8%e5%bb%a3%e5%91%8a%e6%94%94%e5%8a%ab%e5%99%a8-block-adblocker/">2023 Youtube 禁止使用廣告攔劫器 block adblocker</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/10/15/5384/2023-youtube-%e7%a6%81%e6%ad%a2%e4%bd%bf%e7%94%a8%e5%bb%a3%e5%91%8a%e6%94%94%e5%8a%ab%e5%99%a8-block-adblocker/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Banyan No Network Connection Please check your network settings and try again. [2604] Mobile Outlook</title>
		<link>https://richliu.com/2023/07/25/5264/banyan-no-network-connection-please-check-your-network-settings-and-try-again-2604-mobile-outlook/</link>
					<comments>https://richliu.com/2023/07/25/5264/banyan-no-network-connection-please-check-your-network-settings-and-try-again-2604-mobile-outlook/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Tue, 25 Jul 2023 14:03:26 +0000</pubDate>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Android]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=5264</guid>

					<description><![CDATA[<p>If your company used Banyan as company login management [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2023/07/25/5264/banyan-no-network-connection-please-check-your-network-settings-and-try-again-2604-mobile-outlook/">Banyan No Network Connection Please check your network settings and try again. [2604] Mobile Outlook</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>If your company used Banyan as company login management, and you see this message on your pad or Android cellphone, on my expeience, it needs to </p>



<ol class="wp-block-list">
<li>If your phone&#8217;s language is not English, switch default language to English </li>



<li>if 1 doesn&#8217;t work, remove Banyan  and banyan certificates (usually in privacy-> security -> user security , different cellphone vendor has different settings)</li>



<li>Re-Install Banyan software</li>
</ol>



<p></p>
<p>The post <a rel="nofollow" href="https://richliu.com/2023/07/25/5264/banyan-no-network-connection-please-check-your-network-settings-and-try-again-2604-mobile-outlook/">Banyan No Network Connection Please check your network settings and try again. [2604] Mobile Outlook</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/07/25/5264/banyan-no-network-connection-please-check-your-network-settings-and-try-again-2604-mobile-outlook/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Proxmox V7 for ARM64 Support</title>
		<link>https://richliu.com/2023/06/24/5258/proxmox-v7-for-arm64-support/</link>
					<comments>https://richliu.com/2023/06/24/5258/proxmox-v7-for-arm64-support/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sat, 24 Jun 2023 02:03:48 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Software]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=5258</guid>

					<description><![CDATA[<p>In case I forget it, record it. https://github.com/pimo [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2023/06/24/5258/proxmox-v7-for-arm64-support/">Proxmox V7 for ARM64 Support</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>In case I forget it, record it. </p>



<p><a href="https://github.com/pimox/pimox7/tree/master/dev" target="_blank" rel="noopener">https://github.com/pimox/pimox7/tree/master/dev</a></p>
<p>The post <a rel="nofollow" href="https://richliu.com/2023/06/24/5258/proxmox-v7-for-arm64-support/">Proxmox V7 for ARM64 Support</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/24/5258/proxmox-v7-for-arm64-support/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Stable Diffusion webui CPU only on ARM64 Platform</title>
		<link>https://richliu.com/2023/03/04/5109/stable-diffusion-webui-cpu-only-on-arm64-platform/</link>
					<comments>https://richliu.com/2023/03/04/5109/stable-diffusion-webui-cpu-only-on-arm64-platform/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sat, 04 Mar 2023 03:24:32 +0000</pubDate>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=5109</guid>

					<description><![CDATA[<p>Stable Diffusion webui is a web service based on Gradio [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2023/03/04/5109/stable-diffusion-webui-cpu-only-on-arm64-platform/">Stable Diffusion webui CPU only on ARM64 Platform</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Stable Diffusion webui is a web service based on Gradio library for Stable Diffusion. The installation process can automatically set up the environment and install Stable Diffusion, which can save a lot of time. However, it requires an NVIDIA or AMD GPU to install it. If you want to install Stable Diffusion WebUI without a GPU, some modifications are necessary.<br /><br />Using a CPU to run Stable Diffusion can be painful, so this article is just for fun.<br /><br />Platform is Ampere Altra Mt. Collins system with 2 Ampere Altra CPU, total 160 cores. <br />OS: ubuntu 22.04.02 LTS<br />Seems Stable Diffustion webui needs python 3.10, so, ubuntu 22.04 is good choice. </p>



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



<p>It appears that Stable Diffusion WebUI requires a user account to run, and should not be run with root privileges.</p>



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



<p>Install all necessary packages, especially you install system with minimal system. </p>



<pre class="wp-block-preformatted">sudo apt install wget git python3 python3-venv python3-dev
sudo apt install libgl-dev ninja-build g++ build-essential
</pre>



<h2 class="wp-block-heading">Download Source Code</h2>



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



<h2 class="wp-block-heading">Modify Source Code</h2>



<p>It needs to modify Stable Diffusion source code to install CPU version pytorch, not GPU version pytorch. <br />modify launch.py</p>



<pre class="wp-block-preformatted">--- a/launch.py
+++ b/launch.py
@@ -219,7 +219,8 @@ def run_extensions_installers(settings_file):
 def prepare_environment():
     global skip_install

-    torch_command = os.environ.get('TORCH_COMMAND', "pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 --extra-index-url https://download.pytorch.org/whl/cu117")
+    torch_command = os.environ.get('TORCH_COMMAND', "pip install torch==1.13.1 torchvision==0.14.1 ")
     requirements_file = os.environ.get('REQS_FILE', "requirements_versions.txt")
     commandline_args = os.environ.get('COMMANDLINE_ARGS', "")
</pre>



<p>Modify webui.py, my system cannot create public service with strange behavior. <br />So it needs to modify source code to let it listen on special ip (note: seems current version already fix this issue, if add &#8220;&#8211;listen&#8221;, it will listen on 0.0.0.0)</p>



<pre class="wp-block-preformatted">--- a/webui.py
+++ b/webui.py
@@ -215,9 +215,11 @@ def webui():
                 for line in file.readlines():
                     gradio_auth_creds += [x.strip() for x in line.split(',')]

         app, local_url, share_url = shared.demo.launch(
-            share=cmd_opts.share,
-            server_name=server_name,
+            share=True,
+            server_name="0.0.0.0",
             server_port=cmd_opts.port,
             ssl_keyfile=cmd_opts.tls_keyfile,
             ssl_certfile=cmd_opts.tls_certfile,
</pre>



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



<p>Before run Stable Diffusion, it needs pass some arguments to let Stable Diffustion to use CPU resource.<br />and it needs &#8211;skip-torch-cuda-test to avoid GPU test. <br />and &#8211;xformers module will use GPU, so, don&#8217;t use this module. </p>



<pre class="wp-block-preformatted">export CUDA_VISIBLE_DEVICES=-1
export COMMANDLINE_ARGS="--share --listen --enable-insecure-extension-access --use-cpu all --no-half --precision full"
bash webui.sh --skip-torch-cuda-test </pre>



<p>After run the script, it will download all necessary packages and run it. but seems it cannot use all CPU to rander picture. </p>



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



<p>seems use export ACCELERATE=True can accelerate performance and use less CPU.<br />it can configure the accelerate with command </p>



<pre class="wp-block-preformatted">./venv/bin/accelerate config</pre>



<p>to configure the accelerate system, here is my configuration . </p>



<pre class="wp-block-preformatted">$ ./venv/bin/accelerate config<br />In which compute environment are you running? ([0] This machine, [1] AWS (Amazon SageMaker)): 0<br />Which type of machine are you using? ([0] No distributed training, [1] multi-CPU, [2] multi-GPU, [3] TPU [4] MPS): 1<br />How many different machines will you use (use more than 1 for multi-node training)? [1]:<br />How many CPU(s) should be used for distributed training? [1]:160<br />Do you wish to use FP16 or BF16 (mixed precision)? [NO/fp16/bf16]: bf16</pre>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2822" height="1212" src="https://richliu.com/wp-content/uploads/2023/03/image.png" alt="" class="wp-image-5110" srcset="https://richliu.com/wp-content/uploads/2023/03/image.png 2822w, https://richliu.com/wp-content/uploads/2023/03/image-600x258.png 600w, https://richliu.com/wp-content/uploads/2023/03/image-768x330.png 768w, https://richliu.com/wp-content/uploads/2023/03/image-1536x660.png 1536w, https://richliu.com/wp-content/uploads/2023/03/image-2048x880.png 2048w" sizes="auto, (max-width: 2822px) 100vw, 2822px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2135" height="1081" src="https://richliu.com/wp-content/uploads/2023/03/image-1.png" alt="" class="wp-image-5111" srcset="https://richliu.com/wp-content/uploads/2023/03/image-1.png 2135w, https://richliu.com/wp-content/uploads/2023/03/image-1-600x304.png 600w, https://richliu.com/wp-content/uploads/2023/03/image-1-768x389.png 768w, https://richliu.com/wp-content/uploads/2023/03/image-1-1536x778.png 1536w, https://richliu.com/wp-content/uploads/2023/03/image-1-2048x1037.png 2048w" sizes="auto, (max-width: 2135px) 100vw, 2135px" /><figcaption class="wp-element-caption">it will tak over 1 hour to rander pictures (notice, the ETA will change during randering), so, just for fun to run it with pure CPU. </figcaption></figure>
<p>The post <a rel="nofollow" href="https://richliu.com/2023/03/04/5109/stable-diffusion-webui-cpu-only-on-arm64-platform/">Stable Diffusion webui CPU only on ARM64 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/2023/03/04/5109/stable-diffusion-webui-cpu-only-on-arm64-platform/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Facebook 擋廣告</title>
		<link>https://richliu.com/2022/11/11/4939/facebook-%e6%93%8b%e5%bb%a3%e5%91%8a/</link>
					<comments>https://richliu.com/2022/11/11/4939/facebook-%e6%93%8b%e5%bb%a3%e5%91%8a/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Fri, 11 Nov 2022 08:33:59 +0000</pubDate>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Facebook]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=4939</guid>

					<description><![CDATA[<p>只有 Desktop 加上 Chrome/Edge 可以用用 ublock origin 擋，還可以順便擋 Y [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2022/11/11/4939/facebook-%e6%93%8b%e5%bb%a3%e5%91%8a/">Facebook 擋廣告</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>只有 Desktop 加上 Chrome/Edge  可以用<br />用 <a href="https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm?hl=zh-TW" target="_blank" rel="noreferrer noopener">ublock origin</a> 擋，還可以順便擋 Youtube 的廣告</p>



<p>加上自定的設定</p>



<pre class="wp-block-preformatted">www.facebook.com##div[id^=hyperfeed_story_id_]:has(span[data-ft="{\"tn\":\"j\"}"])
www.facebook.com##.pagelet-group .pagelet:has(a:has-text(Sponsored))
www.facebook.com##.pagelet-group .pagelet:has(a:has-text(Create ad))

banana.plurk.com
</pre>



<p>另一個是臉書推薦廣告<br />先裝 <a href="https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=zh-TW" target="_blank" rel="noreferrer noopener">Tampermonkey</a><br />再利用 Tampermonkey 安裝這個腳本(script) FB 贊助之殺手 <a href="https://greasyfork.org/zh-TW/scripts/408219-fb-%E8%B4%8A%E5%8A%A9%E4%B9%8B%E6%AE%BA%E6%89%8B-fb-sponsored-killer" target="_blank" rel="noreferrer noopener">(FB Sponsored Killer)</a></p>



<p>ref.<br /><a href="https://blog.gslin.org/archives/2019/04/28/8955/%E5%9B%9E%E4%BE%86%E7%94%A8-ublock-origin-%E6%93%8B-facebook-%E5%BB%A3%E5%91%8A/" target="_blank" rel="noreferrer noopener">回來用 uBlock Origin 擋 Facebook 廣告</a></p>
<p>The post <a rel="nofollow" href="https://richliu.com/2022/11/11/4939/facebook-%e6%93%8b%e5%bb%a3%e5%91%8a/">Facebook 擋廣告</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/11/11/4939/facebook-%e6%93%8b%e5%bb%a3%e5%91%8a/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>學生工作好用軟體網站列表</title>
		<link>https://richliu.com/2022/07/15/4725/%e5%ad%b8%e7%94%9f%e5%b7%a5%e4%bd%9c%e5%a5%bd%e7%94%a8%e8%bb%9f%e9%ab%94%e7%b6%b2%e7%ab%99%e5%88%97%e8%a1%a8/</link>
					<comments>https://richliu.com/2022/07/15/4725/%e5%ad%b8%e7%94%9f%e5%b7%a5%e4%bd%9c%e5%a5%bd%e7%94%a8%e8%bb%9f%e9%ab%94%e7%b6%b2%e7%ab%99%e5%88%97%e8%a1%a8/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Thu, 14 Jul 2022 16:04:46 +0000</pubDate>
				<category><![CDATA[Software]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=4725</guid>

					<description><![CDATA[<p>蒐集網路上看到的好用軟體以備不時之需 Diagram 沒有 Visio 可用的時候怎麼辦？ Visual Pa [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2022/07/15/4725/%e5%ad%b8%e7%94%9f%e5%b7%a5%e4%bd%9c%e5%a5%bd%e7%94%a8%e8%bb%9f%e9%ab%94%e7%b6%b2%e7%ab%99%e5%88%97%e8%a1%a8/">學生工作好用軟體網站列表</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>蒐集網路上看到的好用軟體以備不時之需</p>



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



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



<p>沒有 Visio 可用的時候怎麼辦？</p>



<p><a href="https://www.visual-paradigm.com/tw/" target="_blank" rel="noreferrer noopener">Visual Paradigm</a> : UML 建模和Agile 軟體</p>



<p><a href="https://app.diagrams.net/" target="_blank" rel="noreferrer noopener">Draw.io</a> : Draw.io 免費和開源的跨平台圖形繪製軟件，像流程圖，線框，UML圖，組織圖和網絡圖<br /><a href="https://marketplace.visualstudio.com/items?itemName=hediet.vscode-drawio" target="_blank" rel="noreferrer noopener">配合 vscode 用的 module </a></p>



<p><a href="https://mermaid-js.github.io/" target="_blank" rel="noreferrer noopener">Mermaid</a> : 用 Markdown 畫流程圖</p>



<p><a href="https://plantuml.com/zh/" target="_blank" rel="noreferrer noopener">plantuml</a> : 用描述語言產生流程圖，<a href="https://crashedmind.github.io/PlantUMLHitchhikersGuide/aws/aws.html" target="_blank" rel="noreferrer noopener">範例</a><br /></p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" src="https://richliu.com/wp-content/uploads/2022/07/image.png" alt="" class="wp-image-4726" width="202" height="98" srcset="https://richliu.com/wp-content/uploads/2022/07/image.png 809w, https://richliu.com/wp-content/uploads/2022/07/image-600x291.png 600w, https://richliu.com/wp-content/uploads/2022/07/image-768x372.png 768w" sizes="auto, (max-width: 202px) 100vw, 202px" /></figure>



<p><a href="https://www.figma.com/" target="_blank" rel="noreferrer noopener">Figma: the collaborative interface design tool.</a>: 容易使用的介面設計程式線上版也免費</p>



<h2 class="wp-block-heading">看圖軟體</h2>



<p>已經受不了 AcdSee 了嗎？</p>



<p><a href="https://www.faststone.org/FSViewerDetail.htm" target="_blank" rel="noreferrer noopener">FastStone</a> : 體積小、速度快、免費的看圖程式 (Windows)</p>



<p><a href="https://www.xnview.com/" target="_blank" rel="noreferrer noopener">XnView </a>: 跨平台的看圖軟體 (Windows/Mac/Linux/Android/iOS) ，亦有 Convert/Resize等等軟體 還有 Shell extenson (Windows)，介面最像 AceSee</p>



<p><a href="https://tw.bandisoft.com/honeyview/" target="_blank" rel="noreferrer noopener">honeyview</a> : 免費看圖軟體</p>



<p><a href="https://en.wikipedia.org/wiki/Comparison_of_image_viewers#Camera_raw_formats" target="_blank" rel="noreferrer noopener">WiKi 有關看圖軟體的比較</a>，RAW 檔支援度最高: FastStone, digiKam, Geeqie</p>



<p></p>



<p>以下大部份取自網路<br />https://www.plurk.com/p/ofnz6q</p>



<h2 class="wp-block-heading">PTT 模版</h2>



<p><a href="https://www.slidescarnival.com/category/free-templates" target="_blank" rel="noreferrer noopener">Slides Carnival</a> : 免費 Power point / Google slide 模版<br />PPT的模板，很商業，可以選主題，最方便的是可以用在雲端硬碟裡<br />＊建議你拐同學用雲端硬碟，這樣可以晚一點踩死線，也不需要一個統整的倒霉鬼<br />＊估狗的簡報在投影那欄下面有主題編輯器，可以找一找，那邊可以改變一切配色版面素材</p>



<p><a href="https://www.canva.com/zh_tw/" target="_blank" rel="noreferrer noopener">Canva </a>: 建立社群媒體圖形、簡報、海報、文件和其他視覺內容的平面設計平台，提供設計模板予使用者使用，有商業版<br />啥都可以排，無水印，PPT（只能下載PDF檔）、海報、單張、做給咱媽的羽生日曆，甚至剪影片；素材豐富（我甚至會幹把裡面的白色素材加黑底下載下來，再加到剪輯軟體選screen（呃你很快就會知道這是什麼）的缺德事，讚），模板豐富，上手容易，缺點是不能去背照片，其餘真心推薦</p>



<p>很常要做ppt的非設計系旅人也想來補充兩個好用的ppt模板網站!<br /><a href="https://www.slidescarnival.com/category/free-templates/elegant-presentations/page/2" target="_blank" rel="noreferrer noopener">Free Elegant Google Slides themes and PowerPoint tem&#8230;</a><br /><a href="https://slidesgo.com/" target="_blank" rel="noreferrer noopener">Free Google Slides themes and Powerpoint templates |&#8230;</a></p>



<h2 class="wp-block-heading">繪圖</h2>



<p><a href="https://www.photopea.com/" target="_blank" rel="noreferrer noopener">Photopea </a>: Online Photo Editor <br />有筆刷有圖層，可以開PSD檔</p>



<p><a href="https://www.designcap.com/?sscid=71k6_dulvc&amp;utm_source=SAS" target="_blank" rel="noreferrer noopener">DesignCap </a>: 推推! 做海報我是用這個!</p>



<h3 class="wp-block-heading">修圖</h3>



<p>Snapseed : 手機APP，調照片的光影和顏色很好用，粗粒膠片那邊把顆粒拉成零就可以當濾鏡用，修復可以塗掉污點，擴增很好用，自由度高，直覺</p>



<h3 class="wp-block-heading">去背</h3>



<p><a href="https://www.remove.bg/zh/upload" target="_blank" rel="noreferrer noopener">removebg</a>: 線上去背，寫論文時抓免費圖檔去背可用</p>



<h3 class="wp-block-heading">圖片資源</h3>



<p><a href="https://www.pexels.com/zh-tw/" target="_blank" rel="noreferrer noopener">Pixels</a>: 創作者分享的最佳免費圖庫相片，以及免權利金的影像和影片</p>



<p><a href="http://hankodeasobu.com/" target="_blank" rel="noreferrer noopener">ハンコでアソブ</a>: 日式西洋風、手作感、藝術感時很好用的小ICON，都是PNG檔</p>



<p><a href="https://storyset.com/" target="_blank" rel="noreferrer noopener">Storyset</a>: 英文課本插畫風（？），圖片可以設定動作、顯示項目和主題顏色，有一定的自由度，做社會議題或社區推廣的PPT時很好用（像是什麼長照啊科技啊吧啦吧啦）</p>



<p><a href="https://www.irasutoya.com/" target="_blank" rel="noreferrer noopener">かわいいフリー素材集 いらすとや</a>: 傳說中日本人沒有這個就不會做PPT，我的簡報風格很少這麼童趣所以很不愛用這個，但他的素材真的多</p>



<p><a href="https://icooon-mono.com/" target="_blank" rel="noreferrer noopener">アイコン素材ダウンロードサイト「icooon-mono」 | 商用利用可能なアイコン素材が無料(フリー)&#8230;</a>非常簡潔現代的ICON，選色選下載檔案（甚至是SVG（3D檔案）都可以），很推</p>



<p><a href="https://www.pakutaso.com/" target="_blank" rel="noreferrer noopener">フリー素材ぱくたそ</a>免費圖庫(可商用)</p>



<p><a href="https://kage-design.com/" target="_blank" rel="noreferrer noopener">SILHOUETTE DESIGN – シルエット素材専門サイト</a><br />推薦一個免費素材庫<br />網頁最上方的小icon也是各種不同的資源</p>



<p><a href="https://www.flaticon.com/" target="_blank" rel="noreferrer noopener">Free Vector Icons and Stickers &#8211; Thousands of resour&#8230;</a>免費使用就有很多好看又簡單方便的素材了</p>



<p><a href="http://free-line-design.com/" target="_blank" rel="noreferrer noopener">罫線・飾り罫ライン素材 FREE LINE DESIGN</a>很多很讚的邊線！</p>



<p><a href="https://nekoillust.com/" target="_blank" rel="noreferrer noopener">猫画工房</a>: 貓貓主題素材，不算多但也不少了<br />貓控主題福音</p>



<p><a href="https://www.pixiv.net/users/61071305/illustrations/%E7%84%A1%E6%96%99%E8%83%8C%E6%99%AF" target="_blank" rel="noreferrer noopener">#無料背景 &#8211; アキ二号機のイラスト</a>這邊也來推薦一個<br />P站上「アキ二号機」這位繪師有提供一系列的場景背景作為免費素材<br />使用時只需要標註出處即可</p>



<p><a href="https://free-paper-texture.com/?fbclid=IwAR38U4Fpkd-cSKbzaVLzbknvCpLgVl_j2iBjoBpCQW0lWKeLWXU06NsLsSQ" target="_blank" rel="noreferrer noopener">Paper-co | 紙のテクスチャー素材を無料でダウンロードできるサイト</a>:紙的素材還可以以顏色搜尋</p>



<p><a href="https://mockups-design.com/?upage=16" target="_blank" rel="noreferrer noopener">Free mockups | Mockups Design | Easy to download</a>: 免費的設計物模板mokcup</p>



<p><a href="https://www.tokyo-date.net/" target="_blank" rel="noreferrer noopener">無料写真素材 東京デート</a>: 日本照片素材</p>



<p><a href="https://www.cleanpng.com/" target="_blank" rel="noreferrer noopener">CleanPNG &#8211; HD png images and illustrations. Free unl&#8230;</a><br /><a href="http://xn--hhro09bn9j8uh.com/movie111susuki.html" target="_blank" rel="noreferrer noopener">日本動畫素材</a></p>



<p><a href="https://www.irasutoya.com/" target="_blank" rel="noreferrer noopener">かわいいフリー素材集 いらすとや</a>: 雖然是日文但什麼雜七雜八的插圖都有,右鍵就可以下載png檔不用自己去背</p>



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



<p>icon網站，這個會和flaticon一起使用</p>



<p><a href="https://www.iconfinder.com/" target="_blank" rel="noreferrer noopener">5,675,000+ free and premium vector icons &#8211; Iconfinde&#8230;</a></p>



<p>各種素材網站</p>



<p><a href="https://www.xn--eckzb3bzhw32znfcp1zduw.com/" target="_blank" rel="noreferrer noopener">AI・EPSの無料イラストレーター素材なら無料イラスト素材.com</a></p>



<p><a href="https://www.8suke.net/" target="_blank" rel="noreferrer noopener">8sukeの人物イラスト屋：かわいいベクター素材のダウンロード販売 powered by BASE</a></p>



<p><a href="http://girlysozai.com/" target="_blank" rel="noreferrer noopener">ガーリー素材 &#8211; ふんわり可愛い無料イラスト素材</a></p>



<p><a href="http://hankodeasobu.com/" target="_blank" rel="noreferrer noopener">ハンコでアソブ</a></p>



<p><a href="https://picasion.com/" target="_blank" rel="noreferrer noopener">Picasion GIF maker</a>: GIF製作網站，推薦的原因是成品可以維持去背</p>



<h4 class="wp-block-heading">大圖</h4>



<p><a href="https://stockup.sitebuilderreport.com/" target="_blank" rel="noreferrer noopener">Stock Up: Instantly Search 25,000+ Free Stock Photos</a></p>



<p><a href="https://kaboompics.com/" target="_blank" rel="noreferrer noopener">Free stock photos &#8211; Kaboompics</a></p>



<p><a href="https://skitterphoto.com/" target="_blank" rel="noreferrer noopener">Skitterphoto: a place to find, show and share public&#8230;</a></p>



<h3 class="wp-block-heading">簡報</h3>



<p><a href="https://t.bilibili.com/?spm_id_from=333.1007.0.0" target="_blank" rel="noreferrer noopener">旁门左道PPT</a> : B 站 UP 主，常做 PPT 可以學會一些特別的技巧</p>



<h3 class="wp-block-heading">顏色</h3>



<p><a href="https://nipponcolors.com/" target="_blank" rel="noreferrer noopener">NIPPON COLORS &#8211; 日本の伝統色</a>: 很多好看的顏色精選，可以在這邊逛主題色，把滑鼠移到RGB那一區會跳出「#OOOOOO」的六色碼，複製下來就可以到處貼顏色<br /><a href="https://www.palettable.io/" target="_blank" rel="noreferrer noopener">Palettable</a>: 電腦選配色<br />進去一樣點#OOOOOO把剛剛選的顏色貼上去，然後就可以按喜歡或不喜歡讓電腦幫你跑顏色，總之就看到順眼<br /><a href="https://paletton.com/" target="_blank" rel="noreferrer noopener">Paletton &#8211; The Color Scheme Designer</a>: 選色，比較不直覺但是更專業一些，可以選擇對比色或近似色</p>



<p><a href="https://color.adobe.com/zh/create/color-contrast-analyzer" target="_blank" rel="noreferrer noopener">Adobe Color</a> : Adobe 的配色網站</p>



<p><a href="https://www.colorion.co/" target="_blank" rel="noreferrer noopener">Colorion</a>想不到PPT配色的話可以參考這個網站！</p>



<p><a href="https://www.freepik.com/" target="_blank" rel="noreferrer noopener">Freepik | Graphic Resources for everyone</a><br />推一下設計圖庫的部分，只要標註網站幾乎能使用上面八成以上的設計資源，從背景、設計好的海報到履歷菜單統統都有，每一項上都寫了各自的CC要求，能商用的素材也非常多<br />唯一的缺點是免費版能下載的次數很少，要慎選圖庫裡的資料提供的原檔大多是esp檔，用免費軟體inkscape就可以開啟編輯</p>



<p><a href="https://coolors.co/8da7be-554640-cde6f5-87919e-707078" target="_blank" rel="noreferrer noopener">Coolors.co</a>: 配色(空白鍵換色)</p>



<h2 class="wp-block-heading">字體</h2>



<p><a href="https://photoshopvip.net/126513" target="_blank" rel="noreferrer noopener">日文字體庫</a></p>



<p><a href="https://www.dafont.com/theme.php?cat=401" target="_blank" rel="noreferrer noopener">Gothic &gt; Medieval fonts | dafont.com</a><br />還蠻多特殊字體的，電影相關字體也有</p>



<p>推一個免費商用字型，大學生用這個就很足夠了，也不怕侵權。<br /><a href="https://forum.gamer.com.tw/C.php?bsn=60076&amp;snA=3906436" target="_blank" rel="noreferrer noopener">【分享】2021/0318更新# 35個合法免費高品質字體 (附載點) @場外休憩區 哈啦板 &#8211; 巴哈姆&#8230;</a></p>



<h2 class="wp-block-heading">影片</h2>



<h3 class="wp-block-heading">影片剪輯</h3>



<p>唯一推DaVinci Resolve，但反正學校教Premiere就用Premiere<br /><a href="https://accounts.animaker.com/" target="_blank" rel="noreferrer noopener">Animaker: Login</a><br />沒有影片素材只有配音時可以快速生影片的東西，有很多動態素材，包括可操作動作和表情的人形娃娃，然而有超醜的水印，斟酌使用</p>



<h3 class="wp-block-heading">字幕</h3>



<p><a href="https://srt.coderemixer.com/" target="_blank" rel="noreferrer noopener">Fast SRT Subtitle Toolkit</a>: 上字幕的網站工具，把影片傳到右邊，逐字稿貼到左邊，按開始之後再按播放影片，按K就可以自動幫你結束這行跳下一行，詳細的快捷鍵下面有寫，輸出選SRT檔（最簡單的字幕檔）<br />＊字幕組打軸如我的逐字稿注意事項，建議一行不要超過22個字，讓你同學不要自己分段幫你空白行，相信我，打軸遇到你會很想殺了他</p>



<p><a href="https://www.playpcesor.com/2020/01/pytranscriber-auto-subtitles.html" target="_blank" rel="noreferrer noopener">pyTranscriber </a>: 影片自動上字幕免費軟體！10分鐘搞定1小時影片</p>



<p><a href="https://www.csubtitle.com/" target="_blank" rel="noreferrer noopener">cSubitile</a>: AI 綫上快速準確語音轉文字 影片上字幕/音檔轉文字/逐字稿，三分鐘內免費</p>



<h3 class="wp-block-heading">轉檔</h3>



<p><a href="https://handbrake.fr/" target="_blank" rel="noreferrer noopener">HandBrake</a>: 免費轉檔軟體</p>



<p>下載</p>



<p><a href="https://github.com/ytdl-org/youtube-dl" target="_blank" rel="noreferrer noopener">youtube-dl</a> : 最強的 Youtube/Facebook 影片下載軟體</p>



<h3 class="wp-block-heading">特效資源庫</h3>



<p><a href="http://foxcodex.html.xdomain.jp/index.html" target="_blank" rel="noreferrer noopener">motiontable</a>: 圖形特效週期表</p>



<p><a href="https://easings.net/cn" target="_blank" rel="noreferrer noopener">緩動函數速查表</a>: 可以做圖形移動速度（？）的程式，學網站架設之類的可以用到，達文西的話描述式可以用</p>



<p><a href="https://mixkit.co/" target="_blank" rel="noreferrer noopener">Mixkit &#8211; Awesome free assets for your next video pro&#8230;</a>免費短片</p>



<h2 class="wp-block-heading">聲音</h2>



<p>音樂人聲分離</p>



<p><a href="https://www.lalal.ai/" target="_blank" rel="noreferrer noopener">Lalal.ai</a>: 分開人聲軌和音軌的網站，超過 90 秒要付錢</p>



<p><a href="https://dango.ai/" target="_blank" rel="noreferrer noopener">團子AI</a>: 人聲分離，樂器分離，升降調，超過 30 秒要付錢<br />可以用他的適用功能五次，用完了之後可以開VPN繼續用，總長不能超過三十秒不然他會隨便選段落分離，人聲分的比上面那個網站好聽，但以上步驟真的麻煩</p>



<p><a href="https://www.audacityteam.org/" target="_blank" rel="noreferrer noopener">Audacity</a>: 免費跨平台的聲音編輯軟體</p>



<p><a href="https://www.reaper.fm/" target="_blank" rel="noreferrer noopener">REAPER</a>: 另一個跨平台音樂編輯軟體，可以取代 Audacity</p>



<h3 class="wp-block-heading">素材庫</h3>



<p><a href="https://taira-komori.jpn.org/" target="_blank" rel="noreferrer noopener">無料効果音で遊ぼう！</a>: 有超級多音效，分主題，電流逼聲啊翻書聲啊到殭屍的吼聲啊擊劍聲啊都有，換成日文版東西更多，Youtube的音效庫，在Youtube工作室裡面，按搜尋也是可以找到很多音效，再不然到youtube搜綜藝音效什麼的也可以看到一堆大合集</p>



<p><a href="https://www.youtube.com/c/PeriTune/videos" target="_blank" rel="noreferrer noopener">PeriTune</a>：免費音樂素材頻道，是日本人，和風曲啊中世紀戰鬥啊有點中二啊之類的音樂做的超棒，標題裡帶著ほのぼの的曲子很多也很適合做一般youtube影片的配樂</p>



<p><a href="https://www.youtube.com/channel/UC_aEa8K-EOJ3D6gOs7HcyNg" target="_blank" rel="noreferrer noopener">NoCopyrightSounds(NCS)</a>: 非常西方的免費音樂頻道，很適合用來做那種科技、現代、流行的風格，缺點是曲子沒有情緒分類只有樂風、要一個一個聽，建議有空時就慢慢聽備著用，下面要貼來源資訊</p>



<p><a href="https://www.youtube.com/c/VlogNoCopyrightMusic/featured" target="_blank" rel="noreferrer noopener">Vlog No Copyright Music</a>: 也是西方的免費音樂頻道，曲子多半很適合旅遊、休閒的影片，這個最起碼清單有分一下情緒，下面要貼來源資訊<br />Youtube的音樂庫 在Youtube工作室裡面，音效庫隔壁，可以選情緒曲風，再不然在youtube搜no copyright或無料BGM也可以稍微找一下</p>



<p><a href="https://musmus.main.jp/" target="_blank" rel="noreferrer noopener">フリー音楽素材MusMus</a>音樂大多是爵士、輕鬆風格居多<br /><a href="https://www.youtube.com/channel/UCQuMmwxT25MPI1E0YXwARhA" target="_blank" rel="noreferrer noopener">MusMus Channel &#8211; YouTube</a>也有YT頻道可以看!!</p>



<p><a href="http://www.hmix.net/" target="_blank" rel="noreferrer noopener">フリー音楽素材 H/MIX GALLERY</a>: 不錯的音樂素材(很多RPG製作大師的遊戲也是從這裡來)</p>



<h2 class="wp-block-heading">3D 建模</h2>



<p><a href="https://www.blender.org/" target="_blank" rel="noopener">Blender</a>: 專業的自由及開放原始碼3D電腦圖形軟體<br /><a href="https://www.youtube.com/watch?list=PLexwJr_iILK7IkuhEeAYeN7aLV5AAXKa-&amp;v=TPrnSACiTJ4" target="_blank" rel="noreferrer noopener">甜甜圈教學，一步一步跟著來很有成就感</a></p>



<p><a href="https://www.youtube.com/watch?v=e-fetDXDXX8" target="_blank" rel="noreferrer noopener">更徹頭徹尾詳細解說每個功能都介紹的仔細教學，缺點是印度口音重</a></p>



<p>Blender 到 Bilibili 找會不會更多？</p>



<h3 class="wp-block-heading">素材庫</h3>



<p><a href="https://www.textures.com/library" target="_blank" rel="noreferrer noopener">Textures for 3D, graphic design and Photoshop!</a>: 3D素材庫，記得選免費的</p>



<h2 class="wp-block-heading">論文相關</h2>



<p><a href="https://sci-hub.se/" target="_blank" rel="noreferrer noopener">sci-hub.se</a>: 這邊也來分享一下學術研究導向很好用的一個網站&gt;&lt;<br />如果有被要求報告需要reference的應該都會遇過國外各大論文網站一個比一個還坑的狀況 隨便一篇論文都動輒3x鎂而且還不一定是你需要的QQ 這時候只要把網址貼來這裡<br />通常都能暴力破解 網站創始人的本意也是為了讓學術資源可以不要被各大出版商壟斷 之前跟朋友聊天發現意外地不是很多人知道這個網站XDD<br />不過大部分的大學其實每年都還是會花一堆錢抖內給論文資料庫 其實還是可以上去搜搜看 不要對不起自己的學費了XDD</p>



<h2 class="wp-block-heading">其他</h2>



<p><a href="https://10minutemail.net/?lang=zh-tw" target="_blank" rel="noreferrer noopener">10分鐘信箱</a>: 十分鐘信箱，可以生成免洗信箱，用到功能超不需要註冊卻又要求你註冊的網站就用這個，再也不用被奇奇怪怪的信件淹沒信箱。（歐美的網站多半都注意到這個了，會鎖，台灣的還沒，不過他後輟會換有的沒來得及被鎖，都可以試試看）</p>



<p><a href="https://chrome.google.com/webstore/detail/enable-copy/lmnganadkecefnhncokdlaohlkneihio" target="_blank" rel="noreferrer noopener">chrome Plugin : Enable Copy</a> : 碰到網站鎖右鍵的時候點下去,立刻可以複製東西</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2022/07/15/4725/%e5%ad%b8%e7%94%9f%e5%b7%a5%e4%bd%9c%e5%a5%bd%e7%94%a8%e8%bb%9f%e9%ab%94%e7%b6%b2%e7%ab%99%e5%88%97%e8%a1%a8/">學生工作好用軟體網站列表</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/07/15/4725/%e5%ad%b8%e7%94%9f%e5%b7%a5%e4%bd%9c%e5%a5%bd%e7%94%a8%e8%bb%9f%e9%ab%94%e7%b6%b2%e7%ab%99%e5%88%97%e8%a1%a8/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>tmux</title>
		<link>https://richliu.com/2021/08/10/4497/tmux/</link>
					<comments>https://richliu.com/2021/08/10/4497/tmux/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Tue, 10 Aug 2021 15:02:04 +0000</pubDate>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[UNIX]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=4497</guid>

					<description><![CDATA[<p>本篇是筆記文, 記一下 tmux 的特別用法 用命令列新增四個視窗 tmux \ new-session "c [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2021/08/10/4497/tmux/">tmux</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>本篇是筆記文, 記一下 tmux 的特別用法</p>



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



<h2 class="wp-block-heading">用命令列新增四個視窗</h2>



<pre class="wp-block-preformatted">tmux \
   new-session  "command1 ; read" \; \
   split-window "command2 ; read" \; \
   select-pane -U \; \
   split-window -h "command3 ; read" \; \
   select-pane -D \; \
   split-window -h "command4 ; read" \; </pre>



<p>如果是要在 tmux 內新增一個視窗, 將 new-session 改成 new-window</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1130" height="800" src="https://richliu.com/wp-content/uploads/2021/08/image.png" alt="" class="wp-image-4498" srcset="https://richliu.com/wp-content/uploads/2021/08/image.png 1130w, https://richliu.com/wp-content/uploads/2021/08/image-600x425.png 600w, https://richliu.com/wp-content/uploads/2021/08/image-768x544.png 768w" sizes="auto, (max-width: 1130px) 100vw, 1130px" /></figure>



<h2 class="wp-block-heading">偵測目前是不是在 tmux 內</h2>



<p>echo $TMUX </p>
<p>The post <a rel="nofollow" href="https://richliu.com/2021/08/10/4497/tmux/">tmux</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/08/10/4497/tmux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Ｗinodws7 無法存取 Windows Installer 服務</title>
		<link>https://richliu.com/2020/08/03/4306/%ef%bd%97inodws7-%e7%84%a1%e6%b3%95%e5%ad%98%e5%8f%96-windows-installer-%e6%9c%8d%e5%8b%99/</link>
					<comments>https://richliu.com/2020/08/03/4306/%ef%bd%97inodws7-%e7%84%a1%e6%b3%95%e5%ad%98%e5%8f%96-windows-installer-%e6%9c%8d%e5%8b%99/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Mon, 03 Aug 2020 14:55:26 +0000</pubDate>
				<category><![CDATA[Computer/Technical]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[safe mode]]></category>
		<category><![CDATA[usb]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[windows installer]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=4306</guid>

					<description><![CDATA[<p>這個問題 Google 出來這個 URL 的方法我不能用當您嘗試安裝 Office 時，無法存取 [Windo [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2020/08/03/4306/%ef%bd%97inodws7-%e7%84%a1%e6%b3%95%e5%ad%98%e5%8f%96-windows-installer-%e6%9c%8d%e5%8b%99/">Ｗinodws7 無法存取 Windows Installer 服務</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>這個問題 Google 出來這個 URL 的方法我不能用<br /><a href="https://docs.microsoft.com/zh-tw/office/troubleshoot/installation/windows-installer-service-not-be-accesse" target="_blank" rel="noopener">當您嘗試安裝 Office 時，無法存取 [Windows Installer 服務]</a><br /><br />找了好久繞了好大一圈，最後解決方法是<br />執行  services.msc  之後，將 Windows Installer 啟動就可以了<br /><a href="https://www.utilizewindows.com/managing-services-in-windows-7/" target="_blank" rel="noopener">Managing Services in Windows 7</a></p>



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



<p>

另外還因為偷懶不想按 F8 直接進 Safe Mode, 直接重啟時就進入 Safe Mode, 沒想到電腦 USB 有問題，鍵盤滑鼠都沒有辦法動，網路上的解決辦法都沒有用

</p>



<figure class="wp-block-image"><img decoding="async" src="https://i2.wp.com/neosmart.net/wiki/wp-content/uploads/sites/5/2014/09/msconfig-windows-8.png?resize=386%2C133&amp;ssl=1" alt="Boot options menu in Windows"/></figure>



<p>這時可以開機按 F8 進 Recovery Mode ，叫出 command line 執行 bcdedit ，執行以下命令<br /><br />$ <em>bcdedit /deletevalue {default} safeboot</em><br /><br />再重開機就不會進 Safe Mode 了<br /><a href="https://www.tenforums.com/general-support/139205-how-escape-msconfig-induced-safe-mode-boot-loop.html" target="_blank" rel="noopener">How to &#8211; Escape from an MSConfig-induced Safe mode boot loop</a><br /><br />踩到一堆雷，特此紀念一篇</p>



<p><br /></p>
<p>The post <a rel="nofollow" href="https://richliu.com/2020/08/03/4306/%ef%bd%97inodws7-%e7%84%a1%e6%b3%95%e5%ad%98%e5%8f%96-windows-installer-%e6%9c%8d%e5%8b%99/">Ｗinodws7 無法存取 Windows Installer 服務</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2020/08/03/4306/%ef%bd%97inodws7-%e7%84%a1%e6%b3%95%e5%ad%98%e5%8f%96-windows-installer-%e6%9c%8d%e5%8b%99/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>PIME 大易三碼</title>
		<link>https://richliu.com/2019/04/29/3983/pime-%e5%a4%a7%e6%98%93%e4%b8%89%e7%a2%bc/</link>
					<comments>https://richliu.com/2019/04/29/3983/pime-%e5%a4%a7%e6%98%93%e4%b8%89%e7%a2%bc/#comments</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Mon, 29 Apr 2019 12:40:03 +0000</pubDate>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[dayi]]></category>
		<category><![CDATA[pime]]></category>
		<category><![CDATA[大易]]></category>
		<category><![CDATA[大易三碼]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=3983</guid>

					<description><![CDATA[<p>對一個大易用戶來說，好的輸入法不好找。Windows 7 時是 Yahoo 輸入法最好用，但是 Yahoo 輸 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2019/04/29/3983/pime-%e5%a4%a7%e6%98%93%e4%b8%89%e7%a2%bc/">PIME 大易三碼</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>對一個大易用戶來說，好的輸入法不好找。<br />Windows 7 時是 Yahoo 輸入法最好用，但是 Yahoo 輸入法已經停止開發，Windows 10 上比較好一點的輸入法只有 <a href="https://github.com/EasyIME/PIME/releases" target="_blank" rel="noopener">PIME </a><br /></p>



<p>前一陣子回答了一個 PIME 的問題 <a href="https://github.com/EasyIME/PIME/issues/520" target="_blank" rel="noopener">大易3碼表缺字&nbsp;#520</a><br /></p>



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



<p>剛好當時也正在想三碼和四碼的問題，追了一下程式碼之後就覺得應該不是靠程式組字，而是靠碼表組字<br /><br />PIME 內建的大易字庫有三個，大易三碼，大易四碼和泰瑞大易四碼<br />不過這三個我都用的不順手，所以改用openvanilla的(註: openvanilla/Source/Mac/MacDataTables/dayi3.cin )的字庫，修改了一下讓他可以在 PIME 用，但是這個字庫有些三碼字的順便並不是以常用字為基礎，所以我就稍稍修改字的順序，讓自己用起來比較舒服一點<br />這個碼表比較適合個人的習慣，這是三碼字庫但是也可以打到四碼，對我這種不嚴謹的人來說，這會比較好用<br /><br />這是 Dropbox 下載位置，應該沒有很多人會下載，所以不會被擋才是<br />更新 (更新內容在下方的 github 連結內)<br />2022/01/16<br />https://www.dropbox.com/s/h7wu38jrdtf7hat/dayi4-20220116.rar?dl=0<br />加了又双叒叕，還有加一些三碼和調整前後順序<br /><br />2021/09/26 <br />https://www.dropbox.com/s/w6a09ezq6zy9uqj/dayi4-20210926.rar?dl=0<br /></p>



<p>下載之後將 dayi4.json copy 到 C:\Program Files (x86)\PIME\python\cinbase\json<br />記得備份dayi4.json，切到三碼後，打幾個字，再切到四碼應該就可以換新的輸入順序<br /><br />另一個檔案是 dayi4-add3.json ，也是用程式產生的，將所有的四碼字都產生一個三碼字的版本，不過沒有調過順序，所以就只是給大家玩玩看</p>



<p>原始大易三碼放在 github ，是用 cin 的格式儲存，再手動用程式轉成 json <br /><a href="https://github.com/richliu/PIME/blob/master/python/cinbase/cin/dayi4.cin" target="_blank" rel="noopener">https://github.com/richliu/PIME/blob/master/python/cinbase/cin/dayi4.cin</a> </p>



<p>Linux 下 GCIN 的改法可以參考這一篇<br /><br /><a href="https://richliu.com/2019/04/05/3980/kubuntu%E5%9F%B7%E8%A1%8Cgtk-%E7%A8%8B%E5%BC%8F%E7%9A%84%E6%80%AA%E5%95%8F%E9%A1%8Cgcin%E6%94%B9dayi%E4%B8%89%E7%A2%BC%E8%A1%A8">Kubuntu執行GTK 程式的怪問題+gcin改dayi三碼表</a></p>
<p>The post <a rel="nofollow" href="https://richliu.com/2019/04/29/3983/pime-%e5%a4%a7%e6%98%93%e4%b8%89%e7%a2%bc/">PIME 大易三碼</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2019/04/29/3983/pime-%e5%a4%a7%e6%98%93%e4%b8%89%e7%a2%bc/feed/</wfw:commentRss>
			<slash:comments>13</slash:comments>
		
		
			</item>
	</channel>
</rss>
