NVEnc icon indicating copy to clipboard operation
NVEnc copied to clipboard

checking for cuda (CUDA_PATH=/usr/local/cuda)...cuda not supported.

Open apolo56 opened this issue 4 years ago • 11 comments

i have problem with cuda

i do installation like you say , cuda 10.2 and nvidia driver 440

NVIDIA-SMI 440.33.01 Driver Version: 440.33.01 CUDA Version: 10.2

when start

root@ubuntu:~/NVEnc# ./configure checking for g++...OK checking for cuda (CUDA_PATH=/usr/local/cuda)...cuda not supported.

where is a problem ?

please reply

apolo56 avatar Jan 03 '21 09:01 apolo56

You might need to check if CUDA is actually installed in CUDA_PATH.

rigaya avatar Jan 04 '21 04:01 rigaya

here its from my server

root@ubuntu:~/NVEnc# echo $LD_LIBRARY_PATH /usr/local/cuda-10.2/lib64{LD_LIBRARY_PATH:+:/usr/local/cuda/lib64:/usr/local/cuda-10.2/lib64}

answer from ./configure

root@ubuntu:~/NVEnc# ./configure checking for g++...OK checking for cuda (CUDA_PATH=/usr/local/cuda-10.2/lib64)...cuda not supported.

ubuntu its 16.4

apolo56 avatar Jan 04 '21 08:01 apolo56

I haven't tested Ubuntu 16.04, so there might be difficulty in building.

Also, I think CUDA_PATH should be as below for your environment. CUDA_PATH=/usr/local/cuda-10.2

I also have updated configure script in the latest commit, you shall be able to get details of the error in "config.log".

rigaya avatar Jan 05 '21 12:01 rigaya

ok i will try agen , after your update configure

regards

apolo56 avatar Jan 05 '21 13:01 apolo56

after checking with new agen same thing

root@ubuntu:~/NVEnc# ./configure checking for g++...OK checking for cuda (CUDA_PATH=/usr/local/cuda-10.2)...nvcc=/usr/local/cuda-10.2/bin/nvcc checking for cuda...cuda not supported. nvcc placed in right place

cuda_10

apolo56 avatar Jan 05 '21 17:01 apolo56

With new configure script, you shall have "config.log" in the same directory of configure script for further information, which will help you understand the error.

rigaya avatar Jan 06 '21 03:01 rigaya

Hi rigaya,

Im seeing the same problem on my end due to a missing "cxx_check.c" file.

tsunami@zima:~/NVEnc$ echo $LD_LIBRARY_PATH /usr/local/cuda-11.3/lib64

tsunami@zima:~/NVEnc$ ./configure checking for g++...checking for g++...OK checking for cuda (CUDA_PATH=/usr/local/cuda)...nvcc=/usr/local/cuda/bin/nvcc checking for cuda...cuda not supported.

config.log shows a call for cxx_check.c that doesnt exist:

- checking for cuda... --------------

------ command ------------ g++ -w cxx_check.c -Wall -Wno-unknown-pragmas -Wno-unused -Wno-missing-braces -DLINUX -DUNIX -D_FILE_OFFSET_BITS=64 -D__USE_LARGEFILE64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -I. -I./NVEncSDK/Common/inc -I./NVEncCore -I./jitify -I./tinyxml2 -I./cppcodec -I./ttmath -DLINUX64 -m64 -I/usr/local/cuda/include -L. -ldl -lstdc++ -lstdc++fs -m64 -L/usr/local/cuda/lib64 -lnvrtc -lnppif -lnppig -lnppc -lcudart -lcuda -o cxx_check ------ test ---------------

