nvidia-smi not recognized

I am new to this field, was trying to enable GPU to run gromacs with it, but mistakenly, I gave commands as sudo apt remove nvidia* , sudo apt autoremove , sudo ubuntu-drivers autoinstall after all these commands, I have given command as nvidia-smi and it show’s below output:
NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

Thank you in advance

Try to reinstall the NVIDIA driver from scratch following a guide of your choice, e.g. one from NVIDIA or something for your distribution.