Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Nvidia Nvenc Fails
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
FR3141
n00b
n00b


Joined: 13 Jan 2018
Posts: 39

PostPosted: Sat May 26, 2018 11:27 pm    Post subject: Nvidia Nvenc Fails Reply with quote

I am using the proprietary Nvidia drivers with a GT 730 based video card. The GT 730 has both vdpau and nvenc capabilities.

However, whenever I use ffmpeg to try any kind of recording or transcoding with the h264_nvenc codec, I get the following error:

[h264_nvenc @ 0xdd9aa0] Loaded Nvenc version 8.1
[h264_nvenc @ 0xdd9aa0] Nvenc initialized successfully
[h264_nvenc @ 0xdd9aa0] Cannot init CUDA
[h264_nvenc @ 0xdd9aa0] Nvenc unloaded
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0

What is the problem here or how can I debug this further?

My nvidia-drivers does have the CUDA libraries:

/usr/lib64/libcuda.so -> libcuda.so.396.24
/usr/lib64/libcuda.so.1 -> libcuda.so.396.24

Has anyone experienced this problem? An Internet search produces very few reports.
Back to top
View user's profile Send private message
FR3141
n00b
n00b


Joined: 13 Jan 2018
Posts: 39

PostPosted: Mon May 28, 2018 3:23 pm    Post subject: Reply with quote

I just want to add some more debugging information. Using the strace utility I get the following output:

Code:
stat("/dev/nvidia-uvm", {st_mode=S_IFCHR|0666, st_rdev=makedev(249, 0), ...}) = 0
stat("/dev/nvidia-uvm-tools", {st_mode=S_IFCHR|0666, st_rdev=makedev(249, 1), ...}) = 0
openat(AT_FDCWD, "/dev/nvidia-uvm", O_RDWR|O_CLOEXEC) = -1 EIO (Input/output error)
openat(AT_FDCWD, "/dev/nvidia-uvm", O_RDWR) = -1 EIO (Input/output error)
ioctl(-5, _IOC(0, 0x00, 0x01, 0x3000), 0x7ffe40bf25c0) = -1 EBADF (Bad file descriptor)
ioctl(-5, _IOC(0, 0x00, 0x02, 0x3000), 0) = -1 EBADF (Bad file descriptor)
close(-5)                               = -1 EBADF (Bad file descriptor)
write(2, "\33[48;5;0m\33[38;5;51m[h264_nvenc @"..., 48[h264_nvenc @ 0x2411c00] ) = 48
write(2, "\33[48;5;0m\33[38;5;196mCannot init "..., 41Cannot init CUDA
) = 41

Apparently. ffmpeg tries to open the "/dev/nvidia-uvm" file, which is the device node for CUDA, but receives an error. After this the program exits with the "Cannot init CUDA" message.

I am not sure, but it would seem that the nvidia proprietary module is responsible for the input output error.

Could someone try to invoke nvenc with a suitable Nvidia card and report the results? One possible command for a screen capture is this:

ffmpeg -f x11grab -r 15 -s 640x480 -i :0.0+0,0 -vcodec h264_nvenc -preset default -pix_fmt yuv420p video.avi

Ffmpeg has to be emerged with "USE-nvenc"

[Moderator edit: added [code] tags to preserve output layout. -Hu]
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum