<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3315632359857231858</id><updated>2026-05-05T16:37:25.122+08:00</updated><category term="Linux"/><category term="小技巧"/><category term="作業系統"/><category term="網際網路"/><category term="未分類"/><category term="Windows"/><category term="P2P"/><category term="Firefox"/><category term="ubuntu"/><category term="小玩意"/><category term="日常瑣事"/><category term="瀏覽器"/><category term="survey"/><category term="虛擬化"/><category term="OTL"/><category term="Python"/><category term="it sucks"/><category term="software"/><category term="kubuntu"/><category term="敗家"/><category term="資訊安全"/><category term="KDE"/><category term="django"/><category term="redis"/><category term="vmware"/><category term="zoome"/><category term="抱怨文"/><category term="Chrome"/><category term="GPS"/><category term="HD"/><category term="Qt4"/><category term="SONY"/><category term="bug"/><category term="googleearth"/><category term="ipv6"/><category term="llm"/><category term="security"/><category term="youtube"/><category term="惡搞"/><category term="程式語言"/><category term="3D Printer"/><category term="Android"/><category term="CloudStation"/><category term="Cloudfront"/><category term="ComfyUI"/><category term="GAE"/><category term="Geforce"/><category term="Gigabyte"/><category term="HTML5"/><category term="Hinet"/><category term="Multimedia"/><category term="MusePack"/><category term="NicoVideo"/><category term="Nvidia"/><category term="OggVorbis"/><category term="Opera"/><category term="PHP-FPM"/><category term="PS4"/><category term="PlayStation"/><category term="PowerAMP"/><category term="Samba"/><category term="Sparq"/><category term="Store"/><category term="Synology"/><category term="TPIX"/><category term="U2442D"/><category term="Unigate"/><category term="Vista"/><category term="btrfs"/><category term="docker"/><category term="fedora"/><category term="foobar2000"/><category term="hacking"/><category term="iot"/><category term="malware"/><category term="motorcycle"/><category term="qtdesigner"/><category term="rkt"/><category term="seagate"/><category term="trojan"/><category term="ups"/><category term="video"/><category term="virtualbox"/><category term="virus"/><category term="vpn"/><category term="台東"/><category term="容器"/><category term="旅遊"/><category term="檔案系統"/><category term="次文化"/><category term="花蓮"/><category term="語言"/><category term="防毒軟體"/><category term="電影"/><title type='text'>昨日東風</title><subtitle type='html'>Do the right things.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.pastwind.org/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://blog.pastwind.org/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Ryan He</name><uri>http://www.blogger.com/profile/00678904484712055422</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>236</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3315632359857231858.post-376851617536113062</id><published>2026-05-05T16:37:00.000+08:00</published><updated>2026-05-05T16:37:25.022+08:00</updated><title type='text'>RTX 3060 12GB的LLM性能測試</title><content type='html'>&lt;p&gt;&lt;/p&gt;&lt;p&gt;Rentry的易讀版本： &lt;a href=&quot;https://rentry.org/uwq752e3&quot;&gt;https://rentry.org/uwq752e3&lt;/a&gt;&lt;/p&gt;&lt;h1 id=&quot;llm性能測試&quot;&gt;LLM性能測試 &lt;/h1&gt;
&lt;h2 id=&quot;硬體&quot;&gt;硬體&lt;/h2&gt;
&lt;p&gt;CPU: Intel i5-12500&lt;br /&gt;
RAM: 64GB DDR4-3200 （雙通道）&lt;br /&gt;
GPU: NVIDIA RTX 3060 12GB&lt;br /&gt;
OS: Unraid 7.5&lt;/p&gt;
&lt;p&gt;測試軟體：llama-benchy 0.3.7&lt;br /&gt;
指令&lt;br /&gt;
&lt;code&gt;llama-benchy   --base-url &amp;lt;api url&amp;gt;  --model 
zerofata/G4-MeroMero-26B-A4B --depth 0 4096 8192 16384  --tg 128 
--latency-mode generation   --enable-prefix-caching&lt;/code&gt;&lt;br /&gt;
測試模型：G4-MeroMero-26B-A4B Q5_K_M量化版本（Gamma 4 26B A4B的微調版本）&lt;/p&gt;
&lt;h3 id=&quot;測試標的&quot;&gt;測試標的&lt;/h3&gt;
&lt;h4 id=&quot;llamacpp-b9014-cuda12-backend官方提供的docker映像&quot;&gt;llamacpp b9014 cuda12 backend（官方提供的docker映像）&lt;/h4&gt;
&lt;p&gt;啟動參數&lt;br /&gt;
&lt;code&gt;llama-server -m /models/model.gguf --port 8000 --host 0.0.0.0 -fit
 on -c 32768 --chat-template-file /models/g4-chat_template.jinja&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;測試結果&lt;/p&gt;
&lt;div class=&quot;ntable-wrapper&quot;&gt;
&lt;table class=&quot;ntable&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style=&quot;text-align: left;&quot;&gt;model&lt;/th&gt;
&lt;th style=&quot;text-align: right;&quot;&gt;test&lt;/th&gt;
&lt;th style=&quot;text-align: right;&quot;&gt;t/s&lt;/th&gt;
&lt;th style=&quot;text-align: right;&quot;&gt;peak t/s&lt;/th&gt;
&lt;th style=&quot;text-align: right;&quot;&gt;ttfr (ms)&lt;/th&gt;
&lt;th style=&quot;text-align: right;&quot;&gt;est_ppt (ms)&lt;/th&gt;
&lt;th style=&quot;text-align: right;&quot;&gt;e2e_ttft (ms)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;pp2048&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;512.92 ± 26.80&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;4105.91 ± 202.11&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;4005.34 ± 202.11&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;4105.91 ± 202.11&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;tg128&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;31.04 ± 0.27&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;32.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_pp @ d4096&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;468.40 ± 29.34&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;8880.41 ± 526.80&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;8779.84 ± 526.80&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;8880.41 ± 526.80&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_tg @ d4096&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;29.73 ± 0.10&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;31.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;pp2048 @ d4096&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;466.13 ± 21.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;4503.40 ± 204.89&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;4402.83 ± 204.89&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;4503.40 ± 204.89&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;tg128 @ d4096&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;29.50 ± 0.04&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;30.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_pp @ d8192&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;461.37 ± 16.77&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;17882.10 ± 663.02&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;17781.53 ± 663.02&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;17882.10 ± 663.02&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_tg @ d8192&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;29.79 ± 0.04&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;31.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;pp2048 @ d8192&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;451.60 ± 13.77&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;4639.80 ± 140.88&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;4539.23 ± 140.88&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;4639.80 ± 140.88&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;tg128 @ d8192&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;28.83 ± 0.66&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;30.67 ± 0.47&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_pp @ d16384&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;473.32 ± 15.88&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;34756.61 ± 1166.07&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;34656.04 ± 1166.07&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;34756.61 ± 1166.07&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_tg @ d16384&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;28.18 ± 0.48&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;30.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;pp2048 @ d16384&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;453.97 ± 5.18&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;4612.45 ± 51.82&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;4511.88 ± 51.82&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;4612.45 ± 51.82&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;tg128 @ d16384&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;29.21 ± 0.11&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;30.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h3 id=&quot;測試結果分析gemini&quot;&gt;測試結果分析（Gemini&lt;/h3&gt;
&lt;p&gt;這份針對 &lt;strong&gt;32k 上下文長度（Context Size）&lt;/strong&gt; 的測試結果，展現了 &lt;strong&gt;Gemma 4 26B A4B&lt;/strong&gt; 在 &lt;strong&gt;RTX 3060 12GB&lt;/strong&gt; 顯卡上極為驚人的長文本處理韌性。以下將數據整理為效能分析段落：&lt;/p&gt;
&lt;h4 id=&quot;核心生成效能與穩定性&quot;&gt;核心生成效能與穩定性&lt;/h4&gt;
&lt;p&gt;在將上下文長度擴展至 32,768 的環境下，模型展現了極強的生成速度（Token Generation）穩定性。從初始狀態的 &lt;strong&gt;31.04 t/s&lt;/strong&gt; 到處理至 16k 深度時的 &lt;strong&gt;28.18 t/s&lt;/strong&gt;，效能衰減率僅約 &lt;strong&gt;9.2%&lt;/strong&gt;。這意味著即便在長篇對話或處理複雜劇本時，使用者幾乎感受不到「蹦字」速度的變化。這種在 26B 等級模型中罕見的高穩定性，側面證實了該模型架構（如 GQA 分組查詢注意力機制）與 &lt;code&gt;llama.cpp&lt;/code&gt; 記憶體管理的高度優化，能將活躍參數與 KV Cache 完美控制在 12GB 的 VRAM 極限內。&lt;/p&gt;
&lt;h4 id=&quot;提示詞處理與延遲趨勢&quot;&gt;提示詞處理與延遲趨勢&lt;/h4&gt;
&lt;p&gt;在處理輸入（Prompt Processing）方面，吞吐量穩定維持在 &lt;strong&gt;450 ~ 510 t/s&lt;/strong&gt; 之間，展現了極佳的預處理效率。首字響應時間（TTFT）則隨著文本長度呈精確的線性增長：處理 4k 文本約需 &lt;strong&gt;8.8 秒&lt;/strong&gt;，8k 需 &lt;strong&gt;17.8 秒&lt;/strong&gt;，當長度達到 16k 時則需約 &lt;strong&gt;34.7 秒&lt;/strong&gt;。雖然等待時間隨長度增加，但並沒有出現因顯存溢出或系統記憶體交換（Swap）導致的效能崩潰（Cliff edge），這對於需要頻繁貼入長文進行摘要或代碼分析的使用者來說，提供了非常可預測且穩定的使用體驗。&lt;/p&gt;
&lt;h4 id=&quot;綜合效能評價&quot;&gt;綜合效能評價&lt;/h4&gt;
&lt;p&gt;總結來看，這套配置在 &lt;strong&gt;16k context&lt;/strong&gt; 範圍內達到了「效能與容量」的甜蜜平衡點。雖然系統設定上限為
 32k，但在 16k 深度下依然能維持超過 28 t/s 
