Failed to open video codec: unknown error occurred

I haven’t done a screen recording for a while, but last time I did with OBS, while using the NVENC codec, it worked fine. I have since done a couple of system updates. I tried to do a recording today with the NVENC codec and got the error message Failed to open video codec: unknown error occurred. Is this a known issue at the moment with the current version of OBS, or is this issue on my side?

Check your drivers or if nvidia modules are loading properly. Apparently you have a laptop with hibrid GPU, so does the error shows when you run: prime-run obs or only when you start recording?

The error persists with prime-run obs.

I also have the latest version of the nvidia drivers installed.