Siril 1.5 + starnet2_linux_2.5.4-0214_ORT_x64_cli + Ubuntu 26.04 + GPU

Siril

onnxruntime-linux-x64-gpu-1.26.0に含まれる、libonnxruntime.so.1.26.0を用いると
Starnet2-2.5.4がGPU (RTX5060) を使えます。

CUDA Toolkit 12.8.2 (April 2026)runfile + Ubuntu 26.04 + nvidia-driver 580 + python version 3.12.13 + PyTorch は、あらかじめインストールし動作するようにして下さい。

例えば、
https://globe3.ddns.net/wp/cudatoolkit-12-8-2runfile-ubuntu-2604-nvidiadriver580-python3-12-13-cosmic-clarity-suite-siril-15/

Open Neural Network Exchange (ONNX)
推論・学習高速化を行う実行エンジン

StarNet.py

Siril へ StarNet.pyを導入する

[Set paths] で “starnet2” 及び “StarNet2_weights.onnx “を指定
[Run StarNet] → CPUが動作する。

Linear mode: applied MTF autostretch to the StarNet input.
Reading input from /tmp/siril_starnet_8mjx6poe/input.tif...
Color image is detected!
Image size: 3996x2721
Restoring neural network checkpoint...
Loading ONNX model from file: /usr/local/share/starnet2_linux_2.5.4-0214_ORT_x64_cli/StarNet2_weights.onnx
Backend: ONNX Runtime (CPU execution provider) # ← CPUが動いている

weights.onnx, libonnxruntime

こちらを参考にします。
Method 1: System-wide NVIDIA installer setup
https://starnetastro.com/documentation/windows-cuda/

libonnxruntime.so.1.26.0 を導入

ONNX Runtime v1.27.0 は、
CUDA 12 packages are deprecated, please move to CUDA 13 ASAP.
CUDA 12 パッケージは非推奨となりました。できるだけ早く CUDA 13 へ移行してください。

https://github.com/microsoft/onnxruntime/releases
onnxruntime-linux-x64-gpu-1.26.0.tgz をダウンロード

onnxruntime-linux-x64-gpu-1.26.0/lib を確認
libonnxruntime.so.1.26.0
libonnxruntime_providers_cuda.so
libonnxruntime_providers_shared.so
libonnxruntime_providers_tensorrt.so #CUDA環境では不要?

/usr/local/share/starnet2_linux_2.5.4-0214_ORT_x64_cli/lib にある、
libonnxruntime.so.1 を別名にします。

sudo mv libonnxruntime.so.1 libonnxruntime.so.1.backup

/usr/local/share/starnet2_linux_2.5.4-0214_ORT_x64_cli/lib/ にある、
libonnxruntime.so.1.26.0
libonnxruntime_providers_cuda.so
libonnxruntime_providers_shared.so
libonnxruntime_providers_tensorrt.so
これらを、
/usr/local/share/starnet2_linux_2.5.4-0214_ORT_x64_cli/lib へコピーします。

sudo cp libonnxruntime.so.1.26.0 /usr/local/share/starnet2_linux_2.5.4-0214_ORT_x64_cli/lib/

下記のリンクを作ります。
libonnxruntime.so@ -> libonnxruntime.so.1
libonnxruntime.so.1@ -> libonnxruntime.so.1.26.0

ln -s libonnxruntime.so.1.26.0 libonnxruntime.so.1
ln -s libonnxruntime.so.1 libonnxruntime.so

環境変数を追加

1: cuda runtime, cudnn, torch 各ライブラリがあるディレクトリにパスを通します。

2: NVIDIA TensorRT(ディープラーニングの推論(予測・実行)を高速化するためのソフトウェア開発キット)が使えない場合でもCPU使用を禁止させる。処理できないならば、エラー表示で停止させる。

3: 使用する計算エンジンを列挙し指定する。CUDA GPU、NVIDIA GPU、仕方がないからCPUの順番

export LD_LIBRARY_PATH=/home/$USER/.local/share/siril/venv/lib/python3.12/site-packages/nvidia/cuda_runtime/lib:/home/$USER/.local/share/siril/venv/lib/python3.12/site-packages/nvidia/cudnn/lib:/home/$USER/.local/share/siril/venv/lib/python3.12/site-packages/torch/lib:$LD_LIBRARY_PATH

export ORT_TENSORRT_UNAVAILABLE_FALLBACK=0

export ONNXRUNTIME_PROVIDER_PRIORITY="CUDAExecutionProvider,TensorrtExecutionProvider,CPUExecutionProvider"

動作log