的生成速度，完全能勝任中長篇文件閱讀、深度角色扮演（Roleplay）以及長代碼庫的維護任務。對於 RTX 3060 12GB 
的使用者而言，這份數據證明了該硬體在適當的量化方案下，依然擁有越級挑戰大型長文本模型的實力。&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.pastwind.org/feeds/376851617536113062/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.pastwind.org/2026/05/rtx-3060-12gbllm.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/376851617536113062'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/376851617536113062'/><link rel='alternate' type='text/html' href='http://blog.pastwind.org/2026/05/rtx-3060-12gbllm.html' title='RTX 3060 12GB的LLM性能測試'/><author><name>Ryan He</name><uri>http://www.blogger.com/profile/00678904484712055422</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3315632359857231858.post-2559884353119794975</id><published>2026-05-04T16:24:00.001+08:00</published><updated>2026-05-04T16:24:28.198+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="llm"/><title type='text'>本地跑LLM的算力需求</title><content type='html'>&lt;p&gt;Prefill（預填充階段）：運算性能。處理使用者輸入的提示詞，運算速度卡在GPU的性能。影響首字輸出時間（Time to First Token, TTFT），如果處理的的上下文很大，就需要花很長的時間才會開始輸出結果。比如說我的Radeon 780m能夠處理400t/s，處理32k的上下文大約得花80秒。&lt;br /&gt;&lt;br /&gt;Decode（解碼階段）：記憶體頻寬。逐一生成 Token 的過程，卡在GPU與VRAM之間的頻寬。每生成一個新 Token，模型都必須把所有的模型參數從顯示記憶體重新讀取到運算單元中一次，只為了計算「那一個」Token。以Radeon 780m為例，搭配雙通道DDR5-5600 SODIMM理論上有89.6GB/s的頻寬，跑Gemma 4 26B A4B Q5_K_M，因為量化加上只有啟動3.8B的參數，每次從記憶體讀取的量約為2.6GB。這樣可以估算生成速度約在34t/s，但實際上會有額外耗損，根據我的實測是在20~14t/s左右。不算快，但高於一般人的閱讀速度。我有試過跑Gemma 4 31B IQ4_XS的量化稠密模型，生成速度大約是2t/s，太慢了。&lt;br /&gt;&lt;br /&gt;結論&lt;br /&gt;如果要處理的文本很大，優先考慮GPU運算性能。&lt;br /&gt;如果輸出的內容很大，優先考慮記憶體頻寬。&lt;br /&gt;&lt;br /&gt;若是兩者都需要，RTX 6000 Blackwell 96GB在旁邊招手呢，一張約新台幣30萬左右，比買三張RTX 5090貴，但是配置較簡單。&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.pastwind.org/feeds/2559884353119794975/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.pastwind.org/2026/05/llm.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/2559884353119794975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/2559884353119794975'/><link rel='alternate' type='text/html' href='http://blog.pastwind.org/2026/05/llm.html' title='本地跑LLM的算力需求'/><author><name>Ryan He</name><uri>http://www.blogger.com/profile/00678904484712055422</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3315632359857231858.post-6232021368564489926</id><published>2026-05-02T09:04:00.003+08:00</published><updated>2026-05-02T09:04:32.465+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="llm"/><title type='text'>Ryzen 8845HS w/ Radeon 780M的LLM性能測試</title><content type='html'>&lt;p&gt;&amp;nbsp;Rentry的易讀表格版本：&lt;a href=&quot;https://rentry.co/5utrg5cy&quot;&gt;https://rentry.co/5utrg5cy&lt;/a&gt;&lt;/p&gt;&lt;h1 id=&quot;llm性能測試&quot;&gt;LLM性能測試&lt;/h1&gt;
&lt;h2 id=&quot;硬體&quot;&gt;硬體&lt;/h2&gt;
&lt;p&gt;GMKTek K8 Plus&lt;br /&gt;
CPU: AMD Ryzen 8845HS&lt;br /&gt;
RAM: 64GB DDR5-5600 SODIMM（雙通道）&lt;br /&gt;
GPU: Radeon 780m 8GB（透過BIOS設置VRAM大小）&lt;br /&gt;
OS: Ubuntu 24.04&lt;/p&gt;
&lt;h3 id=&quot;系統配置調整&quot;&gt;系統配置調整：&lt;/h3&gt;
&lt;p&gt;/etc/default/grub&lt;br /&gt;
&lt;code&gt;GRUB_CMDLINE_LINUX_DEFAULT=&quot;amdgpu.gttsize=49152 ttm.pages_limit=12582912&quot;&lt;/code&gt;&lt;br /&gt;
主要是讓單一程序可以使用最多48GB的記憶體。&lt;/p&gt;
&lt;p&gt;測試軟體：llama-benchy 0.3.7&lt;br /&gt;
指令&lt;br /&gt;
&lt;code&gt;llama-benchy   --base-url &amp;lt;api url&amp;gt;  --model 
zerofata/G4-MeroMero-26B-A4B --depth 0 4096 8192 16384 32768  --tg 128 
--latency-mode generation   --enable-prefix-caching&lt;/code&gt;&lt;br /&gt;
測試模型：G4-MeroMero-26B-A4B Q5_K_M量化版本（Gamma 4 26B A4B的微調版本）&lt;/p&gt;
&lt;h3 id=&quot;測試標的&quot;&gt;測試標的&lt;/h3&gt;
&lt;h4 id=&quot;koboldcpp-11122&quot;&gt;koboldcpp-1.112.2&lt;/h4&gt;
&lt;p&gt;啟動指令&lt;br /&gt;
&lt;code&gt;./koboldcpp-linux-x64-nocuda --model 
./G4-MeroMero-26B-A4B-Q5_K_M.gguf --host 0.0.0.0 --threads 7 --usevulkan
 0 --blasbatchsize 2048 --gpulayers 49 --contextsize 32768 
