星期日, 12月 10, 2023

在 Linux 上使用 RX6600 跑 whisper

出於個人需求,需要使用 whipser 將影片中的對話轉成文字

whisper 是由 OpenAI 出品的語音辨識 Model,運行在 PyTorch 這個機器學習框架上。>

在這裡我使用 venv 來進行安裝

$ python3 -mvenv whisper
$ soruce whisper bin/activate

然後到 PyTorch 官網查看安裝 PyTorch With ROCM 的安裝方法,ROCM 是由 AMD 開發與 NVIDIA CUDA 對標的開發平台。

在這裡我們運行

(whisper) $ pip3 install torch torchvision torchaudio \
	--index-url https://download.pytorch.org/whl/rocm5.6

安裝完畢後嘗試執行,結果 Segmentation Fault 了

(whisper) $ whisper --language zh input.mkv
segmentation fault (coredumpd)

可能跟 RX6600 在 ROCM 只支援 Windows 有關,經過一番搜尋後,發現使用 HSA_OVERRIDE_GFX_VERSION=10.3.0 可以順利運行

(whisper) $ HSA_OVERRIDE_GFX_VERSION=10.3.0 whisper --language zh input.mkv

根據 https://llvm.org/docs/AMDGPUUsage.html, gfx1030 是指 RX6800XT 以上的顯卡

而 RX6600 的 code name 為 gfx1032

$ ocminfo | grep gfx
  Name:                    gfx1032                            
      Name:                    amdgcn-amd-amdhsa--gfx1032

先這樣使用一段時間看有沒有問題,跑起來比純用 CPU 實在快太多了

另外發現 CPU 1 Core 吃滿的,但 GPU 耗電上限 100W 只吃 66W,可能是遇到 CPU 瓶頸了...,老舊的 2700x 該升級了嗎

沒有留言: