On Thu, 22 Oct 2020 22:08:37 +0100 Simon McVittie <s...@debian.org> wrote: > Control: reassign 967941 libopenblas0-pthread 0.3.10+ds-2 > Control: affects 967941 + nautilus totem > > On Thu, 22 Oct 2020 at 21:31:41 +0200, Thorsten Ehlers wrote: > > So I dug a little bit deeper into this bug > > Please include some context in replies to bugs: package maintainers will > usually see your messages out of context. > > For the libopenblas0-pthread maintainers: the original bug report is that > h.264 video files were not thumbnailed successfully by GNOME's Nautilus > file manager. The actual thumbnailing is delegated to > totem-video-thumbnailer, from the totem package. > > I can reproduce this with the sample videos from the original bug report > after installing libopenblas0-pthread. After removing libopenblas0- pthread, > the alternative switches to /usr/lib/x86_64-linux- gnu/atlas/libblas.so.3 > and the thumbnailer works again. > > Steps to reproduce: > > $ sudo apt install totem libopenblas0-pthread youtube-dl > $ youtube-dl https://www.youtube.com/watch?v=LTvFsTbyILg > $ youtube-dl https://www.youtube.com/watch?v=l7GX_XII2K0 > $ totem-video-thumbnailer -v Yosemite\ Nature\ Drone\ Video- LTvFsTbyILg.webm tmp.png > (succeeds) > $ totem-video-thumbnailer -v Beautiful\ Nature\ 1080p.- l7GX_XII2K0.mkv tmp.png > > Output: > > TotemVideoThumbnailer-Message: 22:02:21.412: Initialised libraries, about to create video widget > TotemVideoThumbnailer-Message: 22:02:21.436: setting URI file:///home/smcv/tmp/Beautiful%20Nature%201080p.-l7GX_XII2K0.mkv > TotemVideoThumbnailer-Message: 22:02:21.437: Video widget created > TotemVideoThumbnailer-Message: 22:02:21.437: About to open video file > TotemVideoThumbnailer-Message: 22:02:21.713: Checking whether file has cover > TotemVideoThumbnailer-Message: 22:02:21.713: Opened video file: 'Beautiful Nature 1080p.-l7GX_XII2K0.mkv' > TotemVideoThumbnailer-Message: 22:02:21.713: About to seek to 0.333333 > TotemVideoThumbnailer-Message: 22:02:21.757: About to get frame for iter 0 > > (totem-video-thumbnailer:98347): GStreamer-WARNING **: 22:02:21.758: failed to create thread: Error creating thread: Resource temporarily unavailable > > (totem-video-thumbnailer:98347): GLib-ERROR **: 22:02:21.763: ../../../glib/gmem.c:112: failed to allocate 3145167 bytes > [1] 98347 trace trap (core dumped) totem-video-thumbnailer -v Beautiful\ Nature\ 1080p.-l7GX_XII2K0.mkv tmp.png > > > and in my case it turned out > > the real problem is libopenblas0-pthread version 0.3.10+ds-2 and - 3. > > > > This package is a dependency of libopenblas0 which is a dependency of Octave and others. > > > > Creating a thumbnail with totem-video-thumbnailer fails for flv and mkv videos like that one mentioned by the OP: > > > > (totem-video-thumbnailer:37500): GStreamer-WARNING **: 21:23:41.129: failed to create thread: Error creating thread: Die Ressource ist zur Zeit nicht verfügbar > > > > (totem-video-thumbnailer:37500): GLib-ERROR **: 21:23:41.131: ../../../glib/gmem.c:112: failed to allocate 3145167 bytes > > Trace/Breakpoint ausgelöst > > > > Installing libopenblas0-pthread_0.3.10+ds-1 or adding the -l option in /usr/share/thumbnailers/totem.thumbnailer works > > around this bug. > > The -l option is documented to disable the time limit for thumbnail
the OpenBLAS FAQ tells: https://github.com/OpenMathLib/OpenBLAS/wiki/faq#multi-threaded " If your application is already multi-threaded, it will conflict with OpenBLAS multi-threading. Thus, you must set OpenBLAS to use single thread as following. - export OPENBLAS_NUM_THREADS=1 in the environment variables. Or - Call openblas_set_num_threads(1) in the application on runtime. Or " Would adding openblas_set_num_threads(1) to totem-resource.c be fine? Wouldn't it add a hard dependency to openblas on totem? Should the ffmpeg or gstreamer provide an API to set this openblas number or thread to 1 in case the application is multi-threaded (I believe totem is multi-threaded) to avoid adding such hard dependency in the upper layers if they don't already provides such an API? totem might requiring tweaking the openblas settings as: - not working: LC_ALL=C totem-video-thumbnailer Rogue\ One:\ A\ Star\ Wars\ Story\ Trailer\ #2\ \(Official\)\ \[sC9abcLLQpI\].mp4 a.png (totem-video-thumbnailer:1576790): GLib-ERROR **: 05:17:03.908: ../../../glib/gmem.c:106: failed to allocate 3110543 bytes Trappe pour point d'arrêt et de trace (core dumped) - working: OPENBLAS_NUM_THREADS=1 totem-video-thumbnailer Rogue\ One:\ A\ Star\ Wars\ Story\ Trailer\ #2\ \(Official\)\ \[sC9abcLLQpI\].mp4 a.png and: OPENBLAS_NUM_THREADS= from 1 to 3 is fine, starting at 4 totem errors out with: OPENBLAS_NUM_THREADS=4 totem-video-thumbnailer Rogue\ One:\ A\ Star\ Wars\ Story\ Trailer\ #2\ \(Official\)\ \[sC9abcLLQpI\].mp4 a.png (totem-video-thumbnailer:1576943): GLib-ERROR **: 05:17:26.026: ../../../glib/gmem.c:106: failed to allocate 3404718 bytes Trappe pour point d'arrêt et de trace (core dumped) nproc 8 Intel® Core™ i7-7700 × 8 until a solutoin that does not involve hardcoding low level optional dependencies into totem is sorted out (probably more of an upsteam issue), one can add "OPENBLAS_NUM_THREADS=1" to the environment of the totem thumbnailer. About memory: 32,0 GiBi RAM LC_ALL=C free -wm total used free shared buffers cache available Mem: 31878 27711 420 2144 0 6365 4167 Swap: 40649 18184 22465 As a side note, it seems to me the issue with openblas0-pthread and totem-video-thumbnailer exhibits only for small video files. Could it be the file size + 512MB is too small for totem-video- thumbnailer openblas0-pthread to allocate enough memory. The container seems to matter. That is a really small 17 MB webm vp9 from https://www.youtube.com/watch?v=sC9abcLLQpI succeed to generate a thumbnail while the same url extracted mp4 vp9 of 17MB does not. With the "-l" flag the thumbnail generation for these files is blazing fast (less than 2 seconds) while without it fails but after struggling for more than 15 seconds, on the same file. Could it be the totem limits are too low for old codecs, and extreme even for small mildly recent ones for small files? Though this looks more like an upstream totem issue. yt-dlp -f "mp4+ba" https://www.youtube.com/watch?v=LTvFsTbyILg LC_ALL=C totem-video-thumbnailer Yosemite\ Nature\ Drone\ Video\ \[LTvFsTbyILg\].mp4 l.png OpenBLAS blas_thread_init: pthread_create failed for thread 6 of 8: Resource temporarily unavailable OpenBLAS blas_thread_init: RLIMIT_NPROC 126896 current, 126896 max still fails. yt-dlp https://www.youtube.com/watch?v=LTvFsTbyILg gives a webm nowadays that works: totem-video-thumbnailer Yosemite\ Nature\ Drone\ Video\ \[LTvFsTbyILg\].webm l.png yt-dlp https://www.youtube.com/watch?v=l7GX_XII2K0 give an mp4 h264 high which still fails LC_ALL=C totem-video-thumbnailer Beautiful\ Nature\ 1080p.\ \[l7GX_XII2K0\].mp4 a.png Processus arrêté (ie "Process stopped") Cheers Alban