Unable to use NVENC Codec

Installed Manjaro 2 to 3 days ago, everything went fine, my games were running but there’s one problem, NVENC.
When i try sharing my screen on Discord it lags a lot because it’s using CPU, i can’t use Davinci Resolve, can’t record on OBS and so goes on.
It does work on Windows, 4 months ago i tried Pop OS and i got the same problem

glxinfo | grep OpenGL
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce GTX 1050 Ti/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 495.46
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6.0 NVIDIA 495.46
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 495.46
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

and i tried using davinci-resolve-checker :

python davinci-resolve-checker.py
Using locale en_US
DaVinci Resolve checker 2.5.1
Installed DaVinci Resolve package:
Chassis type: desktop
Installed OpenCL drivers: opencl-nvidia
Presented GPUs:
	GP107 [GeForce GTX 1050 Ti] (kernel driver in use: nvidia)
OpenGL vendor string: NVIDIA Corporation

All seems good. You should be able to run DaVinci Resolve successfully.

would appreciate any help

Maybe this page could help: Hardware video acceleration - ArchWiki
(found the link here [SOLVED] FFMPEG - Failed to initialise VAAPI connection / Multimedia and Games / Arch Linux Forums)

I remember not being able to normally record with OBS (unstable framerate) in Windows until I suppose I switched to hardware encoder (FFMPEG VAAPI I guess) and OBS was worked fine. I have Intel and AMD GPUs by the way. Then, I tried running OBS in Manjaro, tried to change to the hardware encoder but I was getting an error when hitting the record button:

Starting the output failed. Please check the log for details.

Note: If you are using the NVENC or AMD encoders, make sure your video drivers are up to date.

I suppose I then found the thread on Arch forum and gave a try installing the mentioned driver(s) and I think I got it working just by doing this, I can’t recall exactly.

Yeah, vaapi is for intel and doesn’t works on nvidia proprietary drivers.

After checking the ArchWiki page and running vdpauinfo it shows that my card is compatible:

[cherosin@cherosin ~]$ vdpauinfo
display: :0.0   screen: 0
API version: 1
Information string: NVIDIA VDPAU Driver Shared Library  495.46  Wed Oct 27 16:20:01 UTC 2021

Video surface:

name   width height types
420     8192  8192  NV12 YV12
422     8192  8192  UYVY YUYV
444     8192  8192  NV24 YV24
420_16  8192  8192  P010 P016
422_16  8192  8192  UYVY YUYV
444_16  8192  8192  Y_U_V_444_16

Decoder capabilities:

name                        level macbs width height
MPEG1                           0 65536  4096  4096
MPEG2_SIMPLE                    3 65536  4096  4096
MPEG2_MAIN                      3 65536  4096  4096
H264_BASELINE                  51 65536  4096  4096
H264_MAIN                      51 65536  4096  4096
H264_HIGH                      51 65536  4096  4096

and after messing around with FFMPEG i got this error:

[h264_nvenc @ 0x55c04df85840] dl_fn->cuda_dl->cuInit(0) failed -> CUDA_ERROR_SYSTEM_NOT_READY: system not yet initialized
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height