我写了用cuda编译ffmpeg的角色。 如果我在终端上编译是可以的,如果我运行角色,则会出错。 我的角色是ffmpeg-cuda。 错误在哪里?
错误:
失败:[pc-fisso](项目=。/ configure --disable-decoder = amrnb --disable-decoder = libopenjpeg --disable-libopencv --disable-outdev = sdl2 --disable-podpages --disable -sndio --disable-stripping --enable-libaom --enable-avfilter --enable-avresample --enable-gcrypt --disable-nutnuts --enable-openssl --enable-gpl --enable-libass --enable -libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme- -enable-libgsm --enable-libilbc --enable-libkvazaar --enable-libmp3lame --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband- -enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libx265- -enable-libzimg --enable-libxvid --enable-libzvbi --enable-nonfree --enable-opencl --enable-opengl --enable- postproc --enable-pthreads --enable-shared --enable-version3 --enable-libwebp --enable-libx264 --enable-libdc1394 --enable-vaapi --enable-libmfx --enable-libvmaf --disable- altivec --enable-nvenc --enable-cuda --enable-cuvid --enable-cuda-nvcc --enable-libnpp --extra-cflags = -I / usr / local / cuda / include --extra-ldflags = -L / usr / local / cuda / lib64)=> { “ ansible_loop_var”:“项目”, “已更改”:是, “ cmd”:[ “。/配置”, “ --disable-decoder = amrnb”, “ --disable-decoder = libopenjpeg”, “ --disable-libopencv”, “ --disable-outdev = sdl2”, “ --disable-podpages”, “ --disable-sndio”, “ --disable-stripping”, “ --enable-libaom”, “ --enable-avfilter”, “ --enable-avresample”, “ --enable-gcrypt”, “ --disable-nutnuts”, “ --enable-openssl”, “ --enable-gpl”, “ --enable-libass”, “ --enable-libbluray”, “ --enable-libbs2b”, “ --enable-libcaca”, “ --enable-libcdio”, “ --enable-libcodec2”, “ --enable-libfdk-aac”, “ --enable-libfontconfig”, “ --enable-libfreetype”, “ --enable-libfribidi”, “ --enable-libgme”, “ --enable-libgsm”, “ --enable-libilbc”, “ --enable-libkvazaar”, “ --enable-libmp3lame”, “ --enable-libopenh264”, “ --enable-libopenjpeg”, “ --enable-libopenmpt”, “ --enable-libopus”, “ --enable-libpulse”, “ --enable-librubberband”, “ --enable-libshine”, “ --enable-libsnappy”, “ --enable-libsoxr”, “ --enable-libspeex”, “ --enable-libtesseract”, “ --enable-libtheora”, “ --enable-libvidstab”, “ --enable-libvorbis”, “ --enable-libvpx”, “ --enable-libx265”, “ --enable-libzimg”, “ --enable-libxvid”, “ --enable-libzvbi”, “-启用非自由”, “ --enable-opencl”, “ --enable-opengl”, “ --enable-postproc”, “ --enable-pthreads”, “-启用共享”, “ --enable-version3”, “ --enable-libwebp”, “ --enable-libx264”, “ --enable-libdc1394”, “ --enable-vaapi”, “ --enable-libmfx”, “ --enable-libvmaf”, “ --disable-altivec”, “ --enable-nvenc”, “ --enable-cuda”, “ --enable-cuvid”, “ --enable-cuda-nvcc”, “ --enable-libnpp”, “ --extra-cflags = -I / usr / local / cuda / include”, “ --extra-ldflags = -L / usr / local / cuda / lib64” ], “ delta”:“ 0:00:04.148852”, “ end”:“ 2019-12-03 22:33:09.658905”, “调用”:{ “ module_args”:{ “ _raw_params”:“。/configure--disable-decoder = amrnb --disable-decoder = libopenjpeg --disable-libopencv --disable-outdev = sdl2 --disable-podpages --disable-sndio --disable-stripping- -enable-libaom --enable-avfilter --enable-avresample --enable-gcrypt --disable-gnutls --enable-openssl --enable-gpl --enable-libass --enable-libbluray --enable-libbs2b- -enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable- libilbc --enable-libkvazaar --enable-libmp3lame --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable- libsnappy --enable-libsoxr --enable-libspeex --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libx265 --enable-libzimg --enable- libxvid --enable-libzvbi --enable-nonfree --enable-opencl --enable-opengl --enable-postproc --e nable-pthreads --enable-shared --enable-version3 --enable-libwebp --enable-libx264 --enable-libdc1394 --enable-vaapi --enable-libmfx --enable-libvmaf --disable-altivec- enable-nvenc --enable-cuda --enable-cuvid --enable-cuda-nvcc --enable-libnpp --extra-cflags = -I / usr / local / cuda / include --extra-ldflags = -L / usr / local / cuda / lib64“, “ _uses_shell”:否, “ argv”:null, “ chdir”:“ / opt / ffmpeg”, “创建”:null, “可执行”:null, “删除”:null, “ stdin”:null, “ stdin_add_newline”:是的, “ strip_empty_ends”:是的, “警告”:为true } }, “项目”:“ ./configure --disable-decoder = amrnb --disable-decoder = libopenjpeg --disable-libopencv --disable-outdev = sdl2 --disable-podpages --disable-sndio --disable-stripping- -enable-libaom --enable-avfilter --enable-avresample --enable-gcrypt --disable-gnutls --enable-openssl --enable-gpl --enable-libass --enable-libbluray --enable-libbs2b- -enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable- libilbc --enable-libkvazaar --enable-libmp3lame --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable- libsnappy --enable-libsoxr --enable-libspeex --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libx265 --enable-libzimg --enable- libxvid --enable-libzvbi --enable-nonfree --enable-opencl --enable-opengl --enable-postproc --enable-p线程--enable-shared --enable-version3 --enable-libwebp --enable-libx264 --enable-libdc1394 --enable-vaapi --enable-libmfx --enable-libvmaf --disable-altivec --enable- nvenc --enable-cuda --enable-cuvid --enable-cuda-nvcc --enable-libnpp --extra-cflags = -I / usr / local / cuda / include --extra-ldflags = -L / usr / local / cuda / lib64“, “ msg”:“非零返回码”, “ rc”:1, “ start”:“ 2019-12-03 22:33:05.510053”, “ stderr”:“”, “ stderr_lines”:[], “ stdout”:“错误:nvcc的检查失败。\ n \ n如果您认为configure出错,请确保您使用的是来自Git的最新版本。如果最新版本失败,请将该问题报告给\ nffmpeg用户@ ffmpeg.org邮件列表或irc.freenode.net上的IRC #ffmpeg。\ n包括configure生成的日志文件“ ffbuild / config.log \”,因为这将有助于\ n解决问题。”, “ stdout_lines”:[ “错误:检查nvcc失败。”, “”, “如果您认为配置出错,请确保您使用的是最新版本”, “从Git版本开始。如果最新版本失败,请向该问题报告问题”, “ ffffeg-user@ffmpeg.org邮件列表或irc.freenode.net上的IRC #ffmpeg。”, “包括由configure生成的日志文件\“ ffbuild / config.log \”,因为这会有所帮助“, “解决这个问题。” ] } 米歇尔
答案 0 :(得分:0)
听起来您的交互式外壳与ansible连接具有不同的$PATH
;在交互式外壳中运行which nvcc
会告诉您该任务需要添加到$PATH
的目录。
也就是说,基于在编译任务上方看到the /etc/profile.d/cuda.sh
,看来您可能想将任务更改为shell:
并首先获取该文件:
- name: compile ffmpeg
shell: |
set -e
. /etc/profile.d/cuda.sh
./configure {{ ffmpeg_compile_options }}
make -j$(nproc)
make install
make distclean
args:
chdir: "{{ source_dir }}/ffmpeg"
无论如何,您都需要将其从command:
更改为shell:
,因为该-j$(nproc)
是 shell插值,因此,如果您使用过{ {1}}会尝试使用文字参数command:
make