Proprietary driver for Nvidia GTX 1050 Ti

Open the Software & Updates panel. Under Additional Drivers, select the correct driver and apply.

Next, install the drivers for CUDA support: apt install nvidia-cuda-dev nvidia-cuda-toolkit