styler00dollar / VSGAN-tensorrt-docker

Using VapourSynth with super resolution and interpolation models and speeding them up with TensorRT.
BSD 3-Clause "New" or "Revised" License
281 stars 30 forks source link

Some more smal fixes Dockerfile + question regarding ffmpeg hotfix #79

Open abcnorio opened 1 month ago

abcnorio commented 1 month ago

Hij,

some more small fixes while creating the docker:

  1. Missing "/" in COPY command (gives out an error)
COPY --from=base /workspace/Python-3.12.5/libpython3.12.so* /workspace/Python-3.12.5/libpython3.so \
  /workspace/Python-3.12.5/libpython3.so /usr/lib/

requires / at the end (target) ie. /usr/lib/and not/usr/lib

  1. Source does not exist in COPY command

COPY --from=base /usr/local/lib/x86_64-linux-gnu/vapoursynth /usr/local/lib/x86_64-linux-gnu/vapoursynth

error -> source does not exist (???) - unclear to me. How does one gets access to a special stage image like here the base? I know how to do it with docker run --rm- it ID when there is an ID, but re-running the Dockerfile gives out IDs only for later stages. With docker images it lists a lot of images but unclear which one to choose? The

FROM ubuntu:24.04 AS base

call does not label the stage image? From the created images there is no image with tag base. So one cannot just run it with docker run --rm -it base. ??? So could not really validate the error later and building takes a whole day on my HW.

  1. Missing "/" in COPY command (gives out an error)

COPY --from=base /workspace/hotfix/* /workspace/

same as (1) -> added "/" so that it is /workspace/

  1. COPY error from tensorrt-ubuntu

Step 298/314 : COPY --from=tensorrt-ubuntu /usr/local/tensorrt/lib/libnvinfer_plugin.so /usr/local/tensorrt/lib/libnvinfer_vc_plugin.so /usr/local/tensorrt/lib/libnvonnxparser.so* /usr/lib/x86_64-linux-gnu/ COPY failed: no source files were specified

Could not understand that (typo somewhere??) and merged the call slightly with the next one to

COPY --from=tensorrt-ubuntu /usr/local/cudnn/lib/libcudnn.so /usr/local/tensorrt/lib/libnvinfer.so /usr/local/tensorrt/lib/libnvinfer_builder_resource.so /usr/local/tensorrt/lib/#libnvonnxparser.so \ /usr/local/tensorrt/lib/libnvonnxparser.so /usr/local/tensorrt/lib/libnvparsers.so.8 /usr/local/tensorrt/lib/libnvinfer_plugin.so.8 /usr/local/tensorrt/lib/libnv* /usr/lib/x86_64-linux-gnu/


which worked.

5. Does the ffmpeg hotfix "destroy" the "final" apt/deb system?

ffmpeg hotfix

COPY --from=base /workspace/hotfix/ /workspace/ RUN dpkg --force-all -i .deb && rm -rf *deb


Just wanted to add `vsmpeg` and `dgmpegdec` (via `wine`) at the end for the final image, but it resulted in a broken `libc6` - going back in the `Dockerfile` and after the "final" cuda image was introduced, only this hotfix was a real `dpkg` call that could lead to that. Any method to prevent this? Using `LD_LIBRARY_PATH` and copy all libs required by `ffmpeg` into one folder? Do some

dpkg-deb -R $PACKAGENAME $TARGETDIR cp $TARGETDIR/... /$PATH-TO-FFMPEG-LIBS


etc.

and before at runtime check what ffmpeg depends on and collect that from the unpacked debs. Would that work or have you abstained from that due to the additional disk space required?

btw - with my addons it built fine, no chance to test it yet, but no errors.

Thx and best!
styler00dollar commented 1 month ago

requires / at the end (target) ie. /usr/lib/ and not /usr/lib Missing "/" in COPY command

Works fine for me but I guess I could add it. I don't know why you have such errors.

error -> source does not exist

FROM ubuntu:24.04 AS base
...
COPY --from=base ...

base is used within that docker, you don't see it when you run docker images to list images.

Does the ffmpeg hotfix "destroy" the "final" apt/deb system

Yes, but since only ffmpeg and vapoursynth are used, it isn't important to fix in my opinion. If you want something else to work, set it up prior to installing the deb files.

copy all libs required runtime check what ffmpeg depends

I don't want to waste space, I copy a file on each import error to make sure I don't copy unnecessary files. That's why I have so many COPY commands in the final stage.

abcnorio commented 1 month ago

Thanks - yes diskspace is a good point, already added changes before the hotfix is applied. No problem with that. Just wanted to be sure.

Regarding the error with COPY I think it depends on the docker version somehow, it complains that if more than one single file is copied the last must look that way. No further explanation.