Difference between revisions of "Porting/chaiNNer"

From RCS Wiki
Jump to navigation Jump to search
(→‎Installation on Debian Bookworm: Fix space issue in Bash script)
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
= Installation on Debian Bookworm =
 
= Installation on Debian Bookworm =
  
* [[Porting/PyTorch#Debian|Install PyTorch]]
+
* Install at least one of [[Porting/PyTorch#Debian|PyTorch]], [[Porting/ONNX|ONNX]], or [[Porting/ncnn|ncnn]]
 
* [[Porting/Chromium/Electron#Installation_on_Debian_via_Bedrock|Install Electron]]
 
* [[Porting/Chromium/Electron#Installation_on_Debian_via_Bedrock|Install Electron]]
 
* Pin Debian's <code>python3</code> so that Electron will use Debian's PyTorch package (See [https://bedrocklinux.org/0.7/workflows.html#pinning Bedrock pinning instructions])
 
* Pin Debian's <code>python3</code> so that Electron will use Debian's PyTorch package (See [https://bedrocklinux.org/0.7/workflows.html#pinning Bedrock pinning instructions])
Line 19: Line 19:
 
  ln -s -T /bedrock/cross/bin/ffprobe ~/.config/chaiNNer/ffmpeg/ffprobe
 
  ln -s -T /bedrock/cross/bin/ffprobe ~/.config/chaiNNer/ffmpeg/ffprobe
 
  ln -s -T /bedrock/cross/bin/ffmpeg ~/.config/chaiNNer/ffmpeg/ffmpeg
 
  ln -s -T /bedrock/cross/bin/ffmpeg ~/.config/chaiNNer/ffmpeg/ffmpeg
  sudo apt install python3-requests libre2-dev
+
  sudo apt install python3-requests python3-wcmatch libre2-dev
 
  pip install --user --break-system-packages sanic Sanic-Cors ffmpeg-python google-re2
 
  pip install --user --break-system-packages sanic Sanic-Cors ffmpeg-python google-re2
 
* chaiNNer is installed!
 
* chaiNNer is installed!
Line 29: Line 29:
 
* [https://github.com/chaiNNer-org/chaiNNer/pull/1839 Fix backend script path detection with external Electron]
 
* [https://github.com/chaiNNer-org/chaiNNer/pull/1839 Fix backend script path detection with external Electron]
 
* [https://github.com/chaiNNer-org/chaiNNer/pull/1849 Add --devtools argument]
 
* [https://github.com/chaiNNer-org/chaiNNer/pull/1849 Add --devtools argument]
 +
* [https://github.com/chaiNNer-org/chaiNNer/pull/1867 Support NCNN CPU inference]
 +
* [https://github.com/chaiNNer-org/chaiNNer/pull/2142 Use load_param_mem with ncnn CPU inference]
 +
 +
= Merged, Awaiting Stable Tag =
 +
 +
(None at the moment.)
  
= In progress =
+
= In Progress =
  
* [https://github.com/chaiNNer-org/chaiNNer/pull/1867 Support NCNN CPU inference]
+
* [https://github.com/chaiNNer-org/chaiNNer/pull/2070 Make ncnn memory budget configurable]
  
 
= See Also =
 
= See Also =
Line 38: Line 44:
 
* [[Porting/Chromium/Electron|Electron]]
 
* [[Porting/Chromium/Electron|Electron]]
 
* [[Porting/ncnn|ncnn]]
 
* [[Porting/ncnn|ncnn]]
 +
* [[Porting/ONNX|ONNX]]
 
* [[Porting/PyTorch|PyTorch]]
 
* [[Porting/PyTorch|PyTorch]]
  
 
[[Category:Ports]]
 
[[Category:Ports]]

Latest revision as of 09:12, 22 September 2023

Installation on Debian Bookworm

  • Install at least one of PyTorch, ONNX, or ncnn
  • Install Electron
  • Pin Debian's python3 so that Electron will use Debian's PyTorch package (See Bedrock pinning instructions)
  • sudo brl apply
  • Download and extract a portable zip Linux x86_64 binary of chaiNNer.
  • Rename chainner executable in chaiNNer directory to chainner.bak (this is an Electron executable; we will replace it with the ppc64le Electron that we installed).
  • Rename portable file in chaiNNer directory to portable.bak (skip this step if you want chaiNNer configuration to be stored in chaiNNer's directory instead of $HOME)
  • In chaiNNer's directory, create the following shell script named chainner:
#!/usr/bin/env bash

cd "$(dirname "$0")"
electron ./resources/app "$@" --no-sandbox
  • Give the chainner script executable permissions, and (if you like) add the chaiNNer directory to your PATH.
  • Run chaiNNer once, and quickly exit.
  • Run the following commands to take care of some remaining dependencies:
echo true > ~/.config/chaiNNer/settings/use-system-python
ln -s -T /bedrock/cross/bin/ffprobe ~/.config/chaiNNer/ffmpeg/ffprobe
ln -s -T /bedrock/cross/bin/ffmpeg ~/.config/chaiNNer/ffmpeg/ffmpeg
sudo apt install python3-requests python3-wcmatch libre2-dev
pip install --user --break-system-packages sanic Sanic-Cors ffmpeg-python google-re2
  • chaiNNer is installed!

Finished

Merged, Awaiting Stable Tag

(None at the moment.)

In Progress

See Also