[solved] Error setting up memories app video: Cannot load libcuda.so.1

Nextcloud version (eg, 20.0.5): 25.0.4
Operating system and version (eg, Ubuntu 20.04): Ubuntu 22.04
Apache or nginx version (eg, Apache 2.4.25): apache/2 4.52
PHP version (eg, 7.4): 8.1.2

The issue you are facing:
Running the occ memories:video-setup command shows only some HTTP error 408
looking at the logs, it seems that the app assumes it can use NVIDIA drivers and it tries to load libcuda, but it can’t…

Is this the first time you’ve seen this error? (Y/N):N

Steps to replicate it:

  1. run the occ command.
/var/www/nextcloud$ sudo -u www-data php occ memories:video-setup
ffmpeg is installed
ffprobe is installed
Checking for go-vod binary
Trying go-vod from /var/www/nextcloud/apps/memories/exiftool-bin/go-vod-amd64
go-vod is installed!

You can use transcoding and HLS streaming
This is recommended for better performance, but has implications if
you are using external storage or run Nextcloud on a slow system.

Read the following documentation carefully before continuing:
https://github.com/pulsejet/memories/wiki/Configuration

Do you want to enable transcoding and HLS? [Y/n]
Y

Starting ffmpeg feature detection
This may take a while. Please be patient

Downloading test video file ... OK

Attempting to start go-vod ... OK
go-vod logs will be stored at: /tmp/go-vod/oc5rohg5lh5m.log

Testing transcoding with CPU ... OK

Checking for VAAPI acceleration (/dev/dri/renderD128) ... OK
Checking for permissions on /dev/dri/renderD128 ... OK
Testing transcoding with VAAPI ... FAIL
VAAPI transcoding failed with error HTTP status: 408
Check the log file of go-vod for more details (/tmp/go-vod/oc5rohg5lh5m.log)
Testing transcoding with VAAPI (low_power) ... FAIL
VAAPI (low_power) transcoding failed with error HTTP status: 408
Check the log file of go-vod for more details (/tmp/go-vod/oc5rohg5lh5m.log)

Checking for NVIDIA acceleration with NVENC
Testing transcoding with NVENC (scale_npp) ... FAIL
Testing transcoding with NVENC (scale_cuda) ... FAIL
NVENC does not seem to be available

Feature detection completed

Transcoding and HLS are now enabled! Monitor the log file for any errors
You should restart the server for changes to take effect

and the go-vod log:

/var/www/nextcloud$ sudo tail /tmp/go-vod/oc5rohg5lh5m.log
2023/03/18 20:35:41 test: new manager for /tmp/sample.mp4bmWQGm
2023/03/18 20:35:41 test-360p: stopping stream
2023/03/18 20:35:41 test-360p: /usr/bin/ffmpeg -loglevel warning -hwaccel cuda -autorotate 0 -i /tmp/sample.mp4bmWQGm -copyts -vf format=nv12|cuda,hwupload,scale_cuda=force_original_aspect_ratio=decrease:passthrough=0:w=640:h=360 -maxrate 1000000 -bufsize 2000000 -c:v h264_nvenc -profile:v main -preset p6 -tune ll -rc vbr -rc-lookahead 30 -cq 24 -c:a aac -ac 1 -b:a 128k -avoid_negative_ts disabled -f hls -hls_time 3 -force_key_frames expr:gte(t,n_forced*3) -hls_segment_type mpegts -start_number 0 -hls_segment_filename /tmp/go-vod/oc5rohg5lh5m/test-1538193886/360p-%06d.ts -
2023/03/18 20:35:41 ffmpeg-error: Codec AVOption b (set bitrate (in bits/s)) specified for output file #0 (pipe:) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
2023/03/18 20:35:41 ffmpeg-error: [AVHWDeviceContext @ 0x56208cd53e40] Cannot load libcuda.so.1
2023/03/18 20:35:41 ffmpeg-error: [AVHWDeviceContext @ 0x56208cd53e40] Could not dynamically load CUDA
2023/03/18 20:35:41 ffmpeg-error: Device creation failed: -1313558101.
2023/03/18 20:35:41 ffmpeg-error: [h264 @ 0x56208cc81d00] No device available for decoder: device type cuda needed for codec h264.
2023/03/18 20:35:41 ffmpeg-error: Device setup failed for decoder on input stream #0:0 : Unknown error occurred
2023/03/18 20:35:41 test-360p: ffmpeg exited with status: 1

vainfo is fine:

libva info: VA-API version 1.14.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.14 (libva 2.12.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 22.3.1 ()
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointVLD

found the solution myself: you need the intel-media-va-driver-non-free package