Linux Mint に LM Studio をインストール

ちょっと気になっている LM Studio をインストールしてみた。Win や Mac の場合はダウンロードしてそのまま動くっぽいが、Linux Mint ではだめだった。おそらく他の Ubuntu 系でも同様の現象が起きると思われる。

条件

LM_Studio-0.2.14-beta-1.AppImage

Linux Mint 21.3 (Virginia)

現象

おもむろにダウンロードして実行すると以下のエラーがでる。(AppImage はそのままだと動かないので chmod 755 するのを忘れずに。)

$ ./LM_Studio-.02.14-beta-1.AppImage 
18:32:45.958 › GPU info: '00:02.0 VGA compatible controller: Intel Corporation Skylake GT2 [HD Graphics 520] (rev 07)'
18:32:45.974 › Got GPU Type: intel
18:32:45.974 › LM Studio: gpu type = Intel
A JavaScript error occurred in the main process
Uncaught Exception:
Error: /usr/local/lib/libclblast.so.1: cannot open shared object file: No such file or directory
    at process.func [as dlopen] (node:electron/js2c/asar_bundle:2:1822)
    at Module._extensions..node (node:internal/modules/cjs/loader:1326:18)
    at Object.func [as .node] (node:electron/js2c/asar_bundle:2:1822)
    at Module.load (node:internal/modules/cjs/loader:1096:32)
    at Module._load (node:internal/modules/cjs/loader:937:12)
    at f._load (node:electron/js2c/asar_bundle:2:13330)
    at Module.require (node:internal/modules/cjs/loader:1120:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at 6829 (/tmp/.mount_LM_StuFaD1Or/resources/app/.webpack/main/index.js:2:2058)
    at r (/tmp/.mount_LM_StuFaD1Or/resources/app/.webpack/main/index.js:8:401969)
^Cfym@VJS111:/opt/dl$ ^C

ようは、libclblast がない (見つからない) らしい。.

なのでインストールする

$ sudo apt install -y libclblast1

でも最初と同じエラーがでるので検索してみると、どうも AppImage は /usr/local/lib にライブラリを探しにいくらしいのでリンクを張れっていうのがヒットする

$ sudo ln -s /usr/lib/x86_64-linux-gnu/libclblast.so.1.5.2 /usr/local/lib/libclblast.so 

$ sudo ln -s /usr/lib/x86_64-linux-gnu/libclblast.so.1 /usr/local/lib/libclblast.so.1 

これで無事に起動するようになる。

参考

LM Studio – Discover, download, and run local LLMs

On KUbuntu 23.10, LM_Studio searches for the libclblast libraries in the wrong path ! · Issue #24 · lmstudio-ai/.github · GitHub