Which distribution are you using?
The Xserver is too old to support render offload on nvidia, you can only configure it to use the nvidia gpu as primary gpu.
https://forums.developer.nvidia.com/t/official-driver-384-59-with-geforce-1050m-doesnt-work-on-opensuse-tumbleweed-kde/52620/2?u=generix