the first step is using the NVIDIA open-gpu-kernel-modules instead of the proprietary drivers. this is already the default on some distros. it requires turing (i.e. RTX 2000) or newer you will also probably want the nvidia-vaapi-driver for VA-API support (has some limitations but overall good!)