Topaz Video AI Linux Alpha 3.1.0.0.L

Hello everyone,

We have been working on a Linux version of Video AI for use on some of our training machines. While this is mainly an internal tool at the moment, we’ve decided to release a build for any interested alpha/beta testers.

A few important notes before starting:

  • This is the first time we’ve tried packaging a Linux version of our software for external use, there may be dependency problems and other issues with the package during the first few releases
  • This version is not officially supported at this time. Support tickets for the Linux version will be bounced back to this thread, so try and keep questions here.
  • This build is CLI only
  • The Linux version will be updated much less frequenctly than the regular Mac & Windows releases, anyone wanting the latest Video AI features are advised to continue using those versions.
  • We have very few encoders enabled in the distributed FFmpeg build (even fewer than Win/Mac). Headers and libraries needed for a custom build with your preferred encoders are included.
  • TensorRT models are currently unavailable, as they require reconversion on our end. Some models will have TensorRT become available as we need it internally.

System Requirements

  • Ubuntu 22.04 or newer
    • If you want to try and run this on another distro, you need GLIBC 2.35 at minimum
  • libvulkan1 (maybe)
  • Proprietary NVIDIA drivers
  • For ONNX models, a Vulkan-compatible NVIDIA GPU meeting Video AI’s minimum requirements
  • For CPU models, a CPU supporting AVX2 instructions

Usage

  • Models will install to /opt/TopazVideoAIAlpha/models, link this somewhere else if you want it on another drive
  • Use videoai-login [user] [password] to login
  • Use videoai-run to interact with Video AI. This is a wrapper around FFmpeg, so just provide arguments as you would with the existing command line.

Download

8 Likes

Just stumbled across this - this sounds interesting :slight_smile:

You mention:

" For TensorRT or ONNX models, a Vulkan-compatible NVIDIA GPU…"

Does this mean you are involving vulkan now? ONNX and Vulkan should run on AMD GPUs as well, yet your post sounds like “nvidia only”…

1 Like

Nothing on this page is final yet, as this hasn’t been made viewable or had anything published; you’re just able to see this since you’re a moderator.

At the moment, however, we’re only planning to support the CUDA executor for ONNX in this release.

Thanx for getting back so quickly…

I see, so its Nvidia only for the moment.

Vullan was available up from Kepler Generation, which was around CUDA 3.0, DX 12 (FL 11_0) and Shader Model 5.1 - I suppose thminimum Cuda Support will be a little higher?

I believe the minimum would be any card supported by driver version 450 or higher, though you’ll definitely want newer drivers if you’re planning to use any of the hardware encoders.

1 Like

450 sounds like Kepler…
Yes, the Encoders on older Cards are not that good any way…

I am not actually planing to use these old cards, not enough horsepower, but I always like to test stuff and throw al kinds of old hardware at software. So it´s more of a curiosity thing :slight_smile:

Can you throw a bone to someone whose license expired? I can’t rationalise buying v3 until its actually better quality than v2 and ideally as easy to use.

Also where is the list of command line options?

1 Like

I’m getting a lot of

/opt/TopazVideoAIAlpha/bin/login: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /opt/TopazVideoAIAlpha/bin/login)
/opt/TopazVideoAIAlpha/bin/login: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /opt/TopazVideoAIAlpha/bin/login)

I tried to upgrade libstdc++ but it’s conflicting with a lot of other libraries.
Is there a way to resolve this issue?

Are there build instructions somewhere? When running configure on Fedora 37 I get ERROR: veai not found. The log says /usr/bin/ld: cannot find -lveai: No such file or directory. I roughly followed the instructions for mac in INSTALL-Topaz.md.

I also tried to build from source, but it showed veai not found, the log in config.log is /usr/bin/ld: warning: libvideoai.so.0, needed by /content/topaz-ffmpeg-redistributables-linux-5.1.2.0/lib/libveai.so, not found (try using -rpath or -rpath-link).

Upgrading libstdc++ tends to be quite painful. If you have access to a system running Ubuntu 22.04.1 or Debian testing, those should both have a new enough version already installed.