tsunami@zima:~/NVEnc$ ll total 460 drwxrwxr-x 18 tsunami tsunami 4096 May 30 17:22 ./ drwxr-xr-x 22 tsunami tsunami 4096 May 30 12:26 ../ -rw-rw-r-- 1 tsunami tsunami 4478 May 30 12:22 appveyor.yml -rw-rw-r-- 1 tsunami tsunami 1413 May 30 12:22 Build.cn.md -rw-rw-r-- 1 tsunami tsunami 23845 May 30 12:22 Build.en.md -rw-rw-r-- 1 tsunami tsunami 26916 May 30 12:22 Build.ja.md drwxrwxr-x 2 tsunami tsunami 4096 May 30 12:22 BuildParallel/ -rwxrwxr-x 1 tsunami tsunami 3608 May 30 12:22 check_options.py* -rw-rw-r-- 1 tsunami tsunami 1590 May 30 17:22 config.log -rwxrwxr-x 1 tsunami tsunami 24362 May 30 12:22 configure* drwxrwxr-x 6 tsunami tsunami 4096 May 30 12:22 cppcodec/ -rw-rw-r-- 1 tsunami tsunami 5657 May 30 12:22 cudaver.props drwxrwxr-x 2 tsunami tsunami 4096 May 30 12:22 cufilters/ drwxrwxr-x 5 tsunami tsunami 4096 May 30 12:22 dtl/ drwxrwxr-x 5 tsunami tsunami 4096 May 30 12:22 ffmpeg_lgpl/ drwxrwxr-x 9 tsunami tsunami 4096 May 30 12:22 .git/ -rw-rw-r-- 1 tsunami tsunami 2519 May 30 12:22 .gitattributes -rw-rw-r-- 1 tsunami tsunami 2340 May 30 12:22 .gitignore -rw-rw-r-- 1 tsunami tsunami 261 May 30 12:22 .gitmodules drwxrwxr-x 2 tsunami tsunami 4096 May 30 12:22 GPUFeatures/ drwxrwxr-x 2 tsunami tsunami 4096 May 30 12:22 jitify/ -rw-rw-r-- 1 tsunami tsunami 1373 May 30 12:22 makefile drwxrwxr-x 6 tsunami tsunami 4096 May 30 12:22 NVEnc/ drwxrwxr-x 2 tsunami tsunami 4096 May 30 12:22 NVEncC/ -rw-rw-r-- 1 tsunami tsunami 68460 May 30 12:22 NVEncC_Options.en.md -rw-rw-r-- 1 tsunami tsunami 82915 May 30 12:22 NVEncC_Options.ja.md -rw-rw-r-- 1 tsunami tsunami 51305 May 30 12:22 NVEncC_Options.zh-cn.md drwxrwxr-x 2 tsunami tsunami 12288 May 30 12:22 NVEncCore/ -rw-rw-r-- 1 tsunami tsunami 6932 May 30 12:22 NVEnc_license.txt drwxrwxr-x 3 tsunami tsunami 4096 May 30 12:22 NVEncSDK/ -rw-rw-r-- 1 tsunami tsunami 10950 May 30 12:22 NVEnc.sln drwxrwxr-x 2 tsunami tsunami 4096 May 30 12:22 PerfMonitor/ -rw-rw-r-- 1 tsunami tsunami 5769 May 30 12:22 Readme.cn.md -rw-rw-r-- 1 tsunami tsunami 10942 May 30 12:22 Readme.ja.md -rw-rw-r-- 1 tsunami tsunami 9449 May 30 12:22 Readme.md drwxrwxr-x 2 tsunami tsunami 4096 May 30 12:22 resource/ drwxrwxr-x 2 tsunami tsunami 4096 May 30 12:22 tinyxml2/ -rw-rw-r-- 1 tsunami tsunami 1580 May 30 12:22 .travis.yml drwxrwxr-x 3 tsunami tsunami 4096 May 30 12:22 ttmath/ tsunami@zima:~/NVEnc$

Oroachi avatar May 30 '21 22:05 Oroachi

cxx_check.c is a temporary file just for test, so it is deleted after test. Therefore it will not be there after test. It checks for existence of cuda.h and cuda related libs, such as libcuda.so.

config.log should continue like below if it works without error.

checking for cuda (CUDA_PATH=/usr/local/cuda)...
nvcc=/usr/local/cuda/bin/nvcc