Linear mode: applied MTF autostretch to the StarNet input.
Reading input from /tmp/siril_starnet_qcse_6ma/input.tif...
Color image is detected!
Image size: 3996x2721
Restoring neural network checkpoint...
Loading ONNX model from file: /usr/local/share/starnet2_linux_2.5.4-0214_ORT_x64_cli/StarNet2_weights.onnx
2026-08-11 19:21:51.880234368 [W:onnxruntime:, session_state.cc:1367 VerifyEachNodeIsAssignedToAnEp] Some nodes were not assigned to the preferred execution providers which may or may not have an negative impact on performance. e.g. ORT explicitly assigns shape related ops to CPU to improve perf.
2026-08-11 19:21:51.880253284 [W:onnxruntime:, session_state.cc:1369 VerifyEachNodeIsAssignedToAnEp] Rerunning with verbose output on a non-minimal build will show node assignments.
Backend: ONNX Runtime (CUDA execution provider) # ← CUDA GPUが動いている
Working: Done!
Writing starless image to: /tmp/siril_starnet_qcse_6ma/starless.tif
Writing mask to: /tmp/siril_starnet_qcse_6ma/mask.tif
Saved Starmask to starnetmask_image.fit
StarNet finished.
# log
Linear mode: applied MTF autostretch to the StarNet input.
Reading input from /tmp/siril_starnet_tyv_jll2/input.tif...
Color image is detected!
Image size: 3008x3008
Restoring neural network checkpoint...
Loading ONNX model from file: /usr/local/share/starnet2_linux_2.5.4-0214_ORT_x64_cli/StarNet2_weights.onnx
2026-08-06 14:39:54.576734905 [W:onnxruntime:, session_state.cc:1367 VerifyEachNodeIsAssignedToAnEp] Some nodes were not assigned to the preferred execution providers which may or may not have an negative impact on performance. e.g. ORT explicitly assigns shape related ops to CPU to improve perf.
2026-08-06 14:39:54.576760112 [W:onnxruntime:, session_state.cc:1369 VerifyEachNodeIsAssignedToAnEp] Rerunning with verbose output on a non-minimal build will show node assignments.
Backend: ONNX Runtime (CUDA execution provider) # ← GPUが動いている
Working: Done!
Writing starless image to: /tmp/siril_starnet_tyv_jll2/starless.tif
Writing mask to: /tmp/siril_starnet_tyv_jll2/mask.tif
Saved Starmask to starnetmask_image.fit
StarNet finished.

Windows11 と Starnet2

Windows での GPU アクセラレーションの設定手順
https://starnetastro.com/documentation/windows-cuda/

Use CUDA 12.x for the current ONNX Runtime 1.26.0 GPU path. Do not use CUDA 13.x runtime DLLs with the current CUDA-12 ONNX Runtime GPU DLLs.
現在の ONNX Runtime 1.26.0 の GPU パスでは、CUDA 12.x を使用してください。現在の CUDA-12 ONNX Runtime GPU DLL では、CUDA 13.x ランタイム DLL を使用しないでください。

こちらで (globe3.ddns.net) 確認された内容:

以下の設定は、この Windows 11, Siril 1.5 環境で確認しています:

オペレーティングシステム: Windows 11
GPU およびドライバー: NVIDIA GeForce RTX 5060、NVIDIA ドライバー 610.88 | WHQL
CUDA Toolkit: CUDA Toolkit 12.8.2 (April 2026). nvcc –version の出力は CUDA XX.x / VXX.x.x
cuDNN: CUDA 12.8 対応の cuDNN 9.24.0
ONNX Runtime GPU: Windows x64 対応の ONNX Runtime GPU 1.26.0

NVIDIAドライバー、CUDA Toolkit、およびcuDNNをインストールし、Windowsの$PATH変数を通じて、これらのランタイムライブラリをSirilから使えるようにします。
以下を参照します。

Method 1: System-wide NVIDIA installer setup
https://starnetastro.com/documentation/windows-cuda/

1. Install NVIDIA driver

2. Install CUDA Toolkit 12.8.2

where.exe nvcc

3. Install cuDNN 9.24.0

CUDA 13.x フォルダではなく、CUDA 12.9 cuDNN フォルダを使用してください。cuDNN インストーラによって、以下の CUDA 13.3 フォルダが作成される場合がありますが、この ONNX Runtime 1.26.0 CUDA-12 のセットアップでは使用しないでください:

4. Replace ONNX Runtime DLLs

ONNX Runtime GPU 1.26.0 for Windows x64 from GitHub.
onnxruntime-win-x64-gpu-1.26.0.zip をダウンロード、展開
https://github.com/microsoft/onnxruntime/releases/

onnxruntime.dll
ONNX Runtimeのメインエンジン。全ての計算命令を受け付けます。

onnxruntime_providers_cuda.dll
NVIDIAのCUDAを使って計算するための専用プラグインです。

onnxruntime_providers_shared.dll
メインエンジンと、CUDAプラグイン(および他のGPUプラグイン)との間で、データを仲介、共有するための共通ライブラリです。

StarNet2 CLI と、Python仮想環境下に3つのdllファイルをそれぞれ置きます。
 starnet++.exe がC++アプリとして直接GPUを使うため。
 StarNet.py スクリプトが、Pythonを用いてGPUを使うため。

C:\local\starnet2_win_2.5.3-0208_ORT
C:\Users\USERNAME\AppData\Local\siril\venv\Lib\site-packages\onnxruntime\backend

5. CUDA 12.8DLLを配置する

cublas64_12.dll 、 cudart64_12.dll (あれば cublasLt64_12.dll 、 cufft64_11.dll)を
C:\local\starnet2_win_2.5.3-0208_ORTディレクトリに置く。

### CUDA Toolkit 12.8 Update ディレクトリは以下
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\bin

ここからコピーします。

6. cudnn64_9.dll、cudnn_ops_infer64_9.dll、cudnn_cnn_infer64_9.dll を配置する

pythonコマンドを使って、それぞれのdllファイルをダウンロードします。
これはSiril 1.5仮想環境下ではなく、通常のPowerShell(またはターミナル)で行います。

python -m pip install --target "$env:TEMP\starnet-cuda-libs" "onnxruntime-gpu[cuda,cudnn]==1.26.0"

以下のファイルが starnet++.exe があるディレクトリに配置します。
ONNX 1.26 GPU版の3つ: onnxruntime.dll, onnxruntime_providers_shared.dll, onnxruntime_providers_cuda.dll

CUDA 12.8(システムからコピーしたもの): cublas64_12.dll, cudart64_12.dll

cuDNN 9(pythonを用いてダウンロード): cudnn64_9.dll(およびその他の cudnn_*.dll)

コメント