Skip to content
This repository was archived by the owner on Jul 23, 2025. It is now read-only.

Commit 0f31375

Browse files
authored
Merge pull request #81 from t0xic0der/poetry-restructuring
Restructuring with Poetry + Modularity + Bug fixes
2 parents 84727b4 + 5c6ac6f commit 0f31375

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1936
-964
lines changed

README.md

Lines changed: 386 additions & 46 deletions
Large diffs are not rendered by default.

SCREENSHOTS.md

Lines changed: 0 additions & 41 deletions
This file was deleted.

nvautoinstall.spec

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
%global srcname nvidia-auto-installer-for-fedora
1+
%global srcname nvidia-auto-installer-for-fedora-linux
22

33
Name: nvautoinstall
4-
Version: 0.3.9
5-
Release: 1%{?dist}
6-
Summary: NVIDIA Auto Installer for Fedora
4+
Version: 0.4.0
5+
Release: 0%{?dist}
6+
Summary: NVIDIA Auto Installer for Fedora Linux
77

8-
License: GPLv3
8+
License: GPLv3+
99
Url: https://github.com/t0xic0der/%{srcname}
1010
Source0: https://github.com/t0xic0der/%{srcname}/releases/download/v%{version}/%{name}-%{version}.tar.gz
1111

@@ -16,7 +16,7 @@ BuildRequires: python3-devel
1616
Requires: dnf-plugins-core
1717

1818
%description
19-
A CLI tool which lets you install proprietary NVIDIA drivers and much more
19+
A CLI tool which lets you install proprietary NVIDIA drivers and much more easily on Fedora Linux (32 or above, ELN or Rawhide)
2020

2121
%prep
2222
%autosetup
@@ -38,6 +38,17 @@ A CLI tool which lets you install proprietary NVIDIA drivers and much more
3838

3939
%changelog
4040

41+
* Thu Dec 16 2021 Akashdeep Dhar <[email protected]> - 0.4.0-0
42+
- v0.4.0
43+
- Restructured the project to make the codebase more modular
44+
- Performed repository clean up and removal of static files
45+
- Reworked the dependency management with the use of Poetry
46+
- Deprecated COPR build updates for Mageia, EPEL and OpenSUSE
47+
- Reimplimented CLI compositing to make use of commands over options
48+
- Removed dedicated installation of x86 NVIDIA libraries due to inclusion
49+
- Fixed RPM Fusion Non-free repo detection by force installation
50+
- Updated official CUDA repositories to point to Fedora 34 or later
51+
4152
* Thu Aug 12 2021 Akashdeep Dhar <[email protected]> - 0.3.9-1
4253
- v0.3.9
4354
- Reworked RPM specfile with pyproject directives

nvautoinstall/__init__.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"""
2+
NVIDIA Auto Installer for Fedora Linux
3+
Copyright (C) 2019-2021 Akashdeep Dhar
4+
5+
This program is free software: you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation, either version 3 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
You should have received a copy of the GNU General Public License
16+
along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
"""
18+
19+
20+
from .interfaces.check_superuser_permissions import CheckSuperuserPermissions
21+
from .interfaces.handle_compatibility_check import HandleCompatibilityCheck
22+
from .interfaces.handle_drivers_installation import HandleDriverInstallation
23+
from .interfaces.handle_prime_support import HandlePrimeSupport
24+
from .interfaces.handle_rpmfusion_repositories import \
25+
HandleRPMFusionRepositories
26+
from .interfaces.install_cuda_support import InstallCudaSupport
27+
from .interfaces.install_everything import InstallEverything
28+
from .interfaces.install_ffmpeg_support import InstallFfmpegSupport
29+
from .interfaces.install_nvidia_repositories import InstallNvidiaRepositories
30+
from .interfaces.install_video_acceleration import InstallVideoAcceleration
31+
from .interfaces.install_vulkan_support import InstallVulkanSupport
32+
33+
__version__ = "0.4.0"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
"""
2+
NVIDIA Auto Installer for Fedora Linux
3+
Copyright (C) 2019-2021 Akashdeep Dhar
4+
5+
This program is free software: you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation, either version 3 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
You should have received a copy of the GNU General Public License
16+
along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
"""
18+
19+
20+
from .status import failure, general, section, success, warning

