Apple M1 上跑 Linux 的 GPU driver 會動了

Hacker News Daily 上看到「Native Linux GPU Driver for Apple M1 (twitter.com/linaasahi)」這個,講 Apple M1 上有 Linux GPU driver 可以用了,原文是 Twitter 上的推:

不過從 YouTube 的影片上可以看到就只是「會動」,還有不少 rendering bug,可以看到有時候會破格,但畢竟是開始支援了,後續如果有修到穩定的話,直接的好處應該就是把瀏覽器的 rendering 丟給 GPU 處理,就像 macOS 或是 Windows 上的情況。

NVIDIA 開源 Linux GPU Kernel Driver

NVIDIA 宣佈開源 Linux 下的 GPU Kernel Driver:「NVIDIA Releases Open-Source GPU Kernel Modules」。

從一些描述上可以看出來,應該是因為 Datacenter 端的動力推動的,所以這次 open source 的版本中,對 Datacenter GPU 的支援是 production level,但對 GeForce GPU 與 Workstation GPU 的支援直接掛 alpha level:

Which GPUs are supported by Open GPU Kernel Modules?

Open kernel modules support all Ampere and Turing GPUs. Datacenter GPUs are supported for production, and support for GeForce and Workstation GPUs is alpha quality. Please refer to the Datacenter, NVIDIA RTX, and GeForce product tables for more details (Turing and above have compute capability of 7.5 or greater).

然後 user-mode driver 還是 closed source:

Will the source for user-mode drivers such as CUDA be published?

These changes are for the kernel modules; while the user-mode components are untouched. So the user-mode will remain closed source and published with pre-built binaries in the driver and the CUDA toolkit.

nouveau 來說,是可以從 open source driver 裡面挖一些東西出來用,不過能挖到跟 proprietary 同樣效能水準嗎?

SHA-1 在 2022 的破解速度已經降到 ~5.4 GPU years

前幾天在 Hacker News 上看到目前撞 SHA-1 collision 的難度:「How easy is it in 2022 to find a SHA1 collision? (stackexchange.com)」,原文在「How easy is it in 2022 to find a SHA1 collision?」。

在答案裡面有提到,即使在不考慮 ASIC 的情況下,光是用 GPU 算就可以可以降到 ~5.4 GPU years 了:

Remarkably, we can see that in only 5 years, we're down from an attack costing ~110 GPU years to an attack costing ~8 GPU-years in 2020 (thanks to theoretical improvements & newer GPUs) to just ~5.4 GPU years nowadays (thanks to newer, faster GPUs).

除了演算法本身的進步以外,GPU 的效能進展也帶動不少,而如果考慮到 ASIC 的話會快更多,對美國政府來說,如果搬出超級電腦來算的話,就是一天可以撞一個出來:

In a more realistic way, it would take less than a day to do it on a super-computer such as the one owned by the US Department of Energy's Oak Ridge National Laboratory (ORNL) named "Summit".

沒有在追進度,發現進展蠻快的,現在的攻擊速度比想像中快不少...

更多瀏覽器內 GPU fingerprint 的技巧

在「Your device's GPU may be used for fingerprinting purposes」這邊看到有研究單位找出更多 GPU fingerprint 的技巧,論文在「DRAWNAPART: A Device Identification Technique based on Remote GPU Fingerprinting」這邊可以翻到,另外一些 source code 可以在 GitHub 上的「Drawn Apart」這邊可以翻到。

看起來是透過 WebGL 去建立模型:

The researchers ran experiments on 2500 unique devices using the technique. They developed two methods, both of which use the Web Graphics Library (WebGL), which is supported by all modern web browsers.

接下來瀏覽器端應該會在研究後有更多反制機制被放進來...

用 vttest 測試 terminal 程式實做的相容性

看到「Wez's Terminal」,又一個用 GPU 加速的 terminal 專案,跑去翻一下 Hacker News 上的討論,意外的翻到有趣的東西:「Wezterm – A GPU-accelerated cross-platform terminal emulator and multiplexer (github.com/wez)」。

目前最前面的討論是這個:

I just saw this and after a quick checkout of the latest release (which is what I can quickly install), I feel a bit disappointed. Here is yet another GPU-accelerated terminal that claims to be a VT500 (judging by its Device Attributes report), sets TERM to xterm-256color, while having holes in basic VT100 support (just ran VTTEST in it and saw glaring issues, need not look further than basic VT100 tests, TAB setting/resetting, cursor save/restore).

比較有趣的是裡面提到了 vttest 這套測試軟體可以測 terminal 的標準相容性,在 vttest 的官網上有提到可以測 VT100VT220VT520

Vttest tests the compatibility (demonstrates the non-compatibility) of so-called “VT100-compatible” terminals. In conformance of the good old hacker traditions, the only documentation of this program is the source code itself. To understand it, you also need a copy of the original VT100 manual from DEC.

Additional tests (past version 1.7) are provided for analysis of vt220 through vt520 terminals, as well as variants of xterm.

另外比較驚訝的是,terminal 下可以作到這樣的效果 (這邊看官方的截圖應該是 VT420?):

回到原來講標準相容性的問題,對於泡在 terminal 下的人來說超級重要,有工具可以測試幫助不少... vttest 這套程式在 Ubuntu 內可以直接裝來用:「Ubuntu – Package Search Results -- vttest」。

挖 Ethereum 加熱房間...

大家都好像有過類似的想法,只是實際去做的不多 XDDD

有人把整個作法寫出來,挖 Ethereum 加熱房間:「How I heat my home by mining crypto currencies」。

從網站上的「About me」這邊看起來應該是住在奧地利?

I am a tech geek from Austin TX (USA), living on the country side in Austria and devote most of my time to my girlfriend, my company, my students and different projects.