--flashattention --skiplauncher --jinja --mmproj 
./mmproj-Gemma-4-26b-a4b-f16.gguf --mlock --usemmap --jinjatemplate 
./chat_template.jinja&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;ntable-wrapper&quot;&gt;
&lt;table class=&quot;ntable&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style=&quot;text-align: left;&quot;&gt;model&lt;/th&gt;
&lt;th style=&quot;text-align: right;&quot;&gt;test&lt;/th&gt;
&lt;th style=&quot;text-align: right;&quot;&gt;t/s&lt;/th&gt;
&lt;th style=&quot;text-align: right;&quot;&gt;peak t/s&lt;/th&gt;
&lt;th style=&quot;text-align: right;&quot;&gt;ttfr (ms)&lt;/th&gt;
&lt;th style=&quot;text-align: right;&quot;&gt;est_ppt (ms)&lt;/th&gt;
&lt;th style=&quot;text-align: right;&quot;&gt;e2e_ttft (ms)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;pp2048&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;419.95 ± 2.39&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;5288.49 ± 27.66&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;4879.28 ± 27.66&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;5288.49 ± 27.66&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;tg128&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;18.41 ± 0.04&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;20.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_pp @ d4096&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;384.90 ± 3.16&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;11054.21 ± 87.02&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;10644.99 ± 87.02&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;11054.21 ± 87.02&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_tg @ d4096&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;17.54 ± 0.05&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;19.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;pp2048 @ d4096&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;350.57 ± 2.01&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;6251.27 ± 33.44&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;5842.05 ± 33.44&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;6251.27 ± 33.44&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;tg128 @ d4096&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;17.30 ± 0.02&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;19.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_pp @ d8192&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;357.27 ± 1.90&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;23341.93 ± 122.05&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;22932.71 ± 122.05&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;23341.93 ± 122.05&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_tg @ d8192&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;16.97 ± 0.02&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;18.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;pp2048 @ d8192&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;313.21 ± 0.19&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;6947.91 ± 3.87&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;6538.69 ± 3.87&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;6947.91 ± 3.87&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;tg128 @ d8192&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;16.75 ± 0.02&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;18.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_pp @ d16384&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;311.77 ± 1.46&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;52964.47 ± 245.13&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;52555.26 ± 245.13&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;52964.47 ± 245.13&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_tg @ d16384&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;16.19 ± 0.08&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;17.33 ± 0.47&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;pp2048 @ d16384&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;254.26 ± 0.49&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;8464.01 ± 15.68&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;8054.79 ± 15.68&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;8464.01 ± 15.68&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;tg128 @ d16384&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;15.94 ± 0.02&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;17.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_pp @ d32768&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;261.11 ± 1.65&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;125417.69 ± 791.20&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;125008.48 ± 791.20&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;125417.69 ± 791.20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_tg @ d32768&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;14.70 ± 0.02&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;16.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;pp2048 @ d32768&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;142.70 ± 1.09&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;14761.37 ± 109.20&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;14352.15 ± 109.20&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;14761.37 ± 109.20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;tg128 @ d32768&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;14.77 ± 0.02&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;16.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h4 id=&quot;llamacpp-rocm-b1256&quot;&gt;llamacpp-rocm b1256&lt;/h4&gt;
&lt;p&gt;啟動指令&lt;br /&gt;
&lt;code&gt;./llamacpp-rocm/llama-server -m ./G4-MeroMero-26B-A4B-Q5_K_M.gguf 
-ngl 99 -c 32768 --temp 1 --top-k 64 --top-p 0.95 --host 0.0.0.0  -mm 
./mmproj-Gemma-4-26b-a4b-f16.gguf --chat-template-file 
./chat_template.jinja&lt;/code&gt;&lt;br /&gt;
在16k的測試出現異常，可能是模型崩潰與重複輸出造成。&lt;/p&gt;
&lt;div class=&quot;ntable-wrapper&quot;&gt;
&lt;table class=&quot;ntable&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style=&quot;text-align: left;&quot;&gt;model&lt;/th&gt;
&lt;th style=&quot;text-align: right;&quot;&gt;test&lt;/th&gt;
&lt;th style=&quot;text-align: right;&quot;&gt;t/s&lt;/th&gt;
&lt;th style=&quot;text-align: right;&quot;&gt;peak t/s&lt;/th&gt;
&lt;th style=&quot;text-align: right;&quot;&gt;ttfr (ms)&lt;/th&gt;
&lt;th style=&quot;text-align: right;&quot;&gt;est_ppt (ms)&lt;/th&gt;
&lt;th style=&quot;text-align: right;&quot;&gt;e2e_ttft (ms)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;pp2048&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;335.70 ± 14.45&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;6233.64 ± 258.34&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;6115.70 ± 258.34&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;6233.64 ± 258.34&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;tg128&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;15.42 ± 0.01&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;16.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_pp @ d4096&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;290.31 ± 12.24&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;14253.80 ± 580.96&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;14135.86 ± 580.96&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;14253.80 ± 580.96&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_tg @ d4096&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;14.07 ± 0.01&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;15.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;pp2048 @ d4096&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;238.90 ± 2.19&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;8691.36 ± 78.59&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;8573.42 ± 78.59&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;8691.36 ± 78.59&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;tg128 @ d4096&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;13.79 ± 0.01&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;14.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_pp @ d8192&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;260.37 ± 3.20&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;31589.77 ± 383.96&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;31471.83 ± 383.96&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;31589.77 ± 383.96&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_tg @ d8192&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;13.67 ± 0.01&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;14.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;pp2048 @ d8192&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;218.36 ± 0.69&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;9497.17 ± 29.59&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;9379.23 ± 29.59&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;9497.17 ± 29.59&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;tg128 @ d8192&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;13.55 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;14.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_pp @ d16384&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;241.87 ± 3.54&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;67874.56 ± 1000.78&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;67756.62 ± 1000.78&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;67874.56 ± 1000.78&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_tg @ d16384&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;66.75 ± 0.02&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;70.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;pp2048 @ d16384&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;204.84 ± 2.69&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;10117.85 ± 130.36&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;9999.91 ± 130.36&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;10117.85 ± 130.36&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;tg128 @ d16384&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;66.23 ± 0.04&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;69.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_pp @ d32768&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;191.92 ± 10.78&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;171424.55 ± 10017.11&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;171306.61 ± 10017.11&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;171424.55 ± 10017.11&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_tg @ d32768&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;12.37 ± 0.07&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;13.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;pp2048 @ d32768&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;142.47 ± 3.70&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;14502.40 ± 380.91&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;14384.46 ± 380.91&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;14502.40 ± 380.91&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;tg128 @ d32768&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;12.34 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;13.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h3 id=&quot;llamacpp-b8999-vulkan-backend&quot;&gt;llamacpp b8999 (vulkan backend)&lt;/h3&gt;
&lt;p&gt;啟動指令&lt;br /&gt;
&lt;code&gt;./llama-b8999/llama-server -m ./G4-MeroMero-26B-A4B-Q5_K_M.gguf 
-ngl 99 -c 49152 --temp 1 --top-k 64 --top-p 0.95 --host 0.0.0.0  -mm 
./mmproj-Gemma-4-26b-a4b-f16.gguf --chat-template-file 
./chat_template.jinja&lt;/code&gt;&lt;br /&gt;
在32k的測試出現異常，可能是模型崩潰與重複輸出造成。&lt;/p&gt;
&lt;div class=&quot;ntable-wrapper&quot;&gt;
&lt;table class=&quot;ntable&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style=&quot;text-align: left;&quot;&gt;model&lt;/th&gt;
&lt;th style=&quot;text-align: right;&quot;&gt;test&lt;/th&gt;
&lt;th style=&quot;text-align: right;&quot;&gt;t/s&lt;/th&gt;
&lt;th style=&quot;text-align: right;&quot;&gt;peak t/s&lt;/th&gt;
&lt;th style=&quot;text-align: right;&quot;&gt;ttfr (ms)&lt;/th&gt;
&lt;th style=&quot;text-align: right;&quot;&gt;est_ppt (ms)&lt;/th&gt;
&lt;th style=&quot;text-align: right;&quot;&gt;e2e_ttft (ms)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;pp2048&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;315.62 ± 12.25&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;6633.52 ± 244.36&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;6502.53 ± 244.36&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;6633.52 ± 244.36&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;tg128&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;20.70 ± 0.02&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;21.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_pp @ d4096&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;291.80 ± 10.49&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;14189.23 ± 493.34&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;14058.24 ± 493.34&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;14189.23 ± 493.34&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_tg @ d4096&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;19.54 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;20.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;pp2048 @ d4096&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;275.22 ± 1.81&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;7572.64 ± 49.08&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;7441.65 ± 49.08&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;7572.64 ± 49.08&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;tg128 @ d4096&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;19.53 ± 0.01&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;20.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_pp @ d8192&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;286.29 ± 1.35&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;28747.85 ± 134.81&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;28616.86 ± 134.81&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;28747.85 ± 134.81&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_tg @ d8192&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;19.68 ± 0.03&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;20.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;pp2048 @ d8192&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;252.09 ± 0.21&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;8254.93 ± 6.84&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;8123.94 ± 6.84&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;8254.93 ± 6.84&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;tg128 @ d8192&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;18.64 ± 0.03&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;19.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_pp @ d16384&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;269.11 ± 1.28&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;61018.78 ± 289.55&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;60887.79 ± 289.55&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;61018.78 ± 289.55&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_tg @ d16384&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;18.08 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;19.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;pp2048 @ d16384&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;217.98 ± 1.58&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;9526.90 ± 67.69&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;9395.91 ± 67.69&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;9526.90 ± 67.69&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;tg128 @ d16384&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;18.01 ± 0.02&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;19.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_pp @ d32768&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;231.32 ± 0.68&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;141795.99 ± 417.40&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;141665.00 ± 417.40&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;141795.99 ± 417.40&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;ctx_tg @ d32768&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;31.67 ± 20.37&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;41.67 ± 33.47&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;pp2048 @ d32768&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;168.40 ± 1.35&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;12292.98 ± 97.49&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;12161.99 ± 97.49&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;12313.51 ± 124.96&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;zerofata/G4-MeroMero-26B-A4B&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;tg128 @ d32768&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;16.47 ± 0.01&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;17.00 ± 0.00&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h2 id=&quot;綜合測試結論使用gemini做的分析&quot;&gt;綜合測試結論（使用Gemini做的分析&lt;/h2&gt;
&lt;h3 id=&quot;1-硬體潛力與系統優化&quot;&gt;1. 硬體潛力與系統優化&lt;/h3&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;記憶體配置與優化：&lt;/strong&gt; 透過調整 Linux 核心參數（GRUB）將 &lt;code&gt;amdgpu.gttsize&lt;/code&gt; 設為 48GB，是成功在此類 iGPU 設備上順暢執行 26B 大模型量化版的關鍵。64GB 的實體記憶體為 780M 提供了充足的空間來處理大型模型文件及高達 32K 的 Context 需求。&lt;/li&gt;&lt;li&gt;&lt;strong&gt;推論效能：&lt;/strong&gt; 整體而言，在 8845HS 的平台上，26B Q5 模型能達到約 &lt;strong&gt;15~20 t/s&lt;/strong&gt; 的生成速度，對於單人使用情境已具備極高的實用性，接近一般人的閱讀速度。&lt;/li&gt;&lt;/ul&gt;
&lt;h3 id=&quot;2-後端軟體性能對比-backend-comparison&quot;&gt;2. 後端軟體性能對比 (Backend Comparison)&lt;/h3&gt;
&lt;div class=&quot;ntable-wrapper&quot;&gt;
&lt;table class=&quot;ntable&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style=&quot;text-align: left;&quot;&gt;測試項目&lt;/th&gt;
&lt;th style=&quot;text-align: left;&quot;&gt;&lt;strong&gt;Koboldcpp-1.112.2&lt;/strong&gt;&lt;/th&gt;
&lt;th style=&quot;text-align: left;&quot;&gt;&lt;strong&gt;Llamacpp (Vulkan)&lt;/strong&gt;&lt;/th&gt;
&lt;th style=&quot;text-align: left;&quot;&gt;&lt;strong&gt;Llamacpp-rocm&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;&lt;strong&gt;提示處理 (Prompt Processing)&lt;/strong&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;&lt;strong&gt;最快 (~420 t/s)&lt;/strong&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;中等 (~315 t/s)&lt;/td&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;較慢 (~335 t/s)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;&lt;strong&gt;權杖生成 (Token Gen)&lt;/strong&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;穩定 (~18.4 t/s)&lt;/td&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;&lt;strong&gt;最高 (~20.7 t/s)&lt;/strong&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;較慢 (~15.4 t/s)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;&lt;strong&gt;長文本穩定性 (Stability)&lt;/strong&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;&lt;strong&gt;極高&lt;/strong&gt;，隨 Context 增加性能衰減平緩。&lt;/td&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;高 Context (32k) 時出現數據異常。&lt;/td&gt;
&lt;td style=&quot;text-align: left;&quot;&gt;中 Context (16k) 時出現異常。&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Koboldcpp：&lt;/strong&gt; 在本次測試中表現最為均衡且可靠。其 Prompt Processing 速度大幅領先，且在高 Context (32768) 下依然維持穩定的生成速度（14.7 t/s），沒有出現模型崩潰或邏輯異常，是長文本應用的首選。&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Llamacpp (Vulkan)：&lt;/strong&gt; 提供了最高的初始生成速度（超過 20 t/s），但在 Context 達到 32k 時出現數據劇烈波動與異常（Variance 較大），顯示在極端上下文負荷下驅動或後端尚不夠穩定。&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Llamacpp-rocm：&lt;/strong&gt; 在此硬體配置下表現差強人意，不僅生成速度最低，且在 16k Context 時便提早出現模型異常，推測 ROCm 在此 APU 上的優化或記憶體管理仍有改進空間。&lt;/li&gt;&lt;/ul&gt;
&lt;h3 id=&quot;3-測試異常觀察&quot;&gt;3. 測試異常觀察&lt;/h3&gt;
&lt;ul&gt;&lt;li&gt;在 &lt;code&gt;llamacpp-rocm&lt;/code&gt; (16k) 與 &lt;code&gt;vulkan&lt;/code&gt; (32k) 的測試中，出現了速度異常（如跳升至 66 t/s）或誤差值過大的現象，這通常與&lt;strong&gt;模型崩潰、重複輸出 (Repetition)&lt;/strong&gt; 或 &lt;strong&gt;K-V Cache 溢位&lt;/strong&gt;有關。這指出在 iGPU 環境下進行超長文本推論時，後端軟體的穩定性 (Robustness) 比純粹的峰值速度更為重要。&lt;/li&gt;&lt;/ul&gt;
&lt;hr /&gt;
&lt;h3 id=&quot;總結建議&quot;&gt;總結建議&lt;/h3&gt;
&lt;p&gt;對於使用 &lt;strong&gt;AMD Ryzen 8000 系列 APU&lt;/strong&gt; 的用戶，若要執行 &lt;strong&gt;26B 規模&lt;/strong&gt; 的模型：&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;&lt;strong&gt;推薦後端：&lt;/strong&gt; 優先選用 &lt;strong&gt;Koboldcpp&lt;/strong&gt;，其在長文本處理的穩定度與 Prompt 處理速度上具有明顯優勢。&lt;/li&gt;&lt;li&gt;&lt;strong&gt;效能追求：&lt;/strong&gt; 若僅進行短文本對話，可嘗試 &lt;strong&gt;Llamacpp (Vulkan)&lt;/strong&gt; 以獲取最高生成速度。&lt;/li&gt;&lt;li&gt;&lt;strong&gt;環境設定：&lt;/strong&gt; 務必修改系統核心參數以釋放顯存限制，否則無法充分發揮 64GB 記憶體的硬體優勢。&lt;/li&gt;&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.pastwind.org/feeds/6232021368564489926/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.pastwind.org/2026/05/ryzen-8845hs-w-radeon-780mllm.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/6232021368564489926'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/6232021368564489926'/><link rel='alternate' type='text/html' href='http://blog.pastwind.org/2026/05/ryzen-8845hs-w-radeon-780mllm.html' title='Ryzen 8845HS w/ Radeon 780M的LLM性能測試'/><author><name>Ryan He</name><uri>http://www.blogger.com/profile/00678904484712055422</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3315632359857231858.post-315697683366804211</id><published>2025-02-21T14:34:00.003+08:00</published><updated>2025-02-25T12:49:42.403+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ComfyUI"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><title type='text'>在Ryzen 7 8845HS w/ Radeon 780M用ComfyUI生圖（Linux）</title><content type='html'>&lt;p&gt;試了很久才發現成功的方程式…這是因為每次安裝ROCm都需要下載安裝超過30GB的檔案！！！&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;tl;dr 直接說結論&lt;/p&gt;&lt;p&gt;OS: Ubuntu 22.04（因為ROCm 6.1只支援此以下的版本）&lt;/p&gt;&lt;p&gt;ROCm:&amp;nbsp; &amp;lt;= 6.1.2，6.2跟6.3都沒辦法正常運行&lt;/p&gt;&lt;p&gt;PyTorch: &amp;lt;= 2.4.1，2.5.1版會顯示不支援硬體的警告，圖片有時候無法正確產生。&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;UserWarning: Attempting to use hipBLASLt on an unsupported architecture! Overriding blas backend to hipblas&amp;nbsp; &lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;2.6以上則完全無法正常運行。使用PyTorch官網的版本而不是AMD提供的。&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://pytorch.org/get-started/previous-versions/&quot;&gt;https://pytorch.org/get-started/previous-versions/&lt;/a&gt; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;ComfyUI: 當前版本v0.3.14可正常運行。&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Update 2024/2/25&lt;/p&gt;&lt;p&gt;使用 Radeon 780M 產生圖片的時候經常會出現全黑的圖，並且出現以下警告&lt;br /&gt;&lt;/p&gt;&lt;blockquote&gt;RuntimeWarning: invalid value encountered in cast&lt;br /&gt;&amp;nbsp; img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8))&lt;/blockquote&gt;原本以為是 780M 沒有被 ROCm 支援的問題，但 ComfyUI 在去年的確發生過這樣的 bug，且不限硬體。我從下面的連結得到解法&lt;br /&gt;&lt;a href=&quot;https://github.com/comfyanonymous/ComfyUI/issues/3500&quot;&gt;https://github.com/comfyanonymous/ComfyUI/issues/3500&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;解法就是：換 scheduler，預設是 normal ，換成 karras 似乎就沒有再出現這樣的問題。 &lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;simple-translate-system-theme&quot; id=&quot;simple-translate&quot;&gt;&lt;div&gt;&lt;div class=&quot;simple-translate-button isShow&quot; style=&quot;background-image: url(&amp;quot;moz-extension://32ce0549-86d8-46da-aceb-806ee67843ba/icons/512.png&amp;quot;); height: 22px; left: 6px; top: 572px; width: 22px;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;simple-translate-panel &quot; style=&quot;font-size: 13px; height: 200px; left: 0px; top: 0px; width: 300px;&quot;&gt;&lt;div class=&quot;simple-translate-result-wrapper&quot; style=&quot;overflow: hidden;&quot;&gt;&lt;div class=&quot;simple-translate-move&quot; draggable=&quot;true&quot;&gt;&lt;/div&gt;&lt;div class=&quot;simple-translate-result-contents&quot;&gt;&lt;p class=&quot;simple-translate-result&quot; dir=&quot;auto&quot;&gt;&lt;/p&gt;&lt;p class=&quot;simple-translate-candidate&quot; dir=&quot;auto&quot;&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.pastwind.org/feeds/315697683366804211/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.pastwind.org/2025/02/ryzen-7-8845hs-w-radeon-780mcomfyuilinux.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/315697683366804211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/315697683366804211'/><link rel='alternate' type='text/html' href='http://blog.pastwind.org/2025/02/ryzen-7-8845hs-w-radeon-780mcomfyuilinux.html' title='在Ryzen 7 8845HS w/ Radeon 780M用ComfyUI生圖（Linux）'/><author><name>Ryan He</name><uri>http://www.blogger.com/profile/00678904484712055422</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3315632359857231858.post-956838783266303850</id><published>2024-12-20T11:46:00.001+08:00</published><updated>2024-12-20T11:52:22.129+08:00</updated><title type='text'>我的Home Assistant配置</title><content type='html'>&lt;blockquote&gt;&lt;p&gt;&lt;a href=&quot;https://www.home-assistant.io/&quot;&gt;Home Assistant&lt;/a&gt; 是用於家庭自動化的免費開源軟體。它作為整合平台和智慧家庭中心，允許用戶控制智慧家居設備。該軟體強調本地控制和隱私，設計獨立於任何特定的物聯網生態系統。 - 維基百科 &lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;我會使用Home Assistant （簡稱HA）應該是在我買了Sonoff S30智慧插座與Basic R2智慧開關，但我不想使用製造商的平台或App，研究了一下決定在S30刷入&lt;a href=&quot;https://esphome.io/&quot;&gt;ESPHome&lt;/a&gt;，Basic R2刷入&lt;a href=&quot;https://tasmota.github.io/docs/&quot;&gt;Tasmota&lt;/a&gt;，然後接上HA來控制。而S30還有電流計的功能，可以整合到HA做能源消耗的監測。Home Assistant是裝在Raspberry Pi 4 (4GB RAM，簡稱RPi4）。&lt;/p&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMcFU0SeKdbi6s_oUmkS6O4LT1BCDxsl4JXujJujtAIF_P7dq0VT25eBsOUkra3asQ-qulaUGfJHl8OHj8Fjw2zusRSTEbrUppH1yYep60QCcTxgfEzArmLWgoUsOVaxvZZXwC9Byo-aPQmZ52kaedBJgADETWIEgfdVvxOon89G81HLKY6jG4kaBetlk/s1389/Screenshot%202024-12-20%20at%2011-33-00%20Home%20%E2%80%93%20Home%20Assistant.png&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;752&quot; data-original-width=&quot;1389&quot; height=&quot;216&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMcFU0SeKdbi6s_oUmkS6O4LT1BCDxsl4JXujJujtAIF_P7dq0VT25eBsOUkra3asQ-qulaUGfJHl8OHj8Fjw2zusRSTEbrUppH1yYep60QCcTxgfEzArmLWgoUsOVaxvZZXwC9Byo-aPQmZ52kaedBJgADETWIEgfdVvxOon89G81HLKY6jG4kaBetlk/w400-h216/Screenshot%202024-12-20%20at%2011-33-00%20Home%20%E2%80%93%20Home%20Assistant.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;之後我想監控每個房間的溫濕度，上網搜尋可用的方案，最多人建議是小米的&lt;a href=&quot;https://buy.mi.com/tw/item/3202100014&quot;&gt;米家藍牙溫濕度計 2&lt;/a&gt;因為這個小裝置非常便宜，並刷入&lt;a href=&quot;https://github.com/pvvx/ATC_MiThermometer&quot;&gt;ATC的韌體&lt;/a&gt;來改善耗電與連接性。但問題來了，溫濕度計的放置位置離RPi4很遠，肯定收不到訊號。而改善的作法是購買幾個便宜的ESP32-C3-MINI-1刷入ESPHome的&lt;a href=&quot;https://esphome.io/components/bluetooth_proxy.html&quot;&gt;Bluetooth Proxy&lt;/a&gt;配置。之前提到使用ATC的韌體是要讓溫濕度計定期用藍芽低功耗技術來廣播資料，而這些Bluetooth Proxy則作為中繼，傳送資料回HA，這樣的設計會比主動連接的耗電量少，資料取得比較快且穩定。&lt;/p&gt;&lt;p&gt;後來我買了兩個Reolink的網路攝影機，作為車庫與門口的監控。但跟前面一樣，我不想使用製造商提供的平台或軟體，會選擇這個廠牌是因為它提供區域網路連接功能，網路上最多人推薦使用&lt;a href=&quot;https://frigate.video/&quot;&gt;FRIGATE&lt;/a&gt;，這個開源軟體可以與HA深度整合，方便檢視與管理各種事件與錄影，並且支援物件識別的功能，雖然可以使用CPU來做識別但極度推薦專用的AI加速器：&lt;a href=&quot;https://www.coral.ai/products/accelerator&quot;&gt;Coral USB Accelerator&lt;/a&gt;，可以快速識別影像中的物件。當然它提供物件識別的模型並不完美，你可以支付一次性的費用，上傳需要辨識或修正的影像來做訓練，一年內可以訓練12次。就我的經驗只訓練兩次就已經沒碰到識別錯誤的問題。自動化的部份則是使用HA論壇上網友提供的藍圖，在影像偵測到有人時發送通知到HA的手機APP。&lt;/p&gt;&lt;p&gt;因為我家是透天有鐵捲門，我就在想要怎麼把開關鐵捲門的功能整合到HA，但是我不想去修改鐵捲門控制器，因為風險太高。最後我想到的作法是拿一個外殼破損但功能完好的鐵捲門遙控器來改裝，上網研究發現只需要一片Lolin d1 mini、一個12V轉3.3V的降壓模組、然後加上幾個電晶體與電阻做成開關電路，就可以接上遙控器來控制。&lt;/p&gt;&lt;p&gt;幾個月前買了SwitchBot的套件組（主控機器人2、開關機器人、門窗感測器），主控機器人2的功能需要透過雲端連接，但是開關機器人與門窗感測器則可以使用藍芽連接，前面提到的Bluetooth Proxy又可以派上用場。門窗感測器裝在大門，可以很方便知道大門是不是沒關好，有沒有人經過，這也是透過HA來發送通知。而開關機器人則是裝在車庫的電燈開關，透過HA可以設計為打開鐵捲門同時開燈。&lt;/p&gt;&lt;p&gt;最近買了&lt;a href=&quot;https://us.shelly.com/products/shelly-em-50a-clamp&quot;&gt;Shelly EM&lt;/a&gt;想要強化能源消耗的監控，但是打開配線箱後發現這遠超過我的能力，可能要找水電技師來協助安裝。 &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strike&gt;總而言之，家庭自動化是一條不歸路，花的錢會越來越多。&lt;/strike&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.pastwind.org/feeds/956838783266303850/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.pastwind.org/2024/12/home-assistant.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/956838783266303850'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/956838783266303850'/><link rel='alternate' type='text/html' href='http://blog.pastwind.org/2024/12/home-assistant.html' title='我的Home Assistant配置'/><author><name>Ryan He</name><uri>http://www.blogger.com/profile/00678904484712055422</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMcFU0SeKdbi6s_oUmkS6O4LT1BCDxsl4JXujJujtAIF_P7dq0VT25eBsOUkra3asQ-qulaUGfJHl8OHj8Fjw2zusRSTEbrUppH1yYep60QCcTxgfEzArmLWgoUsOVaxvZZXwC9Byo-aPQmZ52kaedBJgADETWIEgfdVvxOon89G81HLKY6jG4kaBetlk/s72-w400-h216-c/Screenshot%202024-12-20%20at%2011-33-00%20Home%20%E2%80%93%20Home%20Assistant.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3315632359857231858.post-8081044289583862968</id><published>2024-12-19T10:55:00.000+08:00</published><updated>2024-12-19T10:55:13.783+08:00</updated><title type='text'>我的家用網路配置</title><content type='html'>&lt;p&gt;&amp;nbsp;紀錄一下我的家用網路配置給有興趣的人參考。&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;路由器：NanoPi R5S (4GB RAM/32GB Flash)&lt;br /&gt;作業系統是使用OpenWRT，但目前還沒有正式發布的版本，因此使用&lt;a href=&quot;https://github.com/anaelorlinski/OpenWrt-NanoPi-R5S-Builds&quot;&gt;Anael Orlinski發布的&lt;/a&gt;版本。除此之外，還有硬體製造商FriendlyARM自行發布的FriendlyWRT可以使用（但不建議）。&lt;br /&gt;&lt;br /&gt;選擇使用NanoPi R5S是因為它的性能不需要打開Software flow offloading就可以處理1Gbps的網路連線。除此之外，它還包含有兩個2.5G與一個1G乙太網路界面，可以應對未來網路升級需求。&lt;/li&gt;&lt;li&gt;區域網路：Ubiquiti的USW-Lite-8-POE與USW-Flex-Mini&lt;/li&gt;&lt;li&gt;無線網路：Ubiquiti的UniFi UAP-AC-Lite與U6-Lite。&lt;br /&gt;看到這應該會有人問為何不使用Ubiquiti的全家桶？我有考慮過，但是在購買NanoPi R5S當時能考慮的是Dream Router，但它提供了我不需要的功能（Wifi），而且性能不足且價格高昂。現在有UXG-Max可以選擇，但是價格還是蠻高的。&lt;br /&gt;&lt;br /&gt;應該還會有人問為何要買Wifi AP而不是直接買整合的Wifi Router？這是因為Wifi Router放置的位置受限，某些角落的收訊會很差，而且性能比不上功能單一的Wifi AP。&lt;br /&gt;&lt;br /&gt;會選擇Ubiquiti的設備也是因為整合性與維護性，透過UniFi Network應用程式，可以很方便檢視與管理網路狀態。當然如果要看到最完整的網路狀態還是需要搭配UniFi的路由主機。&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCWEIVQV04vNOeodrZcPePAd9xF1EkUajY0X-qzNugI9hqZFc5cHVVNsFZsIrBhavOazCDtuejngZEVFyvIX3F3AkG_ZWKc5qnnjes8rseDB8usZGCmkeu_1VgZhA5pg9aVcdwCVPNfxe_8dklztlrdzvKOi66RLqqfBdtq77j1QDVjBBLxMJ0Dh_7Su4/s1389/firefox_EMiXXICK8g.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;601&quot; data-original-width=&quot;1389&quot; height=&quot;173&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCWEIVQV04vNOeodrZcPePAd9xF1EkUajY0X-qzNugI9hqZFc5cHVVNsFZsIrBhavOazCDtuejngZEVFyvIX3F3AkG_ZWKc5qnnjes8rseDB8usZGCmkeu_1VgZhA5pg9aVcdwCVPNfxe_8dklztlrdzvKOi66RLqqfBdtq77j1QDVjBBLxMJ0Dh_7Su4/w400-h173/firefox_EMiXXICK8g.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.pastwind.org/feeds/8081044289583862968/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.pastwind.org/2024/12/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/8081044289583862968'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/8081044289583862968'/><link rel='alternate' type='text/html' href='http://blog.pastwind.org/2024/12/blog-post.html' title='我的家用網路配置'/><author><name>Ryan He</name><uri>http://www.blogger.com/profile/00678904484712055422</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCWEIVQV04vNOeodrZcPePAd9xF1EkUajY0X-qzNugI9hqZFc5cHVVNsFZsIrBhavOazCDtuejngZEVFyvIX3F3AkG_ZWKc5qnnjes8rseDB8usZGCmkeu_1VgZhA5pg9aVcdwCVPNfxe_8dklztlrdzvKOi66RLqqfBdtq77j1QDVjBBLxMJ0Dh_7Su4/s72-w400-h173-c/firefox_EMiXXICK8g.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3315632359857231858.post-5535484823956911765</id><published>2022-04-15T17:22:00.000+08:00</published><updated>2022-04-15T17:22:37.799+08:00</updated><title type='text'>尋找DS Audio的替代方案</title><content type='html'>&lt;p&gt;家裡有Synology NAS的人，可能都用過DS Audio（手機APP）與&lt;a href=&quot;https://www.synology.com/zh-tw/dsm/feature/audio_station&quot;&gt;Audio Station&lt;/a&gt;（Server），用來播放音樂算是還可以用，但這麼多年都沒什麼改進，缺乏一鍵加到最愛的功能，網頁跟手機APP把音樂加到播放清單的功能也不好用，給音樂評分的功能看起來也沒什麼用處。尋找替代方案，大多都會提到Plex Media Server，可是這個軟體太過臃腫（bloated），不符合我的需求。除此之外就是各種相容Subsonic的方案。&lt;/p&gt;&lt;p&gt;Server部份，目前使用&lt;a href=&quot;https://www.navidrome.org/&quot;&gt;NAVIDROME&lt;/a&gt;，運作起來相當輕量且迅速，網頁界面也比較現代化。安裝方式使用Docker，說明文件建議不要用root啟動程式這點就要特別注意設定檔貯存位置與音樂檔案儲存位置的存取權限，否則程式會無法啟動或存取音樂檔案。&lt;/p&gt;&lt;p&gt;Android手機APP部份先測試了&lt;a href=&quot;https://substreamerapp.com/&quot;&gt;substreamer&lt;/a&gt;，看起來很漂亮但是ui會因為io存取卡住，使用體驗打折扣。除此之外還試了&lt;a href=&quot;https://github.com/ultrasonic/ultrasonic#readme&quot;&gt;Ultrasonic&lt;/a&gt;與&lt;a href=&quot;https://github.com/austinried/subtracks#readme&quot;&gt;Subtracks&lt;/a&gt;，都相當順暢，不過在Play Store的安裝量很少，比不上substreamer。這三個App都有一鍵加到最愛與下載離線收聽的功能，基本上符合我的需求。不過從界面上來看，substreamer跟Subtracks比較符合我的喜好（跟Spotify很相似），應該會優先使用Subtracks。&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.pastwind.org/feeds/5535484823956911765/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.pastwind.org/2022/04/ds-audio.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/5535484823956911765'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/5535484823956911765'/><link rel='alternate' type='text/html' href='http://blog.pastwind.org/2022/04/ds-audio.html' title='尋找DS Audio的替代方案'/><author><name>Ryan He</name><uri>http://www.blogger.com/profile/00678904484712055422</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3315632359857231858.post-617251631290760372</id><published>2022-01-01T19:12:00.006+08:00</published><updated>2022-01-03T09:09:56.864+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iot"/><category scheme="http://www.blogger.com/atom/ns#" term="小技巧"/><title type='text'>Sonoff Basic R2 1.3刷Tasmota</title><content type='html'>&lt;p&gt;從網拍上買兩個Sonoff Basic R2，想要接臥室的嵌燈。使用ESPhome透過網頁界面把韌體刷入後，接上電源發現沒動作，LED也不會亮，改用Tasmota用網頁界面刷韌體也是同樣的情況。&lt;/p&gt;&lt;p&gt;之後在網路上搜尋&lt;a href=&quot;https://www.rigacci.org/wiki/doku.php/doc/appunti/hardware/sonoff_basic?utm_source=pocket_mylist&quot;&gt;找到有人使用同樣硬體版本的R2&lt;/a&gt;刷入韌體可以使用，他是用esptool這個指令界面工具去刷，參數部份特別指定刷入模式使用&lt;a href=&quot;https://docs.espressif.com/projects/esptool/en/latest/esp32/advanced-topics/spi-flash-modes.html#spi-flash-modes&quot;&gt;dout (Dual Output)&lt;/a&gt;，我也用同樣的指令刷入後就可以正常運作了。&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.pastwind.org/feeds/617251631290760372/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.pastwind.org/2022/01/sonoff-basic-r2-13tasmota.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/617251631290760372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/617251631290760372'/><link rel='alternate' type='text/html' href='http://blog.pastwind.org/2022/01/sonoff-basic-r2-13tasmota.html' title='Sonoff Basic R2 1.3刷Tasmota'/><author><name>Ryan He</name><uri>http://www.blogger.com/profile/00678904484712055422</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3315632359857231858.post-2946416110839444352</id><published>2021-08-23T11:01:00.001+08:00</published><updated>2021-08-23T11:01:31.590+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Samba"/><title type='text'>讓Win10在連入Samba 4 Server時，會出現登入身份驗證畫面</title><content type='html'>&lt;p&gt;這次的情況是使用者用Windows 10去連安裝在Ubuntu 20.04上頭Samba 4，不會出現身份驗證畫面，這樣就無法使用Samba分享的家目錄。如果是換成Windows 7以前的版本則會。&lt;/p&gt;&lt;p&gt;在網路上搜尋許久，最終找到這個問題的解答。&lt;/p&gt;&lt;p&gt;Ubuntu版本的Samba設定檔，預設會把map to guest指定為Bad User，只要改成never或註解這行，就會強制驗證使用者。&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.pastwind.org/feeds/2946416110839444352/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.pastwind.org/2021/08/win10samba-4-server.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/2946416110839444352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/2946416110839444352'/><link rel='alternate' type='text/html' href='http://blog.pastwind.org/2021/08/win10samba-4-server.html' title='讓Win10在連入Samba 4 Server時，會出現登入身份驗證畫面'/><author><name>Ryan He</name><uri>http://www.blogger.com/profile/00678904484712055422</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3315632359857231858.post-916408230906059273</id><published>2020-01-27T01:09:00.000+08:00</published><updated>2020-01-27T01:09:14.941+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ipv6"/><title type='text'>解決使用IPv6時，無法連上isthereanydeal.com的問題（EdgeRouter X）</title><content type='html'>使用環境：中華電信光世代100M/40M，使用Ubnt EdgeRouter X（ER-X）設置IPv6 Dual Stack&lt;br /&gt;
症狀：&lt;a href=&quot;https://isthereanydeal.com/&quot;&gt;isthereanydeal.com&lt;/a&gt;可以正確解析到正確的v6 IP，Ping也沒有問題，但是用瀏覽器開啟總是會顯示連線失敗，查Google得到&lt;a href=&quot;https://www.reddit.com/r/Ubiquiti/comments/9mcsbt/edgerouter_lite_mtumss_clamping_issue_im_at_my/&quot;&gt;以下結果&lt;/a&gt;。&lt;br /&gt;
&lt;br /&gt;
建議使用SSH登入ER-X，然後修改防火牆設定&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
admin@er-x:~$ configure&lt;br /&gt;[edit]&lt;br /&gt;admin@er-x# set firewall options mss-clamp6 mss 1432&lt;br /&gt;[edit]&lt;br /&gt;admin@er-x# commit&lt;br /&gt;[edit]&lt;br /&gt;admin@er-x# save&lt;br /&gt;Saving configuration to &#39;/config/config.boot&#39;...&lt;br /&gt;Done&lt;br /&gt;[edit]&lt;/blockquote&gt;
&lt;br /&gt;
以上設定僅適用家用型光世代，如果是固定制光世代，可能會有不同的mss值。&lt;br /&gt;
&lt;br /&gt;
參考來源：&lt;br /&gt;
&lt;a href=&quot;https://community.ui.com/questions/IPv6-mss-clamp6-setting-optimization/dfa1b7e1-e92e-4ab9-902f-580725d2e653&quot;&gt;https://community.ui.com/questions/IPv6-mss-clamp6-setting-optimization/dfa1b7e1-e92e-4ab9-902f-580725d2e653&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://community.ui.com/questions/BUG-REPORT-Mss-clamping-creates-buggy-IPtables-rules/f373f88f-ff35-4984-b879-63f114f2b6ad&quot;&gt;https://community.ui.com/questions/BUG-REPORT-Mss-clamping-creates-buggy-IPtables-rules/f373f88f-ff35-4984-b879-63f114f2b6ad&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.pastwind.org/feeds/916408230906059273/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.pastwind.org/2020/01/ipv6isthereanydealcomedgerouter-x.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/916408230906059273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/916408230906059273'/><link rel='alternate' type='text/html' href='http://blog.pastwind.org/2020/01/ipv6isthereanydealcomedgerouter-x.html' title='解決使用IPv6時，無法連上isthereanydeal.com的問題（EdgeRouter X）'/><author><name>Ryan He</name><uri>http://www.blogger.com/profile/00678904484712055422</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3315632359857231858.post-8699830164016365872</id><published>2019-11-13T10:32:00.002+08:00</published><updated>2019-11-13T10:40:06.985+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="django"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>如何在Django正確使用ManifestStaticFilesStorage這個功能</title><content type='html'>&lt;br /&gt;
假設Django專案目錄在/home/myproj。在settings.py要設定&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
# 靜態檔案對應的URL&lt;br /&gt;
STATIC_URL = &#39;/static/&#39;&lt;br /&gt;
# 靜態檔案放置的位置，這裡就等於/home/myproj/static&lt;br /&gt;
STATIC_ROOT = os.path.join(BASE_DIR, &#39;static&#39;)&lt;br /&gt;
# 放置其他靜態檔案的路徑，把css/js等檔案放在這，以下的設置等於/home/myproj/staticfile&lt;br /&gt;
STATICFILES_DIRS = (&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; os.path.join(BASE_DIR, &quot;staticfile&quot;),&lt;br /&gt;
)&lt;br /&gt;
# 使用ManifestStaticFilesStorage作為靜態檔案處理方式&lt;br /&gt;
STATICFILES_STORAGE = &#39;django.contrib.staticfiles.storage.ManifestStaticFilesStorage&#39;&lt;/blockquote&gt;
&lt;br /&gt;
&amp;nbsp;在正式運行的伺服器執行&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
./manage.py collectstatic -v 3&lt;/blockquote&gt;
會看到css跟js等檔案都複製到static目錄，並產生附加hash值的檔案。&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
...&lt;br /&gt;
Post-processed &#39;css/bootstrap.min.css&#39; as &#39;css/bootstrap.min.a15c2ac3234a.css&#39;&lt;br /&gt;
...&lt;/blockquote&gt;
每次更動這些檔案後都要執行collectstatic，否則會出錯。 &lt;br /&gt;
&lt;br /&gt;
在基礎樣板&lt;a href=&quot;https://docs.djangoproject.com/en/2.2/intro/tutorial06/&quot;&gt;載入靜態檔案&lt;/a&gt;要使用{% load static %}與{% static &#39;css/bootstrap.min.css&#39; %}來載入靜態檔案。&lt;br /&gt;
&lt;br /&gt;在Nginx關於靜態檔案目錄的設置 &lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
...&lt;br /&gt;
location /static {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alias /home/myproj/static;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
...&lt;/blockquote&gt;
&lt;br /&gt;
如果把css/js等檔案放在STATIC_ROOT裡頭，那麼執行collectstatic就不會產生附加hash值的檔案，瀏覽網站就會跳出500錯誤。錯誤Log會有ValueError: Missing staticfiles manifest entry for .... 的訊息。 &lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.pastwind.org/feeds/8699830164016365872/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.pastwind.org/2019/11/djangomanifeststaticfilesstorage.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/8699830164016365872'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/8699830164016365872'/><link rel='alternate' type='text/html' href='http://blog.pastwind.org/2019/11/djangomanifeststaticfilesstorage.html' title='如何在Django正確使用ManifestStaticFilesStorage這個功能'/><author><name>Ryan He</name><uri>http://www.blogger.com/profile/00678904484712055422</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3315632359857231858.post-4284559467000014257</id><published>2019-08-19T14:59:00.000+08:00</published><updated>2019-08-19T15:00:13.152+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><category scheme="http://www.blogger.com/atom/ns#" term="小技巧"/><title type='text'>使用pytz為datetime物件加上時區的注意事項</title><content type='html'>使用Python的datetime產生的物件是不會包含時區資訊的，在網路上搜尋加上時區的方式，一般都是建議用pytz，大概類似以下的作法。&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
import datetime&lt;br /&gt;
import pytz&lt;br /&gt;
&lt;br /&gt;
mytz = pytz.timezone(&#39;Asia/Taipei&#39;)&lt;br /&gt;
mytime = datetime.datetime.now().replace(tzinfo=mytz)&lt;br /&gt;
&lt;br /&gt;
print(mytime)&lt;/blockquote&gt;
2019-08-19 14:56:50.450396+08:06&lt;br /&gt;
結果的確會顯示時區，不過好像哪裡怪怪的？台北所在的時區應該是+08:00，怎麼會變成+08:06，多加了六分鐘？&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://pytz.sourceforge.net/&quot;&gt;pytz的文件&lt;/a&gt;在開頭有提到，因為與Python內建的tzinfo API有實做上的差異，如果要顯示當地的時區，需使用localize()這個方法，範例如下。&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
import datetime&lt;br /&gt;
import pytz&lt;br /&gt;
&lt;br /&gt;
mytz = pytz.timezone(&#39;Asia/Taipei&#39;)&lt;br /&gt;
mytime = mytz.localize(datetime.datetime.now())&lt;br /&gt;
&lt;br /&gt;
print(mytime)&lt;/blockquote&gt;
&lt;br /&gt;
2019-08-19 14:56:50.450396+08:00&lt;br /&gt;
這樣就會顯示正確的時區。</content><link rel='replies' type='application/atom+xml' href='http://blog.pastwind.org/feeds/4284559467000014257/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.pastwind.org/2019/08/pytzdatetime.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/4284559467000014257'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/4284559467000014257'/><link rel='alternate' type='text/html' href='http://blog.pastwind.org/2019/08/pytzdatetime.html' title='使用pytz為datetime物件加上時區的注意事項'/><author><name>Ryan He</name><uri>http://www.blogger.com/profile/00678904484712055422</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3315632359857231858.post-3965292922160944419</id><published>2019-05-21T17:09:00.002+08:00</published><updated>2019-05-21T17:09:58.626+08:00</updated><title type='text'>在Linux使用Ricoh多功能事務機，無法輸入使用者代碼的問題</title><content type='html'>&lt;b&gt;使用環境&lt;/b&gt;&lt;br /&gt;
Kubuntu 18.04&lt;br /&gt;
Ricoh Aficio MP C3300&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;使用情境&lt;/b&gt;&lt;br /&gt;
印表機有設定使用者代碼來統計各部門的使用量，並限制彩色列印功能。&lt;br /&gt;
&lt;br /&gt;
在Windows的印表機設定很容易設定使用者代碼，在Linux上頭並不是…好吧，現在可以看到設定選項，但是會發現怎麼設定都沒有效果，永遠都會選擇預設的選項，而且沒辦法改變預設的代碼。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaVBpEtsuT_oZWZLdoE440KxBfRhze2WAYM_Ii0iw4rySBIkjRSpHmbQrYHE3FG5apBQBPJIi7S9aBV-d_Kvp1TVzuxkmog_AWf4_JCEZImynuCkCSAgzsoSZBTRHTovemuXfOVsBgsaU/s1600/Screenshot_20190521_165220.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;772&quot; data-original-width=&quot;889&quot; height=&quot;277&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaVBpEtsuT_oZWZLdoE440KxBfRhze2WAYM_Ii0iw4rySBIkjRSpHmbQrYHE3FG5apBQBPJIi7S9aBV-d_Kvp1TVzuxkmog_AWf4_JCEZImynuCkCSAgzsoSZBTRHTovemuXfOVsBgsaU/s320/Screenshot_20190521_165220.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
搜尋網路找到&lt;a href=&quot;https://my-random-solutions.blogspot.com/2013/08/how-to-set-default-user-code-using-linux.html&quot;&gt;這一篇&lt;/a&gt;，但是沒有效果。這篇文章裡頭有提到OpenPrinting網站的&lt;a href=&quot;https://wiki.linuxfoundation.org/openprinting/database/ricohfaq#What_are_UserCodes.3F_How_do_I_use_UserCodes_under_Linux.3F&quot;&gt;FAQ&lt;/a&gt;，可是裡頭的說明不是很清楚。 &lt;br /&gt;
&lt;br /&gt;
我最後解決的方式是從OpenPrinting網站下載PPD檔案修改，以&lt;a href=&quot;https://www.openprinting.org/printer/Ricoh/Ricoh-Aficio_MP_C3300&quot;&gt;C3300為例&lt;/a&gt;，網站上提供三種版本分別是PDF、Postscript、pxlcolor，PDF的版本按下列印就會被取消，我是用Postsciprt版本。&lt;br /&gt;
&lt;br /&gt;
要修改以下兩行&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
*DefaultUserCode: &lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;None&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;*UserCode &lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;1001/1001&lt;/b&gt;&lt;/span&gt;: &quot;/usrcode(&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;1001&lt;/b&gt;&lt;/span&gt;)def\n&quot;&lt;/blockquote&gt;
修改上面三個紅色的部份，填入正確的使用者代碼（這邊是用1011為例子）&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
*DefaultUserCode: 1011&lt;br /&gt;*UserCode 1011/1011: &quot;/usrcode(1011)def\n&quot;&lt;/blockquote&gt;
結果如下圖&amp;nbsp;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaQXyIGVrhDZJtTiCfwDAH7wzaCNFcCqw4QwSeKOZt0RZnfrIUS2IhiOLyxIr5hkdOLXefAH-GaQw4f70xVcghi_wWeBt8BlWCE9KkXjzqbaU2PVck2Gm8eZdWIGWalo0AADc1escpl9I/s1600/Screenshot_20190521_170136.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;611&quot; data-original-width=&quot;770&quot; height=&quot;253&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaQXyIGVrhDZJtTiCfwDAH7wzaCNFcCqw4QwSeKOZt0RZnfrIUS2IhiOLyxIr5hkdOLXefAH-GaQw4f70xVcghi_wWeBt8BlWCE9KkXjzqbaU2PVck2Gm8eZdWIGWalo0AADc1escpl9I/s320/Screenshot_20190521_170136.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
存檔，然後安裝印表機，要選擇用這個檔案安裝。安裝完成後進入設定選項應該會如同第一張圖，紙張大小與列印顏色也要改成正確的設定，不然還是無法列印。</content><link rel='replies' type='application/atom+xml' href='http://blog.pastwind.org/feeds/3965292922160944419/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.pastwind.org/2019/05/linuxricoh.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/3965292922160944419'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/3965292922160944419'/><link rel='alternate' type='text/html' href='http://blog.pastwind.org/2019/05/linuxricoh.html' title='在Linux使用Ricoh多功能事務機，無法輸入使用者代碼的問題'/><author><name>Ryan He</name><uri>http://www.blogger.com/profile/00678904484712055422</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaVBpEtsuT_oZWZLdoE440KxBfRhze2WAYM_Ii0iw4rySBIkjRSpHmbQrYHE3FG5apBQBPJIi7S9aBV-d_Kvp1TVzuxkmog_AWf4_JCEZImynuCkCSAgzsoSZBTRHTovemuXfOVsBgsaU/s72-c/Screenshot_20190521_165220.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3315632359857231858.post-2895410031111842556</id><published>2019-01-18T10:50:00.001+08:00</published><updated>2019-01-18T10:50:37.279+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><title type='text'>Linux桌面多使用者登入，類似LTSP的作法 rev.2</title><content type='html'>&lt;a href=&quot;https://blog.pastwind.org/2018/10/linuxltsp.html&quot;&gt;上一篇&lt;/a&gt;是古早時代的作法，lightdm早就內建支援VNC，中間不需要透過XDMCP，這樣穩定性也比較好，而且還是支援多使用者。&lt;br /&gt;
&lt;br /&gt;
作法：&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;安裝tigervnc-standalone-server&lt;/li&gt;
&lt;li&gt;編輯/etc/lightdm/lightdm.conf，加上&lt;br /&gt;[VNCServer]&lt;br /&gt;enabled=true&lt;br /&gt;command=Xvnc -SecurityTypes None&lt;br /&gt;port=5900&lt;br /&gt;listen-address=0.0.0.0&lt;br /&gt;width=1024&lt;br /&gt;height=768&lt;br /&gt;depth=24&lt;br /&gt;SecurityTypes設定None代表不使用VNC的內建驗證方式與加密，但是在lightdm還是要輸入帳號密碼登入。&lt;a href=&quot;https://www.suse.com/zh-tw/documentation/sled-12/book_sle_admin/data/vnc_encrypted.html&quot;&gt;參數的詳細說明&lt;/a&gt;。&lt;/li&gt;
&lt;li&gt;（可選）把SecurityTypes改成TLSNone使用連線加密，或者使用SSH或VPN提昇安全性&lt;/li&gt;
&lt;li&gt;重新啟動lightdm&lt;/li&gt;
&lt;li&gt;使用vncviewer連入 &lt;/li&gt;
&lt;/ol&gt;
</content><link rel='replies' type='application/atom+xml' href='http://blog.pastwind.org/feeds/2895410031111842556/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.pastwind.org/2019/01/linuxltsp-rev2.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/2895410031111842556'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/2895410031111842556'/><link rel='alternate' type='text/html' href='http://blog.pastwind.org/2019/01/linuxltsp-rev2.html' title='Linux桌面多使用者登入，類似LTSP的作法 rev.2'/><author><name>Ryan He</name><uri>http://www.blogger.com/profile/00678904484712055422</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3315632359857231858.post-1390119471688383915</id><published>2018-12-04T10:23:00.001+08:00</published><updated>2018-12-04T10:23:14.897+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="vpn"/><title type='text'>試用WireGuard</title><content type='html'>我只用過IPSEC與OpenVPN，其他的沒用過，所以不確定其他VPN軟體的架構與設計理念如何，不過&lt;a href=&quot;https://www.wireguard.com/&quot;&gt;WireGuard&lt;/a&gt;與前兩者相比的確有明顯的差異。&lt;br /&gt;
&lt;br /&gt;
在Linux上頭的WireGuard是核心模組加上用戶端工具軟體，核心模組包含網路卡界面與整個VPN功能實做，用戶端工具是設置VPN與檢視狀態用。IPSEC或OpenVPN在運作時都需要在背景運行必要程式，WireGuard不需要。不過&lt;a href=&quot;https://www.wireguard.com/xplatform/&quot;&gt;在非Linux平台&lt;/a&gt;，還是需要執行背景程式。&lt;br /&gt;
&lt;br /&gt;
使用者管理也和其他VPN實做不同，是使用非對稱金鑰，伺服器與用戶端都需要產生非對稱金鑰並交換公鑰，如果要解除某個用戶的權限，只需要從設定檔把對應的設定刪除。其他實做使用&lt;a href=&quot;https://zh.wikipedia.org/zh-tw/%E8%AF%81%E4%B9%A6%E9%A2%81%E5%8F%91%E6%9C%BA%E6%9E%84&quot;&gt;CA&lt;/a&gt;產生使用者的公鑰，要解除用戶權限需要撤除（revoke）對應的金鑰，不直覺也不方便。&lt;br /&gt;
&lt;br /&gt;
性能部份因為沒有做測試所以不評論，不過WireGuard網站上的&lt;a href=&quot;https://www.wireguard.com/performance/&quot;&gt;測試結果&lt;/a&gt;都顯示更高的Throughput與更低的延遲。</content><link rel='replies' type='application/atom+xml' href='http://blog.pastwind.org/feeds/1390119471688383915/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.pastwind.org/2018/12/wireguard.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/1390119471688383915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/1390119471688383915'/><link rel='alternate' type='text/html' href='http://blog.pastwind.org/2018/12/wireguard.html' title='試用WireGuard'/><author><name>Ryan He</name><uri>http://www.blogger.com/profile/00678904484712055422</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3315632359857231858.post-123670659236405436</id><published>2018-10-30T12:10:00.001+08:00</published><updated>2018-10-30T13:12:59.445+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="小技巧"/><title type='text'>Linux桌面多使用者登入，類似LTSP的作法</title><content type='html'>LTSP就是Linux版本的Terminal Server，可以讓多個使用者共用一台伺服器的資源去使用桌面環境，但是Client端OS必須也要是Linux是缺點。&lt;br /&gt;
&lt;br /&gt;
之後找的方案是在Ubuntu Mate 18.04中啟用LightDM的XDMCP功能，在Linux上使用Xephyr連線非常順暢，但是在Windows上試了好多種軟體（包含Xming），都會出現畫面顯示異常或卡住，程式啟動當掉的問題，只能放棄。&lt;br /&gt;
&lt;br /&gt;
再來則是XDMCP + VNC，網路上許多文章都會提到這個替代方案，我參考&lt;a href=&quot;https://417cybersec.org/content/multi-user-x-server-using-ssh-lightdm-xdmcp-and-vnc&quot;&gt;這一篇&lt;/a&gt;做設定，但是不透過SSH連線。設定完成，連上去看起來都沒什麼問題，直到我發現fctix的選字框無法顯示。 Orz&lt;br /&gt;
&lt;br /&gt;
根據Ubuntu社群WIKI關於&lt;a href=&quot;https://help.ubuntu.com/community/VNC/Servers#TigerVNC&quot;&gt;VNC Server&lt;/a&gt;的文章，其中提到只有TigerVNC支援compositing window managers像是Gnome Shell，原本我安裝的是vnc4server，換成tigervnc-standalone-server問題就解決了。而且換成TighterVNC Server還有個好處，Client也使用TigerVNC的話，就支援動態變更桌面尺寸，變更TigerVNC Viewer視窗的尺寸就會連帶變更Linux桌面的尺寸。</content><link rel='replies' type='application/atom+xml' href='http://blog.pastwind.org/feeds/123670659236405436/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.pastwind.org/2018/10/linuxltsp.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/123670659236405436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/123670659236405436'/><link rel='alternate' type='text/html' href='http://blog.pastwind.org/2018/10/linuxltsp.html' title='Linux桌面多使用者登入，類似LTSP的作法'/><author><name>Ryan He</name><uri>http://www.blogger.com/profile/00678904484712055422</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3315632359857231858.post-1255474999581072984</id><published>2018-10-03T10:29:00.000+08:00</published><updated>2018-10-03T10:29:11.267+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><title type='text'>Supermicro的IPMI Virtual CD-ROM功能</title><content type='html'>最近要把某些機器重裝OS，要使用IPMI提供的虛擬光碟機，沒想到沒辦法把映像檔掛載上去。&lt;br /&gt;
&lt;br /&gt;
把SAMBA Server的log debug功能開啟，出現 NTLMv1 passwords NOT PERMITTED for user 這個訊息。經查詢後發現，SAMBA較新的版本（4.5.10以後？）預設關閉NTMLv1驗證方式，這是因為這個驗證方式不安全。&lt;br /&gt;
&lt;br /&gt;
解決的方式很簡單，只要在SAMBA設定檔的 global 區塊加上 ntlm auth = yes 這個設定即可。不過之前有說到這個驗證方式不安全，如果要使用要多注意。</content><link rel='replies' type='application/atom+xml' href='http://blog.pastwind.org/feeds/1255474999581072984/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.pastwind.org/2018/10/supermicroipmi-virtual-cd-rom.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/1255474999581072984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/1255474999581072984'/><link rel='alternate' type='text/html' href='http://blog.pastwind.org/2018/10/supermicroipmi-virtual-cd-rom.html' title='Supermicro的IPMI Virtual CD-ROM功能'/><author><name>Ryan He</name><uri>http://www.blogger.com/profile/00678904484712055422</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3315632359857231858.post-3704058478708504976</id><published>2018-07-09T11:58:00.000+08:00</published><updated>2018-07-09T14:15:42.580+08:00</updated><title type='text'>SSL憑證購買</title><content type='html'>在&lt;a href=&quot;https://www.gandi.net/zh-hant&quot;&gt;管地&lt;/a&gt;購買進階型SSL憑證碰到一些問題，根據&lt;a href=&quot;http://wiki.gandi.net/zh-tw/ssl/documents/pro&quot;&gt;該網站wiki&lt;/a&gt;的資料：&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;需要公司登記證明與公司代表人的身份證明&lt;br /&gt;這個沒什麼問題，但是我碰到的情況是Gandi的每個帳號下面可以建立組織，組織名稱必須與公司登記證明的名稱相符，我當初填寫公司資料是用英文，客服來信要求提供與中文名稱相符的相關證明。&lt;/li&gt;
&lt;li&gt;要進行電話驗證&lt;br /&gt;在台灣的電話驗證是透過&lt;a href=&quot;https://www.dnb.com.tw/&quot;&gt;鄧白氏&lt;/a&gt;（Dun&amp;amp;Bradstreet）電話資料庫，&lt;strike&gt;但是我沒法確定我們公司的資料有登錄在他們的資料庫中&lt;/strike&gt;肯定沒有登錄，鄧白氏企業認證D&amp;amp;B D-U-N-S® Registered ™服務基本版費用16800，有效期一年，每年都需要重新認證。&lt;/li&gt;
&lt;/ol&gt;
因此我取消訂單，應該會跟&lt;a href=&quot;https://www.twca.com.tw/Portal/Portal.aspx&quot;&gt;TWCA&lt;/a&gt;詢價與採購吧。&lt;strike&gt;不過價錢真的差蠻多的，管地的兩年期進階版單一網域SSL憑證包含25萬美元擔保的價格是3490，台灣任何一家SSL CA的價格都超過10000。&lt;/strike&gt;把鄧白氏企業認證的費用加進去之後，台灣本地業者還比較便宜？</content><link rel='replies' type='application/atom+xml' href='http://blog.pastwind.org/feeds/3704058478708504976/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.pastwind.org/2018/07/ssl.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/3704058478708504976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/3704058478708504976'/><link rel='alternate' type='text/html' href='http://blog.pastwind.org/2018/07/ssl.html' title='SSL憑證購買'/><author><name>Ryan He</name><uri>http://www.blogger.com/profile/00678904484712055422</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3315632359857231858.post-3162436816914152142</id><published>2018-06-07T10:16:00.001+08:00</published><updated>2018-06-07T10:16:52.078+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="小技巧"/><category scheme="http://www.blogger.com/atom/ns#" term="網際網路"/><title type='text'>4G連線裝置的遠端管理</title><content type='html'>最近碰到一個情況是需要在特定地點放置網路設備，上面建置的服務需要連外，但又無法連接有線網路，看起來比較簡單而且立即可用的方案就是租用4G網路。&lt;br /&gt;
&lt;br /&gt;
上網的問題解決了，但是又冒出其他問題。因為IPv4的IP可用數量不足的關係，4G網路大多是採用&lt;a href=&quot;https://en.wikipedia.org/wiki/Carrier-grade_NAT&quot;&gt;Carrier-grade NAT&lt;/a&gt;的技術去解決IP不足的問題，但這也代表著無法在遠端主動連入這個4G連網裝置進行管理。&lt;br /&gt;
&lt;br /&gt;
為了解決遠端管理的問題，我最後想到使用SSH Tunnel，讓這些裝置主動開啟&lt;a href=&quot;https://www.howtoforge.com/reverse-ssh-tunneling&quot;&gt;逆向SSH Tunnel&lt;/a&gt;連線到我的主控端伺服器，那我就可以從主控端伺服器連入這些設備進行管理。 &lt;br /&gt;
&lt;br /&gt;
不過之後發現SSH Tunnel建立一段時間之後就會沒有回應，看起來應該是4G不穩定，連線已經中斷，但是主控端的ssh server沒有把連線關閉。因此我在&lt;a href=&quot;http://go2linux.garron.me/linux/2011/02/limit-idle-ssh-sessions-time-avoid-unattended-ones-clientaliveinterval-clientalivecoun/&quot;&gt;ssh server加上keep alive的設置&lt;/a&gt;，每30秒會發送封包給client進行檢查，如果連續三次都無回應就會關閉連線。設置此設定後連線都正常。</content><link rel='replies' type='application/atom+xml' href='http://blog.pastwind.org/feeds/3162436816914152142/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.pastwind.org/2018/06/4g.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/3162436816914152142'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/3162436816914152142'/><link rel='alternate' type='text/html' href='http://blog.pastwind.org/2018/06/4g.html' title='4G連線裝置的遠端管理'/><author><name>Ryan He</name><uri>http://www.blogger.com/profile/00678904484712055422</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3315632359857231858.post-6854803335422024885</id><published>2018-04-03T15:12:00.000+08:00</published><updated>2018-04-10T09:45:28.564+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="security"/><title type='text'>VSFTPD的安全性設定</title><content type='html'>&lt;br /&gt;
更新：為了符合PCI DSS的要求，通訊協定只能支援TLS 1.2以上版本，須把ssl_ciphers設定為TLSv1.2，&lt;a href=&quot;https://serverfault.com/a/833054/91299&quot;&gt;參考來源&lt;/a&gt;。 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
這年頭還會用FTP服務就是為了滿足B to B的需求吧…。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
chroot_local_user=YES&lt;br /&gt;
#把使用者關在自己的家目錄&lt;br /&gt;
rsa_cert_file=/etc/ssl/private/vsftpd.pem&lt;br /&gt;
rsa_private_key_file=/etc/ssl/private/vsftpd.pem&lt;br /&gt;
#ssl金鑰一般用自我產生的就好了，長度至少要在2048bit以上&lt;br /&gt;
ssl_enable=YES&lt;br /&gt;
#啟用FTP over TLS/SSL&lt;br /&gt;
ssl_ciphers=HIGH&lt;br /&gt;
#加密演算法使用HIGH，演算法是128位元以上的都會使用，這裡也可以自訂想要使用的加密演算法。&lt;br /&gt;
implicit_ssl=YES&lt;br /&gt;
#預設值是NO，使用FTPES，啟用此選項會改成FTPS&lt;br /&gt;
pasv_min_port=30000&lt;br /&gt;
pasv_max_port=31000&lt;br /&gt;
#明確指定pasv模式使用的port範圍，比較容易設定防火牆&lt;br /&gt;
&lt;br /&gt;
強制開啟FTP over TLS/SSL後，有時會很難做troubleshooting，建議可以先關掉，然後就會出現&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;明確的&lt;/b&gt;&lt;/span&gt;錯誤訊息。&lt;br /&gt;
&lt;br /&gt;
啟用chroot_local_user後用Filezilla去連，會出現ssl交握錯誤這種不明確的訊息，但是把ssl模式關閉後，就會出現500 OOPS: vsftpd: refusing to run with writable root inside chroot()這樣的訊息。&lt;br /&gt;
&lt;br /&gt;
關於500 OOPS: vsftpd: refusing to run with writable root inside chroot()這個錯誤，網路上大多數的解法都是在設定檔加上&lt;code&gt;allow_writeable_chroot=YES&lt;/code&gt;這個設定，但是這個作法有&lt;a href=&quot;https://serverfault.com/questions/743949/vsftp-why-is-allow-writeable-chroot-yes-a-bad-idea&quot;&gt;潛在安全性問題&lt;/a&gt;，所以後面的版本就把這個設定拿掉，在manpage裡頭也看不到此設定選項的說明。（經實測Debian 9的vsftpd有此選項，但是manpage裡頭一樣看不到）正確的作法是把使用者家目錄的寫入權限拿掉，在新增使用者後在使用者的家目錄中設置一個上傳專用的目錄。</content><link rel='replies' type='application/atom+xml' href='http://blog.pastwind.org/feeds/6854803335422024885/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.pastwind.org/2018/04/vsftpd.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/6854803335422024885'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/6854803335422024885'/><link rel='alternate' type='text/html' href='http://blog.pastwind.org/2018/04/vsftpd.html' title='VSFTPD的安全性設定'/><author><name>Ryan He</name><uri>http://www.blogger.com/profile/00678904484712055422</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3315632359857231858.post-8847853393945129713</id><published>2018-01-12T14:27:00.001+08:00</published><updated>2018-01-12T14:27:27.657+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="redis"/><title type='text'>使用Redis之後碰到的一些地雷雷雷...（Orz</title><content type='html'>最近開始嘗試使用Redis Sentinel建置高可用性服務，在測試的時候碰到一些問題。我在一個由三個Redis實體組成的Master-Slave Cluster倒入約4GB的資料，然後在Master下KEYS *把所有鍵列出來，沒過幾秒在Sentinel出現Master down然後重新推舉Master的訊息。&lt;br /&gt;
&lt;br /&gt;
我在Sentinel裡頭設定Master在5秒內無回應就會判定為down，那也就是說我做了列出所有鍵的操作阻擋了後續所有連線的作業，這是怎麼回事？&lt;br /&gt;
&lt;br /&gt;
回想一下Redis的特性，大概是：&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;單執行緒、單行程&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;所有操作是以atomic方式進行，因此確保了資料的一致性&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;雖然運作時資料是存放於記憶體中，但是可回存為檔案，確保資料的持久性&lt;/li&gt;
&lt;li&gt;因為資料是存放於記憶體，所以速度很快&lt;/li&gt;
&lt;/ul&gt;
Redis不像一般的RDBMS有實做Transaction Isolation，&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;任何操作都要等到前一個操作執行完才會進行，無法平行處理&lt;/b&gt;&lt;/span&gt;，Redis才能保證資料的一致性。因此非常不適合使用Redis進行以下操作：&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;列出所有鍵：KEYS *&lt;br /&gt;如果存入的鍵很多，就得花很多時間處理。以我測試的情況，4GB的資料有將近1500萬個鍵，列出操作就花了183秒。&lt;/li&gt;
&lt;li&gt;搜尋特定鍵：KEYS *name*&lt;br /&gt;跟前一個是同樣的情況，列出了154個卻花了9秒多來處理。&lt;/li&gt;
&lt;/ul&gt;
我本職是系統管理者不是程式開發人員，所以有可能有其他的情況不適合使用Redis。如果要更有效率的使用Redis，那就盡量不要使用KEYS指令來列出或搜尋鍵。</content><link rel='replies' type='application/atom+xml' href='http://blog.pastwind.org/feeds/8847853393945129713/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.pastwind.org/2018/01/redisorz.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/8847853393945129713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/8847853393945129713'/><link rel='alternate' type='text/html' href='http://blog.pastwind.org/2018/01/redisorz.html' title='使用Redis之後碰到的一些地雷雷雷...（Orz'/><author><name>Ryan He</name><uri>http://www.blogger.com/profile/00678904484712055422</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3315632359857231858.post-8499722529254133995</id><published>2017-12-13T18:04:00.002+08:00</published><updated>2017-12-13T18:04:56.914+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="redis"/><category scheme="http://www.blogger.com/atom/ns#" term="小技巧"/><title type='text'>GCE的TCP Health Check不支援換行符號</title><content type='html'>我打算在Google Compute Engine上建置Redis Slave個體群組，並使用GCP的負載平衡服務來連接，但是碰到一個問題，Health Check永遠都是失敗，導致個體群組裡頭的VM一直被重建。&lt;br /&gt;
&lt;br /&gt;
檢查了許多地方，確認Health Check的IP可以連進VM，從netstat -an也可以看到連線。使用nc -l -p 6379的確也能看到Health Check送進來的要求字串 PING\r\n，但是透過redis-cli下monitor指令卻沒看到。&lt;br /&gt;
&lt;br /&gt;
我在Health Check設置的要求字串是 PING\r\n，檢查字串是 +PONG，用nc的確是看到傳進來的是PING\r\n....等等，換行字元應該不會顯示？然後又用PYTHON參考別人寫的範例做了一個TCP SOCKET SERVER，結果顯示出來的是 PING\\r\\n...... Orz。redis一定要接收到換行符號才算接收到指令，否則就會停在那裡。看起來GCE的Health Check會過濾特殊符號。&lt;br /&gt;
&lt;br /&gt;
Google Groups上的GCE論壇也有人有相同的問題，Google的人回答都指向stackoverflow上的某個連結： &lt;br /&gt;
&lt;a href=&quot;https://stackoverflow.com/questions/43228878/health-check-to-detect-redis-master-from-google-tcp-load-balancer&quot;&gt;https://stackoverflow.com/questions/43228878/health-check-to-detect-redis-master-from-google-tcp-load-balancer &lt;/a&gt;&lt;br /&gt;
下面回答得很長，其實結論是在同一台VM裡頭去跑另一隻程式來處理Health Check請求與回傳結果，我最後是用PYTHON寫了一個TCP SOCKET SERVER，當Health Check傳入PING，就使用subprocess去跑redis-cli PING，然後把結果回傳。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.pastwind.org/feeds/8499722529254133995/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.pastwind.org/2017/12/gcetcp-health-check.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/8499722529254133995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/8499722529254133995'/><link rel='alternate' type='text/html' href='http://blog.pastwind.org/2017/12/gcetcp-health-check.html' title='GCE的TCP Health Check不支援換行符號'/><author><name>Ryan He</name><uri>http://www.blogger.com/profile/00678904484712055422</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3315632359857231858.post-1675285327442274820</id><published>2017-12-11T17:27:00.000+08:00</published><updated>2017-12-11T17:27:02.246+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="敗家"/><title type='text'>在mora.jp買音樂</title><content type='html'>最近在玩人中之龍 極2的酒店經營部份，在編輯酒店小姐的裝扮時，總是會播放歌曲『As You Like』，還蠻好聽的。這首歌曲有收錄在 &lt;a href=&quot;http://mora.jp/package/43000033/A39879/&quot;&gt;人中之龍 零 OST Side A &lt;/a&gt;裡，查了一下只能買CD或者數位檔案，像KKBOX跟Spotify都沒有提供。整張專輯（Side A）要1500日圓，可是我只對這首歌有興趣，搜尋一下發現mora.jp有在賣單一曲目，便想試看看購買，果然一按下結帳就出現不開放日本以外購買的警告。&lt;br /&gt;
&lt;br /&gt;
不過最後我還是購買成功了，我使用了以下的步驟：&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;把瀏覽器的語言改成日文優先（這個可能不需要）&lt;/li&gt;
&lt;li&gt;使用日本的IP進入mora.jp（VPN）&lt;/li&gt;
&lt;li&gt;付款方式使用Amazon Pay（需要有日本Amazon帳號）&lt;/li&gt;
&lt;/ol&gt;
我就是這樣購買並成功下載，其他的支付方式都需要日本當地的地址，不太可能成功。</content><link rel='replies' type='application/atom+xml' href='http://blog.pastwind.org/feeds/1675285327442274820/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.pastwind.org/2017/12/morajp.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/1675285327442274820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/1675285327442274820'/><link rel='alternate' type='text/html' href='http://blog.pastwind.org/2017/12/morajp.html' title='在mora.jp買音樂'/><author><name>Ryan He</name><uri>http://www.blogger.com/profile/00678904484712055422</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3315632359857231858.post-8530803637603683885</id><published>2017-11-11T15:04:00.000+08:00</published><updated>2017-11-11T15:05:12.789+08:00</updated><title type='text'>UAP接在MikroTik RB750Gr3後無法透過DHCP獲得IP的問題</title><content type='html'>最近借到一台RB750Gr3，想要取代我原本使用的ASUS RTN-56U。我的無線網路是使用UniFi UAP AC Lite。把RB750設置好之後，把UAP接上去卻發現手機平板都無法連接上，UniFi Controller也顯示adoption failed，而UAP的IP也跟DHCP設置的網段不同。&lt;br /&gt;
&lt;br /&gt;
花了些時間搜尋資訊，發現三月就有人碰到同樣的問題，解法是在RouterOS的橋接設定，把STP改成none。&lt;br /&gt;
&lt;a href=&quot;https://forum.mikrotik.com/viewtopic.php?t=116963&amp;amp;start=50&quot;&gt;https://forum.mikrotik.com/viewtopic.php?t=116963&amp;amp;start=50&lt;/a&gt; </content><link rel='replies' type='application/atom+xml' href='http://blog.pastwind.org/feeds/8530803637603683885/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.pastwind.org/2017/11/uapmikrotik-rb750gr3dhcpip.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/8530803637603683885'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/8530803637603683885'/><link rel='alternate' type='text/html' href='http://blog.pastwind.org/2017/11/uapmikrotik-rb750gr3dhcpip.html' title='UAP接在MikroTik RB750Gr3後無法透過DHCP獲得IP的問題'/><author><name>Ryan He</name><uri>http://www.blogger.com/profile/00678904484712055422</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3315632359857231858.post-3185891641108246295</id><published>2017-10-30T11:58:00.002+08:00</published><updated>2017-10-30T11:58:36.893+08:00</updated><title type='text'>說好的ZeroCat原始碼</title><content type='html'>&lt;a href=&quot;https://bitbucket.org/ryanho/zerocat&quot;&gt;https://bitbucket.org/ryanho/zerocat&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.pastwind.org/feeds/3185891641108246295/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.pastwind.org/2017/10/zerocat_30.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/3185891641108246295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3315632359857231858/posts/default/3185891641108246295'/><link rel='alternate' type='text/html' href='http://blog.pastwind.org/2017/10/zerocat_30.html' title='說好的ZeroCat原始碼'/><author><name>Ryan He</name><uri>http://www.blogger.com/profile/00678904484712055422</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>