nvautoinstall/decoration/status.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
"""
2+
NVIDIA Auto Installer for Fedora Linux
3+
Copyright (C) 2019-2021 Akashdeep Dhar
4+
5+
This program is free software: you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation, either version 3 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
You should have received a copy of the GNU General Public License
16+
along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
"""
18+
19+
20+
from click import echo, style
21+
22+
PASS = style("[ \u2713 ]", fg="green", bold=True)
23+
FAIL = style("[ \u2717 ]", fg="red", bold=True)
24+
WARN = style("[ ! ]", fg="yellow", bold=True)
25+
HEAD = style("[ \u2605 ]", fg="magenta", bold=True)
26+
STDS = " "
27+
28+
29+
def success(message):
30+
echo(PASS + " " + message)
31+
32+
33+
def failure(message):
34+
echo(FAIL + " " + message)
35+
36+
37+
def warning(message):
38+
echo(WARN + " " + message)
39+
40+
41+
def section(message):
42+
echo(HEAD + " " + style(message, fg="magenta", bold=True))
43+
44+
45+
def general(message):
46+
echo(STDS + " " + message)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
"""
2+
NVIDIA Auto Installer for Fedora Linux
3+
Copyright (C) 2019-2021 Akashdeep Dhar
4+
5+
This program is free software: you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation, either version 3 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
You should have received a copy of the GNU General Public License
16+
along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
"""
18+
19+
20+
from ..decoration import failure, general, section, success, warning
21+
from ..operations import (CheckSuperuserPermissions, HandleCompatibilityCheck,
22+
HandleCudaInstallation, HandleDriversInstallation,
23+
HandlePrimeSupport, HandleRPMFusionRepositories,
24+
InstallFfmpegSupport, InstallVideoAcceleration,
25+
InstallVulkanSupport)
26+
27+
Objc_CheckSuperuserPermissions = CheckSuperuserPermissions()
28+
Objc_HandlePrimeSupport = HandlePrimeSupport()
29+
Objc_HandleCompatibilityCheck = HandleCompatibilityCheck()
30+
Objc_HandleCudaInstallation = HandleCudaInstallation()
31+
Objc_HandleRPMFusionRepositories = HandleRPMFusionRepositories()
32+
Objc_InstallFfmpegSupport = InstallFfmpegSupport()
33+
Objc_HandleDriversInstallation = HandleDriversInstallation()
34+
Objc_InstallVideoAcceleration = InstallVideoAcceleration()
35+
Objc_InstallVulkanSupport = InstallVulkanSupport()
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
"""
2+
NVIDIA Auto Installer for Fedora Linux
3+
Copyright (C) 2019-2021 Akashdeep Dhar
4+
5+
This program is free software: you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation, either version 3 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
You should have received a copy of the GNU General Public License
16+
along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
"""
18+
19+
20+
import sys
21+
22+
from . import (Objc_CheckSuperuserPermissions, failure, general, section,
23+
success)
24+
25+
26+
class CheckSuperuserPermissions:
27+
def __init__(self):
28+
section("CHECKING SUPERUSER PERMISSIONS...")
29+
if Objc_CheckSuperuserPermissions.main():
30+
success("Superuser permission is available")
31+
general("This tool is expected to work correctly here")
32+
else:
33+
failure("Superuser permission is not available")
34+
general("This tool cannot be used here")
35+
failure("Leaving installer")
36+
sys.exit(0)
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
"""
2+
NVIDIA Auto Installer for Fedora Linux
3+
Copyright (C) 2019-2021 Akashdeep Dhar
4+
5+
This program is free software: you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation, either version 3 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
You should have received a copy of the GNU General Public License
16+
along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
"""
18+
19+
20+
import sys
21+
22+
from . import (Objc_HandleCompatibilityCheck, failure, general, section,
23+
success, warning)
24+
25+
26+
class HandleCompatibilityCheck:
27+
def __init__(self):
28+
section("CHECKING FOR GPU COMPATIBILITY...")
29+
data = Objc_HandleCompatibilityCheck.gpuc()
30+
warning("Compatibility infomation was obtained")
31+
if data is False:
32+
failure("No supported NVIDIA GPU was detected")
33+
else:
34+
success("One or more active NVIDIA GPUs were detected")
35+
supprt = data["supprt"]
36+
gpulst = data["gpulst"]
37+
for indx in gpulst:
38+
if indx != "":
39+
general(indx)
40+
if supprt == "single":
41+
success("An single dedicated GPU setup was detected")
42+
else:
43+
success("An Optimus Dual GPU setup was detected")
44+
section("GATHERING CURRENT HOST INFORMATION...")
45+
data = Objc_HandleCompatibilityCheck.main()
46+
warning("Host information was gathered")
47+
for indx in data.keys():
48+
general(indx + ": " + data[indx])
49+
section("CHECKING FOR HOST COMPATIBILITY...")
50+
data = Objc_HandleCompatibilityCheck.avbl()
51+
if data is False:
52+
failure("Unsupported OS detected")
53+
general("This tool cannot be used here")
54+
else:
55+
if data == "full":
56+
success("Supported OS detected")
57+
general("This tool is expected to work correctly here")
58+
elif data == "half":
59+
warning("Minimally supported OS detected")
60+
general("Discretion is advised while using this tool")
61+
failure("Leaving installer")
62+
sys.exit(0)
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
"""
2+
NVIDIA Auto Installer for Fedora Linux
3+
Copyright (C) 2019-2021 Akashdeep Dhar
4+
5+
This program is free software: you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation, either version 3 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
You should have received a copy of the GNU General Public License
16+
along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
"""
18+
19+
20+
import sys
21+
22+
from . import (Objc_CheckSuperuserPermissions, Objc_HandleDriversInstallation,
23+
Objc_HandleRPMFusionRepositories, failure, general, section,
24+
success, warning)
25+
26+
27+
class HandleDriverInstallation:
28+
def __init__(self):
29+
section("CHECKING SUPERUSER PERMISSIONS...")
30+
if Objc_CheckSuperuserPermissions.main():
31+
success("Superuser privilege acquired")
32+
section("CHECKING AVAILABILITY OF RPM FUSION NVIDIA REPOSITORY...")
33+
if Objc_HandleRPMFusionRepositories.avbl():
34+
warning(
35+
"RPM Fusion repository for Proprietary NVIDIA Driver was detected"
36+
)
37+
section("ATTEMPTING CONNECTION TO RPM FUSION SERVERS...")
38+
if Objc_HandleRPMFusionRepositories.conn():
39+
success("Connection to RPM Fusion servers was established")
40+
section("LOOKING FOR EXISTING DRIVER PACKAGES...")
41+
data = Objc_HandleDriversInstallation.avbl()
42+
if data is False:
43+
warning("No existing NVIDIA driver packages were detected")
44+
section("INSTALLING PROPRIETARY DRIVERS...")
45+
else:
46+
qant = 0
47+
for indx in data:
48+
if indx != "":
49+
qant += 1
50+
general(indx)
51+
warning(
52+
"A total of " + str(qant) + " driver packages were detected"
53+
)
54+
section("REINSTALLING PROPRIETARY DRIVERS...")
55+
if Objc_HandleDriversInstallation.main():
56+
success("Driver package installation completed")
57+
else:
58+
failure("Proprietary drivers could not be installed")
59+
else:
60+
failure("Connection to RPM Fusion servers could not be established")
61+
else:
62+
failure(
63+
"RPM Fusion repository for Proprietary NVIDIA Driver was not detected"
64+
)
65+
else:
66+
failure("Superuser privilege could not be acquired")
67+
failure("Leaving installer")
68+
sys.exit(0)

0 commit comments

Comments
 (0)