### - checking for cuda... --------------
------ command ------------
g++ -w cxx_check.c -Wall -Wno-unknown-pragmas -Wno-unused -Wno-missing-braces -DLINUX -DUNIX -D_FILE_OFFSET_BITS=64 -D__USE_LARGEFILE64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -I. -I./NVEncSDK/Common/inc -I./NVEncCore -I./jitify -I./tinyxml2 -I./cppcodec -I./ttmath -DLINUX64 -m64 -I/usr/local/cuda/include -L. -ldl -lstdc++ -lstdc++fs -m64 -L/usr/local/cuda/lib64 -lnvrtc -lnppif -lnppig -lnppc -lcudart -lcuda -o cxx_check
------ test ---------------
#include <iostream>
#include <cuda.h>
int main(void){ auto result = cuInit(0);; std::cout << "Hello World!" << std::endl; return 0;}
---------------------------
### - test fin -> 0 ----------
OK, CUDA 11.2

Please check for existence of cuda.h, libcuda.so, libcudart.so.

[rigaya@localhost NVEnc]$ ls /usr/local/cuda/include/cuda.h
/usr/local/cuda/include/cuda.h
[rigaya@localhost NVEnc]$ ls /usr/lib64/libcuda.so
/usr/lib64/libcuda.so
[rigaya@localhost NVEnc]$ ls /usr/local/cuda/lib64/libcudart.so
/usr/local/cuda/lib64/libcudart.so

rigaya avatar May 31 '21 12:05 rigaya

Hi rigaya,

Thanks for the followup. It turns out that /usr/lib64/libcuda.so was missing in that folder so I made a symlink like so:

tsunami@zima:~$ find /usr/ -name 'libcuda.so.1' /usr/lib/x86_64-linux-gnu/libcuda.so.1

tsunami@zima:~$ ls /usr/lib64/libcuda.so ls: cannot access '/usr/lib64/libcuda.so': No such file or directory

tsunami@zima:~$ sudo ln -s /usr/lib/x86_64-linux-gnu/libcuda.so.1 /usr/lib64/libcuda.so

tsunami@zima:~/NVEnc$ ./configure checking for g++...checking for g++...OK checking for cuda (CUDA_PATH=/usr/local/cuda)...nvcc=/usr/local/cuda/bin/nvcc checking for cuda...OK, CUDA 11.3 checking for pthread...OK checking for c++17...OK checking for -msse4.1...checking for -march=native...OK checking for system SSE4.1 support...OK checking for __rdtscp()...yes checking for _xgetbv()...yes checking for -fPIE...configuring for speed... checking for -mfpmath=sse...yes checking for -ffast-math...yes checking for -fomit-frame-pointer...yes checking for --extra-cflags...OK checking for --extra-ldflags...OK checking for pkg-config...OK checking libavcodec with pkg-config...OK checking for libavutil...yes checking for libavcodec...yes checking for libavformat...yes checking for libavfilter...yes checking for libswresample...yes checking vapoursynth with pkg-config...libs could not be detected by pkg-config. [ PKG_CONFIG_PATH=:/usr/local/lib/pkgconfig ] checking for VapourSynth.h...no checking for VSScript.h...no checking avisynth with pkg-config...libs could not be detected by pkg-config. [ PKG_CONFIG_PATH=:/usr/local/lib/pkgconfig ] checking for avisynth_c.h...no checking libass with pkg-config...OK checking for ass/ass.h...yes checking for dtl/dtl.hpp...yes

