DeadSix27 / waifu2x-converter-cpp

Improved fork of Waifu2X C++ using OpenCL and OpenCV
MIT License
792 stars 86 forks source link

Compiled without CUDA tries to use it anyway #219

Closed kattjevfel closed 4 years ago

kattjevfel commented 4 years ago

When compiling the program without cuda installed, it will still try to use it when running, and segfaults instead.

-- The C compiler identification is GNU 9.2.0
-- The CXX compiler identification is GNU 9.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found git, set version to: v5.3.3 (master-14db6c4)
-- System is: Linux (Linux)
-- Looking for CL_VERSION_2_2
-- Looking for CL_VERSION_2_2 - found
-- Found OpenCL: /usr/lib/libOpenCL.so (found version "2.2") 
-- Found OpenCV: /usr (found version "4.2.0") 
CUDA_TOOLKIT_ROOT_DIR not found or specified
-- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) 
-- CUDA not found. disabled.
-- 
-- Config summary:
--      OpenCV: 4.2.0
--      OpenCL: 2.2
--      CUDA: Not found
--      Unicode: TRUE
--      Installing models to: /usr/share/waifu2x-converter-cpp
--      Not building test binaries
--      Building for: Unix Makefiles-x86_64
-- 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/katt/build/waifu2x-converter-cpp/out
Stack trace of thread 594152:
#0  0x00007f287b8d48a8 n/a (/home/katt/build/waifu2x-converter-cpp/out/libw2xc.so + 0x768a8)
#1  0x00007f287b8c1002 n/a (/home/katt/build/waifu2x-converter-cpp/out/libw2xc.so + 0x63002)
#2  0x00007f287b89f08f n/a (/home/katt/build/waifu2x-converter-cpp/out/libw2xc.so + 0x4108f)
#3  0x00007f287b89f428 n/a (/home/katt/build/waifu2x-converter-cpp/out/libw2xc.so + 0x41428)
#4  0x00007f287b8bdb2e n/a (/home/katt/build/waifu2x-converter-cpp/out/libw2xc.so + 0x5fb2e)
#5  0x00007f287b8beee0 n/a (/home/katt/build/waifu2x-converter-cpp/out/libw2xc.so + 0x60ee0)
#6  0x00007f287b8bd824 n/a (/home/katt/build/waifu2x-converter-cpp/out/libw2xc.so + 0x5f824)
#7  0x00007f287b8c331c n/a (/home/katt/build/waifu2x-converter-cpp/out/libw2xc.so + 0x6531c)
#8  0x00007f287b8c5d5e n/a (/home/katt/build/waifu2x-converter-cpp/out/libw2xc.so + 0x67d5e)
#9  0x00007f287b8c742e n/a (/home/katt/build/waifu2x-converter-cpp/out/libw2xc.so + 0x6942e)
#10 0x0000564912278155 n/a (/home/katt/build/waifu2x-converter-cpp/out/waifu2x-converter-cpp + 0x13155)
#11 0x000056491227babd n/a (/home/katt/build/waifu2x-converter-cpp/out/waifu2x-converter-cpp + 0x16abd)
#12 0x00007f2878576153 __libc_start_main (libc.so.6 + 0x27153)
#13 0x00005649122769de n/a (/home/katt/build/waifu2x-converter-cpp/out/waifu2x-converter-cpp + 0x119de)
Reading symbols from /home/katt/build/waifu2x-converter-cpp/out/waifu2x-converter-cpp...

warning: core file may not match specified executable file.
[New LWP 594152]
[New LWP 594156]
[New LWP 594167]
[New LWP 594164]
[New LWP 594161]
[New LWP 594157]
[New LWP 594158]
[New LWP 594159]
[New LWP 594155]
[New LWP 594165]
[New LWP 594160]
[New LWP 594166]
[New LWP 594162]
[New LWP 594163]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `./waifu2x-converter-cpp -i opinion_discarded.jpg'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f287b8d48a8 in Buffer::get_write_ptr_cuda (this=0x564912e2d7b0, env=0x564912e24590, devid=0)
    at /home/katt/build/waifu2x-converter-cpp/src/Buffer.cpp:218
218         cuCtxPushCurrent(dev->context);
[Current thread is 1 (Thread 0x7f28770e8400 (LWP 594152))]
sl1pkn07 commented 4 years ago

maybe you opencv is compiled with cuda support?

kattjevfel commented 4 years ago

@sl1pkn07 While there is a opencv-cuda package, I am not using it, and the official package does not appear to have it enabled.

YukihoAA commented 4 years ago

Hi @Kattus

Please try #233 thank you.