For the complete documentation index, see llms.txt. This page is also available as Markdown.

Node.js Module

Install the VIESUS Node.js native module on Ubuntu 22.04 with Node.js 18 and NVIDIA GPU support.

Linux Only

The VIESUS Node.js module is available on Linux only.

See System Requirements for hardware, OS, Node.js, and NVIDIA driver requirements.


1

Install VIESUS

sudo dpkg -i viesus-redist_<VERSION>_amd64.deb \
             viesus_<VERSION>_amd64.deb \
             viesus-license_<VERSION>_amd64.deb

sudo apt-get install -f

Verify NVIDIA driver:

nvidia-smi

The CUDA version shown must be 12.6 or higher.

2

Install Node.js 18

curl -sL https://deb.nodesource.com/setup_18.x | sudo bash -
sudo apt -y install nodejs

Verify:

node --version   # v18.x.x
npm --version
3

Set up your project

mkdir myproject && cd myproject
npm init -y

Install the VIESUS native module from the local package:

sudo npm install /usr/local/viesus/node-viesus

Install the worker thread pool helper:

npm install node-worker-threads-pool --save
4

Copy example files

cp -a node_modules/viesus/test/* .

This copies testbatch.js, worker.js, and a default viesusini.json into your project directory.

Edit testbatch.js and insert your GUID:

const guid = "YOUR-GUID-HERE";
5

Set thread pool size

Set UV_THREADPOOL_SIZE before running. A good starting value is the number of CPU cores:

export UV_THREADPOOL_SIZE=16
6

Run a test

mkdir in out
# Copy some test images to ./in/

node testbatch.js

Output lines > 0 indicate successful processing (value is processing time in ms). Negative values are error codes — see API Reference.

Last updated

Was this helpful?