I’m not sure if compiling a custom build would solve this issue, since some of the redistributables may also expect GLIBC 2.34 or 2.35. That said, I believe both your and @kjell’s compilation woes should be solveable by adding -Wl,-rpath,/path/to/redistributables/lib to the --extra-ldflags part of the configure command.

Is it possible to pack a linux distribution with all needed dependencies like macOS?

This worked but now the log says /usr/bin/ld: warning: libnvinfer.so.8, needed by /lib/libaiengine.so.2, not found (try using -rpath or -rpath-link)

Edit: I extracted the 3 relevant files from the .deb and now it is working

OMG 1000x yes… I have been in Windows more often than Linux lately purely because of the Topaz products… a Linux client will let me resume my Linux daily life…

Will try this out and report back.

THANK YOU Topaz Labs team! :wave: :+1:

1 Like

After testing this for a bit here is my Feedback.

First of all everything seems to work fine, although it is quite slow. So I havent done much testing.

Please add instructions for Linux to install-topaz.md, I think this would be very useful. And libnvinfer.so libnvinfer.so.8 libnvinfer.so.8.5.1 are missing from the redistributables, but I couldnt build ffmpeg without them. It would also be very helpful if you could link to a command line documentation for videoai.

I really like that we are able to build ffmpeg ourselves to enable additional codecs. Nonetheless I would love to see more packages for the most common distros in the future. Or even better an appimage or a flatpak.

Obviously I hope that the Linux version will eventually reach feature parity with the mac and windows version with new updates at the same time.
Although having a GUI is not really important for me, it can sometimes be useful for rendering a quick preview.

And I just want to say that I really appreciate that you have listened to your users and are making a Linux version, not many companies do this. Thank you very much

1 Like

So a kind of “idiots guide” based on my last couple of hours fumbling around…

I installed the topaz .deb in an up-to-date Ubuntu 22.04 installation.

After much head scratching I figured out I had to install CUDA (link here) and also NVIDIA cuDNN (link here, note NVIDIA developer login required). I then had to >> reboot <<.

I also set up in my ~/.bashrc the following (not sure if 2nd line is necessary?):

export VEAI_MODEL_DIR=/opt/TopazVideoAIAlpha/models
export PATH=$PATH:/opt/TopazVideoAIAlpha/lib/

I then tried to use the copied ffmpeg command from my windows installation but this did not work…

ffmpeg "-hide_banner" "-nostdin" "-y" "-nostats" "-i" "inputfile.mp4" "-vsync" "0" "-avoid_negative_ts" "1" "-sws_flags" "spline+accurate_rnd+full_chroma_int" "-color_trc" "2" "-colorspace" "2" "-color_primaries" "2" "-filter_complex" "veai_fi=model=chf-3:slowmo=1:fps=59.94:device=0:vram=1:instances=1,veai_up=model=prob-3:scale=0:w=2560:h=1440:preblur=0.2:noise=0.1:details=0.15:halo=0.1:blur=0.2:compression=0.7:device=0:vram=1:instances=1,scale=w=2560:h=1440:flags=lanczos:threads=0" "-c:v" "h264_nvenc" "-profile:v" "high" "-preset" "medium" "-pix_fmt" "yuv420p" "-b:v" "60M" "-map_metadata" "0" "-movflags" "frag_keyframe+empty_moov+delay_moov+use_metadata_tags+write_colr " "-map_metadata:s:v" "0:s:v" "-map_metadata:s:a" "0:s:a" "-c:a" "copy" "-metadata" "videoai=Slowmo 100% and framerate changed to 59.94 using chf-3. Enhanced using prob-3 with recover details at 15, dehalo at 10, reduce noise at 10, sharpen at 20, revert compression at 70, and anti-alias/deblur at 20. Changed resolution to 2560x1440" "outputfile.mkv"

I was getting errors related to -vsync… so I then used -fps_mode with “passthrough” instead of “0”. This still kept giving me errors…

I then tried the example file from the command line documentation here - and that WORKED (but was a bit slow).