不確定是哪個城市,先抓了首都維也納的溫度來看,看起來一到三月的平均氣溫都在個位數 (攝氏),可以理解暖氣應該是常備物品:

作者之前就先搞過一個可以一路接到 Grafana 的電錶,然後也有裝太陽能電板,但因為暖氣用電的關係而不夠用:

After building my own smart meter using 4$ in parts I started checking my electricity usage every day, which made me realize how expensive it is to heat your home. Especially since all heat and warm water in my low-energy house is made with electricity. I do have 4.8 kwp solar panels on my roof but in winter they don't cover too much for obvious reasons.

順便查了一下電價,在「Austria electricity prices」這頁可以看到奧地利的每一度要 USD$0.248:

而同一份資料上,台灣是 USD$0.101:

回到他的暖氣機,他是屬於中央空調大台機器的類型:

這種機器會恆溫輸出,所以是進風溫度愈低,就需要使用愈高的電能加熱。所以他想到的解法就是針對進風口預先用顯卡挖礦加熱 (四張 AMD 的 R9 390),這樣就可以降低暖氣機的電力消耗 (不過整體的消耗會提昇):

I had 4 older AMD R9 390 GPUs laying around (for the nVidia crowd that's basically on a level with a GTX 970) and I thought it could work.

後面就是改裝過程了,最後的結果雖然整體的電力使用量上升,但因為暖氣機的電力消耗降低,加上礦機挖到的 ETH 直接 cover 暖氣機的費用,反而讓暖氣機變免費了:

Success! I was able to lower my heat pump's electricity needs by ~50% and half of the costs are also paid for by the mining earnings

台灣的氣溫應該是用不太到 XDDD

Amazon EC2 的新機種:R5b、D3 (D3en)、C6gn、M5zn、G4ad

Amazon EC2 除了昨天放出 Mac mini 消息打頭陣以外,其他機種的更新消息也陸陸續續公佈了:

比較有趣的 (對我而言),第一個是 ARM 架構的機器也推出 100Gbps 的 n 版本 c6gn,看起來很適合跑大流量的東西,馬上想到的就是自架的 memcached

另外是 m5zn,使用高頻率的 Intel Xeon,主打需要單核效率的程式,不過這是掛在 m 系列下,而不是 c 系列...

再來是使用 AMD GPU 的 g4ad,官方宣稱跟 NVIDIAg4dn 比起來,將會有 45% 的 C/P 值提昇,是個蘇媽跟老黃的對決:

However, when compared to G4dn the new G4ad instances enable up to 45% better price performance for graphics-intensive workloads, including the aforementioned game streaming, remote graphics workstations, and rendering scenarios. Compared to an equally-sized G4dn instance, G4ad instances offer up to 40% improvement in performance.

看起來 ARM 的消息沒有想像中的多...

四個 HDMI 的顯示卡

Facebook 上正妹 wens 問是不是用華碩的 GT710-4H-SL-2GD5 這張顯示卡:「The Most Innovative ~$50 Graphics Card For Linux Users」,看了一下是一張蠻有趣的顯示卡,而且價位還蠻有競爭力的,拉一篇出來記錄好了...

我自己是用四螢幕,先前一直都是用 1080 Ti 在接 (2 HDMI + 2 DP),但覺得好像太吃電,後來在網路上弄了一張有四個 miniDP 輸出的 Quadro P600 顯示卡,另外又找了四條 miniDP 轉 DP 的線。

換上去後發現有時候不是那麼順,後來發現是因為常常開一堆 Twitch 反而吃了不少 GPU 資源 (在 Linux 下可以用 nvidia-smi 觀察),而且有時候還是希望跑個 KataGo 分析圍棋棋局,所以還是需要 GPU 計算能力,就換回用 1080 Ti 了...

不過這張 GT710 是四個 HDMI,用一般的 HDMI 線就可以了,相較於 P600 提供的 miniDP 需要 miniDP 轉 DP 的線,取得上應該容易不少:

另外他只需要 PCI Express 2.0 (x1) 而且是被動散熱,手上的 P600 得用到 PCI Express 3.0 (x16) 而且上面還是有一顆風扇,我猜 GT710 這張應該是更省電?不過官網上沒寫 GT710 這張的功耗,不過在「GeForce 700 series」這邊是寫 19W,而 P600 的最大功耗是 40W。

目前有看到的缺點應該是多顆 4K 解析度下時的更新頻率只有 30Hz:

* Detailed digital max. resolution:
3840×2160@60Hz for 1 monitor
3840×2160@30Hz for more than 2 monitors

對於想要有多螢幕輸出的人可以考慮看看,目前查到的價位上在新台幣 2000 上下,比 Quadro 便宜不少,畢竟定位還是不太一樣...

GPU.js

前幾天在 Hacker News Daily 上看到的專案:「GPU.js - GPU accelerated JavaScript」,對應的 GitHub 頁面在 gpujs/gpu.js 這邊。

看起來是用 WebGL 接進去的,不過他用來 benchmark 的硬體頗暴力啊:

Hardware: Xeon Gold 5217 + 8 x RTX 2080ti

這邊用了八張 2080Ti,如果一張就大約是 1/8 效能的話,看起來好像還好... 一張 2080Ti 跟 Xeon Gold 5217 跑出來差不多?價錢也在同一個範圍區間...

暫時不知道用途...

Amazon EC2 可以掛多個 Elastic Inference 了

看到 Jeff Barr 的 tweet:

所以是一台 Amazon EC2 的主機可以掛多個 Elastic Inference (GPU) 了,這主要應該還是對現有的使用者有幫助。還沒有使用的應該會往新的 AWS Inferentia 測試?(參考「AWS 開始推自己的 Machine Learning Chip」)