in linux/cuda_installer/os_installers/__init__.py [0:0]
def check_driver_installed(cls) -> bool:
"""
Checks if the driver is already installed by calling the `nvidia-smi` binary.
If it's available, that means the driver is already installed.
"""
process = cls.run("which nvidia-smi", check=False)
if process.returncode != 0:
return False
process2 = cls.run("nvidia-smi", check=False)
return process2.returncode == 0