videoai-run -v verbose -hide_banner -nostdin -y -strict 2 -hwaccel auto -i "input.mp4" -c:v hevc_nvenc -profile main -preset medium -global_quality 19 -pix_fmt yuv420p -movflags frag_keyframe+empty_moov -vf "veai_up=model=amq-13:scale=2" "output-artemis.mp4"

So I went back to my script and it seemed the errors I was getting were from the metadata… so I tried stripping everything back but for some reason I can’t make it work with both the frame interpolation AND upscaling.

If I run separate scripts it seems OK…

videoai-run -v verbose -hide_banner -nostdin -y -strict 2 -hwaccel auto -i "input.mp4" -c:v "h264_nvenc" "-profile:v" "high" "-preset" "medium" "-pix_fmt" "yuv420p" "-b:v" "60M" -movflags frag_keyframe+empty_moov -vf "veai_fi=model=chf-3:slowmo=1:fps=59.94:device=0:vram=1:instances=1" "./output.mp4"

and

videoai-run -v verbose -hide_banner -nostdin -y -strict 2 -hwaccel auto -i "input.mp4" -c:v "h264_nvenc" "-profile:v" "high" "-preset" "medium" "-pix_fmt" "yuv420p" "-b:v" "60M" -movflags frag_keyframe+empty_moov -vf "veai_up=model=prob-3:scale=0:w=2560:h=1440:preblur=0.2:noise=0.1:details=0.15:halo=0.1:blur=0.2:compression=0.7:device=0:vram=1:instances=1,scale=w=2560:h=1440:flags=lanczos:threads=0" "./output.mp4"

If anyone is much better at ffmpeg scripting than me and could help me to get the combined interpolation and upscaling working - that would be pro… :heart_eyes:

Otherwise - still THANK YOU to the Topaz Team and I hope to see a bit more love for the Linux side at some point…

2 Likes

Here’s my experience so far on Debian testing:

  1. Installing the Topaz Video AI using sudo apt install TopazVideoAIAlpha_3.1.0.0.L-4_amd64.deb didn’t work. This is because zstandard was used to compress the files within the .deb. And my apt or dpkg or something doesn’t support it. Anyway, I ended up manually installing it.

  2. Following that I had an issue. I couldn’t use Video AI with files that contained spaces in their path. For example /mnt/HDD/test-video.mp4 is fine. But /mnt/HDD/test video.mp4 is not fine because there are spaces in the directory. The command I used was videoai-run -n -i "/mnt/HDD/test video.mp4" ...All my video parameters... "/mnt/HDD/output video.mp4"

  3. I also experiencing the same issue as @menthurae. I couldn’t run two AI’s together. For example, running Apollo and Proteus didn’t work. But running just Apollo or just Proteus did work.

  4. Using the libvpx-vp9 encoder just resulted in errors (see below) while hardware encodering (h264_nvenc and hevc_nvenc) worked just fine.

[Parsed_veai_fi_0 @ 0x55b65b565a80] Failed to configure output pad on Parsed_veai_fi_0
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
  1. When running Apollo on my GPU I get visual errors (black blocks in the image). They’re not there when I run Apollo on the CPU.
videoai-run -i "input.mp4" -filter_complex "veai_fi=model=apo-4:slowmo=1:fps=60:device=0:vram=0.9:instances=0" -c:v hevc_nvenc -pix_fmt yuv420p -b:v 200M -c:a copy "output.mp4"

  1. Lastly, performance was very slow. EDIT: This was caused by the fact the processing was occurring on my CPU. Installing NVIDIA cuDNN fixed it.

Potentially useful information. My GPU is an RTX 3060 with Nvidia propriety driver 520.56.06

2 Likes

YES! And this is probably the preferred method as its distro agnostic. It called Flatpak.

I also get the error:

dpkg-deb: error: archive '/home/xioren/Downloads/TopazVideoAIAlpha_3.1.0.0.L-4_amd64.deb' uses unknown compression for member 'control.tar.zst', giving up

I honestly don’t know but aren’t they usualy tar.gz?

Ubuntu’s defaulted to zstd for a little while now. Debian is supposed to be bringing support for zstandard packages “soon,” but we’ll be switching our debs to use xz next time we have an update for this version.