Closed Jasmin68k closed 3 weeks ago
Hardware decoding in Firefox works anyway, except for latest
master
branch
Maybe related to https://github.com/elFarto/nvidia-vaapi-driver/issues/271
From a quick glance at the code:
The nv_get_versions
function in nv-driver.c
changed somewhere between V0.0.9 and V0.0.10 and, at least on my system, the new version seems to return an empty string (see vainfo output in original post).
nv-driver.c
sets different parameters based on driver version in the nv_alloc_object
function (f.e. if (driverMajorVersion < 525) {
...).
Up to about V0.0.10 these comparisons might not result in an optimal set of values for the 525 driver on my system due to the non-working nv_get_version
function, but decoding still works.
In latest master
however, the empty string is replaced with dummy version 470.123.45
, resulting in the alloc_buffer
function handling nvkms_params_size
differently .nvkms_params_size = context->driverMajorVersion == 470 ? 0x20 : sizeof(nvkmsParams)
.
I assume the latter is why latest master does not work anymore on my system, and does work again, if I replace the dummy driver version with 525.147.05
.
I don't claim to know exactly, how the code is working, so I might be off here.
That was added in 1d6a9d39bed38d1e2cfbe6528fafc91e1618af68 to fix #267
I've added an additional work around in master for reading the version if the ioctl fails to. I'm not sure if this is still an issue for you, but if you could test it and see if it resolves the issue.
It's been a while, since I looked at this, since things have just been working for some time now.
It was with release V0.0.12 that I noticed, I don't need to patch in my driver version manually anymore as described above and vainfo --display drm
showed me that the correct driver version was detected.
Whether that was some fix in V0.0.12, in the driver or somewhere else, I don't know.
I would love to give you more info, but vainfo --display drm
does not give me verbose output anymore, just this:
vainfo --display drm
vainfo: VA-API version: 1.22 (libva 2.12.0)
vainfo: Driver version: VA-API NVDEC driver [direct backend]
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileH264Main : VAEntrypointVLD
VAProfileH264High : VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
VAProfileHEVCMain10 : VAEntrypointVLD
VAProfileHEVCMain12 : VAEntrypointVLD
VAProfileVP9Profile2 : VAEntrypointVLD
So I don't know, which driver version it actually detects or whether it uses your workaround or the fallback version.
I can tell you that V0.0.12 and master
are still working, as in it shows GPU decode in nvtop
.
Would you happen to know, why vainfo
doesn't show all the info it used to show and how to fix this? Then I could tell you more.
I haven't ugpraded the system for a while, so tests where done with driver version 535.183.01. VA-API/libva as shown in vainfo
might not be the latest either.
You need NVD_LOG
set to 1
for this driver to log stuff.
Yeah, right, of course.
I tested again with current master, V0.0.12 and V0.0.11.
With the current driver version and setup, detection and decode work in all cases and the fallback in master is not needed, but should be good to have just in case.
Since V0.0.11 works now, too, it might have been a bug in the earlier NVidia driver or something else in the at the time older Debian Sid setup.
In any case, it seems all is well now.
Thanks for getting back to the issue and adding the fallback as an additional detection measure!
master - decode works
vainfo --display drm
682.984215616 [4126-4126] ../src/vabackend.c:2187 __vaDriverInit_1_0 Initialising NVIDIA VA-API Driver: 31
682.984228108 [4126-4126] ../src/vabackend.c:2196 __vaDriverInit_1_0 Now have 0 (100 max) instances
682.984232033 [4126-4126] ../src/vabackend.c:2222 __vaDriverInit_1_0 Selecting Direct backend
682.989609814 [4126-4126] ../src/direct/nv-driver.c: 295 init_nvdriver Initing nvdriver...
682.989626253 [4126-4126] ../src/direct/nv-driver.c: 313 init_nvdriver NVIDIA kernel driver version: 535.183.01, major version: 535, minor version: 183
682.989628659 [4126-4126] ../src/direct/nv-driver.c: 320 init_nvdriver Got dev info: 100 1 0 fe
vainfo: VA-API version: 1.22 (libva 2.12.0)
vainfo: Driver version: VA-API NVDEC driver [direct backend]
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileH264Main : VAEntrypointVLD
VAProfileH264High : VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
VAProfileHEVCMain10 : VAEntrypointVLD
VAProfileHEVCMain12 : VAEntrypointVLD
VAProfileVP9Profile2 : VAEntrypointVLD
683.036100847 [4126-4126] ../src/vabackend.c:2095 nvTerminate Terminating 0x55566ced94d0
683.036126787 [4126-4126] ../src/vabackend.c:2109 nvTerminate Now have 0 (100 max) instances
V0.0.12 - decode works
vainfo --display drm
831.182697173 [5136-5136] ../src/vabackend.c:2188 __vaDriverInit_1_0 Initialising NVIDIA VA-API Driver: 31
831.182705524 [5136-5136] ../src/vabackend.c:2197 __vaDriverInit_1_0 Now have 0 (100 max) instances
831.182707816 [5136-5136] ../src/vabackend.c:2223 __vaDriverInit_1_0 Selecting Direct backend
831.187105341 [5136-5136] ../src/direct/nv-driver.c: 267 init_nvdriver Initing nvdriver...
831.187125552 [5136-5136] ../src/direct/nv-driver.c: 285 init_nvdriver NVIDIA kernel driver version: 535.183.01, major version: 535, minor version: 183
831.187129749 [5136-5136] ../src/direct/nv-driver.c: 292 init_nvdriver Got dev info: 100 1 0 fe
vainfo: VA-API version: 1.22 (libva 2.12.0)
vainfo: Driver version: VA-API NVDEC driver [direct backend]
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileH264Main : VAEntrypointVLD
VAProfileH264High : VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
VAProfileHEVCMain10 : VAEntrypointVLD
VAProfileHEVCMain12 : VAEntrypointVLD
VAProfileVP9Profile2 : VAEntrypointVLD
831.231860959 [5136-5136] ../src/vabackend.c:2098 nvTerminate Terminating 0x5619c149f4d0
831.231888231 [5136-5136] ../src/vabackend.c:2112 nvTerminate Now have 0 (100 max) instances
v0.0.11 - decode works
vainfo --display drm
925.315489025 [6371-6371] ../src/vabackend.c:2140 __vaDriverInit_1_0 Initialising NVIDIA VA-API Driver: 31
925.315500230 [6371-6371] ../src/vabackend.c:2149 __vaDriverInit_1_0 Now have 0 (100 max) instances
925.315502572 [6371-6371] ../src/vabackend.c:2175 __vaDriverInit_1_0 Selecting Direct backend
925.320917028 [6371-6371] ../src/direct/nv-driver.c: 246 init_nvdriver Initing nvdriver...
925.320935679 [6371-6371] ../src/direct/nv-driver.c: 264 init_nvdriver NVIDIA kernel driver version: 535.183.01, major version: 535, minor version: 183
925.320939544 [6371-6371] ../src/direct/nv-driver.c: 271 init_nvdriver Got dev info: 100 1 0 fe
vainfo: VA-API version: 1.22 (libva 2.12.0)
vainfo: Driver version: VA-API NVDEC driver [direct backend]
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileH264Main : VAEntrypointVLD
VAProfileH264High : VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
VAProfileHEVCMain10 : VAEntrypointVLD
VAProfileHEVCMain12 : VAEntrypointVLD
VAProfileVP9Profile2 : VAEntrypointVLD
925.366457500 [6371-6371] ../src/vabackend.c:2050 nvTerminate Terminating 0x564a321f34d0
925.366483587 [6371-6371] ../src/vabackend.c:2064 nvTerminate Now have 0 (100 max) instances
Hello!
Using the driver on Debian Sid with NVidia drivers V525.147.05, NVidia driver version is not properly detected since V0.0.10 as reported by vainfo.
Hardware decoding in Firefox works anyway, except for latest
master
branch, wherenv-driver.c
forces a dummy version of 470.123.45, when no proper NVidia driver version is returned.Since
nv-driver.c
sets different parameters depending on detected driver version, it might not work optimally though.EDIT: If I substitute the dummy driver version in
nv-driver.c
with525.147.05
,master
branch works, too.Let me know, if you need any further info.