From aa1da0b6a3a5c5f4ae6ebc7d9d42ff91bb852fd2 Mon Sep 17 00:00:00 2001 From: Akashdeep Dhar Date: Thu, 12 May 2022 13:25:45 +0530 Subject: [PATCH] Add error correction messages Signed-off-by: Akashdeep Dhar --- .../interfaces/handle_compatibility_check.py | 3 ++- .../interfaces/handle_drivers_installation.py | 13 +++++++++++ .../interfaces/handle_prime_support.py | 18 +++++++++++++++ .../handle_rpmfusion_repositories.py | 14 ++++++++++++ .../interfaces/install_cuda_support.py | 22 +++++++++++++++++++ .../interfaces/install_everything.py | 1 + .../interfaces/install_ffmpeg_support.py | 13 +++++++++++ .../interfaces/install_nvidia_repositories.py | 20 +++++++++++++++++ .../interfaces/install_video_acceleration.py | 13 +++++++++++ .../interfaces/install_vulkan_support.py | 13 +++++++++++ 10 files changed, 129 insertions(+), 1 deletion(-) diff --git a/nvautoinstall/interfaces/handle_compatibility_check.py b/nvautoinstall/interfaces/handle_compatibility_check.py index 5603e75..084311a 100644 --- a/nvautoinstall/interfaces/handle_compatibility_check.py +++ b/nvautoinstall/interfaces/handle_compatibility_check.py @@ -29,6 +29,7 @@ def __init__(self): warning("Compatibility infomation was obtained") if data is False: failure("No supported NVIDIA GPU was detected") + general("This tool is supported only on devices having one or more active NVIDIA GPUs") else: success("One or more active NVIDIA GPUs were detected") supprt = data["supprt"] @@ -37,7 +38,7 @@ def __init__(self): if indx != "": general(indx) if supprt == "single": - success("An single dedicated GPU setup was detected") + success("A single dedicated GPU setup was detected") else: success("An Optimus Dual GPU setup was detected") section("GATHERING CURRENT HOST INFORMATION...") diff --git a/nvautoinstall/interfaces/handle_drivers_installation.py b/nvautoinstall/interfaces/handle_drivers_installation.py index 61f2465..fff15b1 100644 --- a/nvautoinstall/interfaces/handle_drivers_installation.py +++ b/nvautoinstall/interfaces/handle_drivers_installation.py @@ -57,13 +57,26 @@ def __init__(self): section("REINSTALLING PROPRIETARY DRIVERS...") if Objc_HandleDriversInstallation.main(): success("Driver package installation completed") + general( + "Please try executing `nvautoinstall plcuda` with elevated privileges now to install CUDA software" # noqa + ) else: failure("Proprietary drivers could not be installed") + general( + "Please try executing `dnf update` with elevated privileges before this" + ) else: failure("Connection to RPM Fusion servers could not be established") + general( + "Please check the internet connection or firewall configuration and try again" # noqa + ) else: failure("RPM Fusion repository for Proprietary NVIDIA Driver was not detected") + general( + "Please try executing `nvautoinstall rpmadd` with elevated privileges before this" # noqa + ) else: failure("Superuser privilege could not be acquired") + general("Please try executing this command with elevated privileges") failure("Leaving installer") sys.exit(0) diff --git a/nvautoinstall/interfaces/handle_prime_support.py b/nvautoinstall/interfaces/handle_prime_support.py index f7b4668..3e3d5bb 100644 --- a/nvautoinstall/interfaces/handle_prime_support.py +++ b/nvautoinstall/interfaces/handle_prime_support.py @@ -49,6 +49,9 @@ def __init__(self): data = Objc_HandleDriversInstallation.avbl() if data is False: failure("No existing NVIDIA driver packages were detected") + general( + "Please try executing `nvautoinstall driver` with elevated privileges before this" # noqa + ) else: qant = 0 for indx in data: @@ -66,21 +69,36 @@ def __init__(self): section("ENABLING PRIME SUPPORT...") if Objc_HandlePrimeSupport.main(True): success("PRIME Support was successfully enabled") + general("Please reboot your device for the changes to take effect") else: failure("PRIME Support could not be enabled") + general( + "Please confirm whether PRIME Support was properly configured" + ) elif solution == "N" or solution == "n": section("DISABLING PRIME SUPPORT...") if Objc_HandlePrimeSupport.main(False): success("PRIME Support was successfully disabled") + general("Please reboot your device for the changes to take effect") else: failure("PRIME Support could not be disabled") + general( + "Please confirm whether PRIME Support was properly configured" + ) else: section("SAFE AND GOOD ANSWER...") else: failure("Connection to RPM Fusion servers could not be established") + general( + "Please check the internet connection or firewall configuration and try again" # noqa + ) else: failure("RPM Fusion repository for Proprietary NVIDIA Driver was not detected") + general( + "Please try executing `nvautoinstall rpmadd` with elevated privileges before this" # noqa + ) else: failure("Superuser privilege could not be acquired") + general("Please try executing this command with elevated privileges") failure("Leaving installer") sys.exit(0) diff --git a/nvautoinstall/interfaces/handle_rpmfusion_repositories.py b/nvautoinstall/interfaces/handle_rpmfusion_repositories.py index 90cb106..924173a 100644 --- a/nvautoinstall/interfaces/handle_rpmfusion_repositories.py +++ b/nvautoinstall/interfaces/handle_rpmfusion_repositories.py @@ -23,6 +23,7 @@ Objc_CheckSuperuserPermissions, Objc_HandleRPMFusionRepositories, failure, + general, section, success, warning, @@ -37,6 +38,9 @@ def __init__(self): section("CHECKING AVAILABILITY OF RPM FUSION NVIDIA REPOSITORY...") if Objc_HandleRPMFusionRepositories.avbl(): warning("RPM Fusion repository for Proprietary NVIDIA Driver was detected") + general( + "Please try executing `nvautoinstall driver` with elevated privileges now to install the drivers" # noqa + ) success("No further action is necessary") else: warning("RPM Fusion repository for Proprietary NVIDIA Driver was not detected") @@ -47,11 +51,21 @@ def __init__(self): section("INSTALLING RPM FUSION NVIDIA REPOSITORY...") if Objc_HandleRPMFusionRepositories.main(): success("RPM Fusion NVIDIA repository was enabled") + general( + "Please try executing `nvautoinstall driver` with elevated privileges now to install the drivers" # noqa + ) else: failure("RPM Fusion NVIDIA repository could not be enabled") + general( + "Please try executing `dnf update` with elevated privileges before this" + ) else: failure("Connection to RPM Fusion servers could not be established") + general( + "Please check the internet connection or firewall configuration and try again" # noqa + ) else: failure("Superuser privilege could not be acquired") + general("Please try executing this command with elevated privileges") failure("Leaving installer") sys.exit(0) diff --git a/nvautoinstall/interfaces/install_cuda_support.py b/nvautoinstall/interfaces/install_cuda_support.py index f3cd0fd..812c855 100644 --- a/nvautoinstall/interfaces/install_cuda_support.py +++ b/nvautoinstall/interfaces/install_cuda_support.py @@ -47,6 +47,9 @@ def __init__(self): data = Objc_HandleDriversInstallation.avbl() if data is False: failure("No existing NVIDIA driver packages were detected") + general( + "Please try executing `nvautoinstall driver` with elevated privileges before this" # noqa + ) else: qant = 0 for indx in data: @@ -72,19 +75,38 @@ def __init__(self): ) else: failure("NVIDIA CUDA core packages could not be installed") + general( + "Please try executing `dnf update` with elevated privileges before this" # noqa + ) else: failure( "RPM Fusion CUDA metapackage packages could not be installed" # noqa ) + general( + "Please try executing `dnf update` with elevated privileges before this" # noqa + ) else: failure("Connection to NVIDIA servers could not be established") + general( + "Please check the internet connection or firewall configuration and try again" # noqa + ) else: failure("Official CUDA repository was not detected") + general( + "Try executing `nvautoinstall nvrepo` with elevated privileges before this" # noqa + ) else: failure("Connection to RPM Fusion servers could not be established") + general( + "Please check the internet connection or firewall configuration and try again" # noqa + ) else: failure("RPM Fusion repository for Proprietary NVIDIA Driver was not detected") + general( + "Please try executing `nvautoinstall rpmadd` with elevated privileges before this" # noqa + ) else: failure("Superuser privilege could not be acquired") + general("Please try executing this command with elevated privileges") failure("Leaving installer") sys.exit(0) diff --git a/nvautoinstall/interfaces/install_everything.py b/nvautoinstall/interfaces/install_everything.py index 3ec6452..ae271df 100644 --- a/nvautoinstall/interfaces/install_everything.py +++ b/nvautoinstall/interfaces/install_everything.py @@ -31,5 +31,6 @@ def __init__(self): general("This mode is yet to be implemented") else: failure("Superuser privilege could not be acquired") + general("Please try executing this command with elevated privileges") failure("Leaving installer") sys.exit(0) diff --git a/nvautoinstall/interfaces/install_ffmpeg_support.py b/nvautoinstall/interfaces/install_ffmpeg_support.py index ef59b18..14d4874 100644 --- a/nvautoinstall/interfaces/install_ffmpeg_support.py +++ b/nvautoinstall/interfaces/install_ffmpeg_support.py @@ -47,6 +47,9 @@ def __init__(self): data = Objc_HandleDriversInstallation.avbl() if data is False: failure("No existing NVIDIA driver packages were detected") + general( + "Please try executing `nvautoinstall driver` with elevated privileges before this" # noqa + ) else: qant = 0 for indx in data: @@ -61,11 +64,21 @@ def __init__(self): ) else: failure("NVENC/NVDEC for FFMPEG acceleration could not be installed") + general( + "Please try executing `dnf update` with elevated privileges before this" # noqa + ) else: failure("Connection to RPM Fusion servers could not be established") + general( + "Please check the internet connection or firewall configuration and try again" # noqa + ) else: failure("RPM Fusion repository for Proprietary NVIDIA Driver was not detected") + general( + "Please try executing `nvautoinstall rpmadd` with elevated privileges before this" # noqa + ) else: failure("Superuser privilege could not be acquired") + general("Please try executing this command with elevated privileges") failure("Leaving installer") sys.exit(0) diff --git a/nvautoinstall/interfaces/install_nvidia_repositories.py b/nvautoinstall/interfaces/install_nvidia_repositories.py index a60189a..476a18b 100644 --- a/nvautoinstall/interfaces/install_nvidia_repositories.py +++ b/nvautoinstall/interfaces/install_nvidia_repositories.py @@ -23,6 +23,7 @@ Objc_CheckSuperuserPermissions, Objc_HandleCudaInstallation, failure, + general, section, success, warning, @@ -37,6 +38,9 @@ def __init__(self): section("CHECKING AVAILABILITY OF OFFICIAL CUDA REPOSITORY...") if Objc_HandleCudaInstallation.rpck(): warning("Official CUDA repository was detected") + general( + "Please try executing `nvautoinstall plcuda` with elevated privileges now to install CUDA software" # noqa + ) success("No further action is necessary") else: warning("Official CUDA repository was not detected") @@ -53,15 +57,31 @@ def __init__(self): section("DISABLING NVIDIA DRIVER MODULE...") if Objc_HandleCudaInstallation.stop(): success("NVIDIA DRIVER module has been disabled") + general( + "Please try executing `nvautoinstall plcuda` with elevated privileges now to install CUDA software" # noqa + ) else: failure("NVIDIA DRIVER module could not be disabled") + general( + "Please try executing `dnf update` with elevated privileges before this" # noqa + ) else: failure("Repositories could not be refreshed") + general( + "Please try executing `dnf update` with elevated privileges before this" # noqa + ) else: failure("Official CUDA repository could not be enabled") + general( + "Please try executing `dnf update` with elevated privileges before this" + ) else: failure("Connection to NVIDIA servers could not be established") + general( + "Please check the internet connection or firewall configuration and try again" # noqa + ) else: failure("Superuser privilege could not be acquired") + general("Please try executing this command with elevated privileges") failure("Leaving installer") sys.exit(0) diff --git a/nvautoinstall/interfaces/install_video_acceleration.py b/nvautoinstall/interfaces/install_video_acceleration.py index 7359b5b..1634c95 100644 --- a/nvautoinstall/interfaces/install_video_acceleration.py +++ b/nvautoinstall/interfaces/install_video_acceleration.py @@ -47,6 +47,9 @@ def __init__(self): data = Objc_HandleDriversInstallation.avbl() if data is False: failure("No existing NVIDIA driver packages were detected") + general( + "Please try executing `nvautoinstall driver` with elevated privileges before this" # noqa + ) else: qant = 0 for indx in data: @@ -59,11 +62,21 @@ def __init__(self): success("Video acceleration were successfully installed") else: failure("Video acceleration could not be installed") + general( + "Please try executing `dnf update` with elevated privileges before this" # noqa + ) else: failure("Connection to RPM Fusion servers could not be established") + general( + "Please check the internet connection or firewall configuration and try again" # noqa + ) else: failure("RPM Fusion repository for Proprietary NVIDIA Driver was not detected") + general( + "Please try executing `nvautoinstall rpmadd` with elevated privileges before this" # noqa + ) else: failure("Superuser privilege could not be acquired") + general("Please try executing this command with elevated privileges") failure("Leaving installer") sys.exit(0) diff --git a/nvautoinstall/interfaces/install_vulkan_support.py b/nvautoinstall/interfaces/install_vulkan_support.py index 73f465d..28e2645 100644 --- a/nvautoinstall/interfaces/install_vulkan_support.py +++ b/nvautoinstall/interfaces/install_vulkan_support.py @@ -47,6 +47,9 @@ def __init__(self): data = Objc_HandleDriversInstallation.avbl() if data is False: failure("No existing NVIDIA driver packages were detected") + general( + "Please try executing `nvautoinstall driver` with elevated privileges before this" # noqa + ) else: qant = 0 for indx in data: @@ -59,11 +62,21 @@ def __init__(self): success("Vulkan renderer support were successfully installed") else: failure("Vulkan renderer support could not be installed") + general( + "Please try executing `dnf update` with elevated privileges before this" # noqa + ) else: failure("Connection to RPM Fusion servers could not be established") + general( + "Please check the internet connection or firewall configuration and try again" # noqa + ) else: failure("RPM Fusion repository for Proprietary NVIDIA Driver was not detected") + general( + "Please try executing `nvautoinstall rpmadd` with elevated privileges before this" # noqa + ) else: failure("Superuser privilege could not be acquired") + general("Please try executing this command with elevated privileges") failure("Leaving installer") sys.exit(0)