Skip to content

Commit

Permalink
Merge pull request #103 from t0xic0der/qol-rpmfusion-repo
Browse files Browse the repository at this point in the history
Add error correction messages
  • Loading branch information
gridhead authored May 12, 2022
2 parents 7064595 + aa1da0b commit 91b87ec
Show file tree
Hide file tree
Showing 10 changed files with 129 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nvautoinstall/interfaces/handle_compatibility_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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...")
Expand Down
13 changes: 13 additions & 0 deletions nvautoinstall/interfaces/handle_drivers_installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
18 changes: 18 additions & 0 deletions nvautoinstall/interfaces/handle_prime_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
14 changes: 14 additions & 0 deletions nvautoinstall/interfaces/handle_rpmfusion_repositories.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
Objc_CheckSuperuserPermissions,
Objc_HandleRPMFusionRepositories,
failure,
general,
section,
success,
warning,
Expand All @@ -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")
Expand All @@ -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)
22 changes: 22 additions & 0 deletions nvautoinstall/interfaces/install_cuda_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
1 change: 1 addition & 0 deletions nvautoinstall/interfaces/install_everything.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
13 changes: 13 additions & 0 deletions nvautoinstall/interfaces/install_ffmpeg_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
20 changes: 20 additions & 0 deletions nvautoinstall/interfaces/install_nvidia_repositories.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
Objc_CheckSuperuserPermissions,
Objc_HandleCudaInstallation,
failure,
general,
section,
success,
warning,
Expand All @@ -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")
Expand All @@ -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)
13 changes: 13 additions & 0 deletions nvautoinstall/interfaces/install_video_acceleration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
13 changes: 13 additions & 0 deletions nvautoinstall/interfaces/install_vulkan_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)

0 comments on commit 91b87ec

Please sign in to comment.