Creating config.mak, rgy_config.h... SRCDIR = . CXX = g++ NVCC = /usr/local/cuda/bin/nvcc LD = g++ PROGRAM = nvencc ENABLE_DEBUG = 0 CXXFLAGS = -Wall -Wno-unknown-pragmas -Wno-unused -Wno-missing-braces -pthread -march=native -mtune=native -fPIE -O3 -DNDEBUG=1 -mfpmath=sse -ffast-math -fomit-frame-pointer -std=c++17 -DLINUX -DUNIX -D_FILE_OFFSET_BITS=64 -D__USE_LARGEFILE64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -I. -I./NVEncSDK/Common/inc -I./NVEncCore -I./jitify -I./tinyxml2 -I./cppcodec -I./ttmath -DLINUX64 -m64 -I/usr/local/cuda/include -I/usr/include/x86_64-linux-gnu -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/uuid -I/usr/include/fribidi -I/usr/include/freetype2 -I/usr/include/libpng16 -I./dtl NVCCFLAGS = --generate-code arch=compute_50,code=[compute_50,sm_50] --generate-code arch=compute_61,code=[compute_61,sm_61] --generate-code arch=compute_75,code=[compute_75,sm_75] --generate-code arch=compute_86,code=[compute_86,sm_86] -Wno-deprecated-gpu-targets --cudart=static -std=c++14 -Xcudafe "--display_error_number --diag_suppress=108" -std=c++14 -ccbin g++ -I/usr/local/cuda/include -DLINUX -DUNIX -D_FILE_OFFSET_BITS=64 -D__USE_LARGEFILE64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -I. -I./NVEncSDK/Common/inc -I./NVEncCore -I./jitify -I./tinyxml2 -I./cppcodec -I./ttmath -DLINUX64 -m64 -Xcompiler "-Wall -Wno-unknown-pragmas -Wno-unused -Wno-missing-braces -pthread -march=native -mtune=native -fPIE -O3 -DNDEBUG=1 -mfpmath=sse -ffast-math -fomit-frame-pointer " -I/usr/include/x86_64-linux-gnu -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/uuid -I/usr/include/fribidi -I/usr/include/freetype2 -I/usr/include/libpng16 -I./dtl LDFLAGS = -L. -ldl -lstdc++ -lstdc++fs -m64 -pthread -L/usr/local/cuda/lib64 -lnvrtc -lnppif -lnppig -lnppc -lcudart -lcuda -lswresample -lavutil -lavcodec -lavformat -lavfilter -lass PREFIX = /usr/local X86_64 = 1 #define ENCODER_REV "1932" #define ENABLE_AVI_READER 0 #define ENABLE_AVISYNTH_READER 0 #define ENABLE_VAPOURSYNTH_READER 0 #define ENABLE_AVSW_READER 1 #define ENABLE_SM_READER 0 #define ENABLE_LIBASS_SUBBURN 1 #define ENABLE_VMAF 0 #define ENABLE_AVCODEC_OUT_THREAD 1 #define ENABLE_CPP_REGEX 1 #define ENABLE_DTL 1 #define ENABLE_PERF_COUNTER 0 successfully generated config.mak, rgy_config.h tsunami@zima:~/NVEnc$

tsunami@zima:~/NVEnc$ ./nvencc --check-hw NVEnc (x64) 5.33 (r1932) by rigaya, May 31 2021 20:48:57 (gcc 9.3.0/Linux/avx2) [NVENC API v11.0, CUDA 11.3] reader: raw, y4m, avsw, avhw [H.264/AVC, H.265/HEVC, MPEG2, VP8, VP9, VC-1, MPEG1, MPEG4, AV1] InitCuda: device #0.

Checking Environment Info... NVEnc (x64) 5.33 (r1932) by rigaya, May 31 2021 20:48:57 (gcc 9.3.0/Linux/avx2) OS Version Ubuntu 20.04.2 LTS CPU AMD Ryzen 9 3950X 16-Core Processor (16C/32T) cuInit: Success. dlopen "libnvcuvid.so" failed! cuvidInit error:0x3e7 (CUDA_ERROR_UNKNOWN) Failed to initialize CUDA. Closed EncodeStatus. Closing perf monitor... Closing logger... tsunami@zima:~/NVEnc$

Compilation is succesfull, but im looking into this cuvidInit error now. If you have any suggestions on where to look, i'd appreciate them.

Thanks!

Oroachi avatar Jun 01 '21 01:06 Oroachi

dlopen "libnvcuvid.so" failed!

Might be the same issue as libcuda.so, as libnvcuvid.so should also be there. Creating simlink might work.

rigaya@rigaya5-linux:~/build/NVEnc$ ls /lib/x86_64-linux-gnu/ | grep libnvcuvid
libnvcuvid.so
libnvcuvid.so.1
libnvcuvid.so.460.73.01
rigaya@rigaya5-linux:~/build/NVEnc$ ls /lib/x86_64-linux-gnu/ | grep libcuda
libcuda.so
libcuda.so.1
libcuda.so.460.73.01

rigaya avatar Jun 01 '21 14:06 rigaya

It was /opt/cuda for me. I just set this directory in my configure file, and it worked. Maybe this command helps someone: sudo find / -name cuda_runtime.h I use arch btw.

BudayBoldi avatar Jun 21 '23 10:06 BudayBoldi