Closed fitu996 closed 6 years ago
version 1.1.0 works fine.
Hi fitu99, thanks for your report. I fixed the problem with the commit #b81a87ed
Where is commit #b81a87ed?
I build it from latest master branch, the problem still exist.
Hi fitu996, could you post the build log with the latest commit? Thank you.
CXXFLAGS/LDFLAGS checking...
checking for vapoursynth headers...
checking for OpenCL...
settings...
CXX = g++
LD = g++
STRIP = strip
CXXFLAGS = -O2 -std=gnu++11 -Wall -Wno-unused-local-typedefs -I. -I./shared -I./include -march=native -mtune=native -O2 -pipe -fstack-protector-strong -fno-plt -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/vapoursynth
LDFLAGS = -shared -fPIC -Wl,-O2,--sort-common,--as-needed,-z,relro,-z,now
LIBS = -lOpenCL
LIBNAME = libknlmeanscl.so
install path = /usr/lib/vapoursynth
configure finished.
g++ -o libknlmeanscl.so -shared -fPIC -Wl,-O2,--sort-common,--as-needed,-z,relro,-z,now -O2 -std=gnu++11 -Wall -Wno-unused-local-typedefs -I. -I./shared -I./include -march=native -mtune=native -O2 -pipe -fstack-protector-strong -fno-plt -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/vapoursynth -lOpenCL KNLMeansCL/NLMKernel.cpp KNLMeansCL/NLMAvisynth.cpp KNLMeansCL/NLMVapoursynth.cpp KNLMeansCL/shared/common.cpp KNLMeansCL/shared/ocl_utils.cpp KNLMeansCL/shared/startchar.cpp
strip libknlmeanscl.so
make: Entering directory '/startdir/src/knlmeanscl'
g++ -o libknlmeanscl.so -shared -fPIC -Wl,-O2,--sort-common,--as-needed,-z,relro,-z,now -O2 -std=gnu++11 -Wall -Wno-unused-local-typedefs -I. -I./shared -I./include -march=native -mtune=native -O2 -pipe -fstack-protector-strong -fno-plt -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/vapoursynth -lOpenCL KNLMeansCL/NLMKernel.cpp KNLMeansCL/NLMAvisynth.cpp KNLMeansCL/NLMVapoursynth.cpp KNLMeansCL/shared/common.cpp KNLMeansCL/shared/ocl_utils.cpp KNLMeansCL/shared/startchar.cpp
strip libknlmeanscl.so
install -d /usr/lib/vapoursynth
install -m 755 libknlmeanscl.so /usr/lib/vapoursynth
make: Leaving directory '/startdir/src/knlmeanscl'
Python 3.6.4 (default, Jan 5 2018, 02:35:40)
[GCC 7.2.1 20171224] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import vapoursynth as vs
>>> core=vs.get_core()
>>> print(core.version())
VapourSynth Video Processing Library
Copyright (c) 2012-2018 Fredrik Mellbin
Core R43
API R3.5
Options: -
>>> core.knlm
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "src/cython/vapoursynth.pyx", line 1416, in vapoursynth.Core.__getattr__
AttributeError: No attribute with the name knlm exists. Did you mistype a plugin namespace?
What is your system?
Ubuntu MATE 16.04.04 LTS (Xenial) 64-bit system
./configure --install=/usr/lib/x86_64-linux-gnu/vapoursynth
CXXFLAGS/LDFLAGS checking...
checking for vapoursynth headers...
checking for OpenCL...
settings...
CXX = g++
LD = g++
STRIP = strip
CXXFLAGS = -O2 -std=gnu++11 -Wall -Wno-unused-local-typedefs -I. -I./shared -I./include -fPIC -I/usr/include/vapoursynth
LDFLAGS = -shared -fPIC
LIBS = -lOpenCL
LIBNAME = libknlmeanscl.so
install path = /usr/lib/x86_64-linux-gnu/vapoursynth
configure finished.
g++ -o libknlmeanscl.so -shared -fPIC -O2 -std=gnu++11 -Wall -Wno-unused-local-typedefs -I. -I./shared -I./include -fPIC -I/usr/include/vapoursynth -lOpenCL KNLMeansCL/NLMKernel.cpp KNLMeansCL/NLMAvisynth.cpp KNLMeansCL/NLMVapoursynth.cpp KNLMeansCL/shared/common.cpp KNLMeansCL/shared/ocl_utils.cpp KNLMeansCL/shared/startchar.cpp
strip libknlmeanscl.so
install -d /usr/lib/x86_64-linux-gnu/vapoursynth
install -m 755 libknlmeanscl.so /usr/lib/x86_64-linux-gnu/vapoursynth
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import vapoursynth as vs
>>> core=vs.get_core()
>>> print(core.version())
VapourSynth Video Processing Library
Copyright (c) 2012-2017 Fredrik Mellbin
Core R40
API R3.5
Options: -
>>> core.knlm
<vapoursynth.Plugin object at 0x7f336b189678>
Maybe not the same bug but I think I have one closely related. If you want I can make it a separate issue.
My distro is Gentoo Linux
and I'm using x11-drivers/nvidia-drivers-390.42
proprietary drivers.
Plugins loads, but when I try to actually use it, it crashes with the message: vsedit: symbol lookup error: /usr/lib64/vapoursynth/libknlmeanscl.so: undefined symbol: clGetPlatformIDs
It appears this bug is only triggered when the plugin was built with the linker flags Wl,--as-needed
and appeared after the refactoring and stuff between versions 1.1.1
and 1.1.0
. Without them, it loads and works.
Because the build system was broken at that time it is difficult for me to track the exact commit the problem appeared.
And the cause seems to be the build system does not actually tells to link against OpenCL and keep it and somehow and it gets stripped with --as-needed
.
With a custom compiling script it worked fine.
yep. seems like filtering '--as-needed' in LDFLAGS fix the problem
Everything works fine after disable --as-needed
in LDFLAGS.
The fix of vsedit: symbol lookup error: /usr/lib64/vapoursynth/libknlmeanscl.so: undefined symbol: clGetPlatformIDs
is edit/create file in /etc/OpenCL/vendors/nvidia.icd
(or /etc/OpenCL/vendors/intel.icd
if you want to use cpu), change it to libnvidia-opencl.so
(or libintelocl.so
), make sure the .so
is in your library path(otherwise you may want to use full path like /opt/intel/opencl-runtime/lib64/libintelocl.so
). This way works for me.
But I believe --as-needed
shouldn't be blamed. Its a bug of this project. I will be appreciate if you can open this issue until this problem is really fixed.
I'm using ArchLinux nvidia 390.42 gcc 7.3.1
The fix of vsedit: symbol lookup error: /usr/lib64/vapoursynth/libknlmeanscl.so: undefined symbol: clGetPlatformIDs is edit/create file in /etc/OpenCL/vendors/nvidia.icd (or /etc/OpenCL/vendors/intel.icd if you want to use cpu), change it to libnvidia-opencl.so (or libintelocl.so), make sure the .so is in your library path(otherwise you may want to use full path like /opt/intel/opencl-runtime/lib64/libintelocl.so). This way works for me.
this sound a missing dependencies, like opencl-driver. i'm working now for fix it
EDIT: opencl-driver is optional dependencies for ocl-icd. then is not package fault
@sl1pkn07 Thank you for your care.
I have not meet the problem vsedit: symbol lookup error: /usr/lib64/vapoursynth/libknlmeanscl.so: undefined symbol: clGetPlatformIDs
in my ArchLinux. After your quick fix, I can install this plugin using AUR helper without any pain. Thank you again.
I have that problem with gentoo long time ago so I just want to tell @4re what might happend. I have switched back to ArchLinux so I do not know what gentoo do recently. But I think this may help in some way.
But ofc --as-needed
is not the problem, I can build this very same source code with it and it works flawlessly. The problem is the build system, probably OpenCL is not linked and the build system for some reason does not complain about it, in the end you end up with a faulty library.
I did a PR with meson as build system but travis VM's are too old for it...
@4re seems to have solved the problem.
I build latest version (v1.1.1) in linux and copy the .so to /usr/lib/vapoursynth/ . The plugin can not load.
Build log