|
| 1 | +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Thomas Staudinger < [email protected]> |
| 3 | +Date: Fri, 23 May 2025 14:20:42 +0200 |
| 4 | +Subject: [PATCH] nvidia: Add support for open kernel modules |
| 5 | + |
| 6 | +Signed-off-by: Thomas Staudinger < [email protected]> |
| 7 | +--- |
| 8 | + crapshoot | 2 ++ |
| 9 | + doflicky/bundleset.py | 2 ++ |
| 10 | + doflicky/detection.py | 2 +- |
| 11 | + doflicky/driver/nvidia.py | 26 ++++++++++++++++++++++++-- |
| 12 | + 4 files changed, 29 insertions(+), 3 deletions(-) |
| 13 | + |
| 14 | +diff --git a/crapshoot b/crapshoot |
| 15 | +index 6ceacd5..e07a40d 100755 |
| 16 | +--- a/crapshoot |
| 17 | ++++ b/crapshoot |
| 18 | +@@ -12,6 +12,7 @@ |
| 19 | + |
| 20 | + from doflicky import OSContext |
| 21 | + from doflicky.driver.nvidia import DriverBundleNvidia |
| 22 | ++from doflicky.driver.nvidia import DriverBundleNvidiaOpen |
| 23 | + from doflicky.driver.broadcom import DriverBundleBroadcom |
| 24 | + import pisi |
| 25 | + from pisi.db.installdb import InstallDB |
| 26 | +@@ -29,6 +30,7 @@ class BundleSet: |
| 27 | + """ Initialise the potential driver bundle set """ |
| 28 | + self.drivers = [ |
| 29 | + DriverBundleNvidia(), |
| 30 | ++ DriverBundleNvidiaOpen(), |
| 31 | + DriverBundleBroadcom(), |
| 32 | + ] |
| 33 | + self.allDrivers = list() |
| 34 | +diff --git a/doflicky/bundleset.py b/doflicky/bundleset.py |
| 35 | +index e5ba39f..50c8261 100644 |
| 36 | +--- a/doflicky/bundleset.py |
| 37 | ++++ b/doflicky/bundleset.py |
| 38 | +@@ -12,6 +12,7 @@ |
| 39 | + |
| 40 | + from doflicky import OSContext |
| 41 | + from doflicky.driver.nvidia import DriverBundleNvidia |
| 42 | ++from doflicky.driver.nvidia import DriverBundleNvidiaOpen |
| 43 | + from doflicky.driver.broadcom import DriverBundleBroadcom |
| 44 | + from pisi.db.installdb import InstallDB |
| 45 | + |
| 46 | +@@ -29,6 +30,7 @@ class BundleSet: |
| 47 | + """ Initialise the potential driver bundle set """ |
| 48 | + self.drivers = [ |
| 49 | + DriverBundleNvidia(), |
| 50 | ++ DriverBundleNvidiaOpen(), |
| 51 | + DriverBundleBroadcom(), |
| 52 | + ] |
| 53 | + self.allDrivers = list() |
| 54 | +diff --git a/doflicky/detection.py b/doflicky/detection.py |
| 55 | +index 543b27f..12be53c 100644 |
| 56 | +--- a/doflicky/detection.py |
| 57 | ++++ b/doflicky/detection.py |
| 58 | +@@ -66,7 +66,7 @@ class DriverBundlePCI(DriverBundle): |
| 59 | + return False |
| 60 | + |
| 61 | + |
| 62 | +-nvidia_driver_priority = ['nvidia-glx-driver'] |
| 63 | ++nvidia_driver_priority = ['nvidia-open', 'nvidia-glx-driver'] |
| 64 | + |
| 65 | + |
| 66 | + def detect_hardware_packages(): |
| 67 | +diff --git a/doflicky/driver/nvidia.py b/doflicky/driver/nvidia.py |
| 68 | +index f5793e6..c061d6d 100644 |
| 69 | +--- a/doflicky/driver/nvidia.py |
| 70 | ++++ b/doflicky/driver/nvidia.py |
| 71 | +@@ -33,9 +33,31 @@ class DriverBundleNvidiaBase(DriverBundlePCI): |
| 72 | + """ For GPU drivers we'll suggest 32-bit when we find related pkgs """ |
| 73 | + return ["wine-32bit", "steam", "mesalib-32bit"] |
| 74 | + |
| 75 | ++class DriverBundleNvidiaOpen(DriverBundleNvidiaBase): |
| 76 | ++ """ Main NVIDIA driver, open kernel modules (nvidia-open) """ |
| 77 | ++ |
| 78 | ++ def __init__(self): |
| 79 | ++ DriverBundleNvidiaBase.__init__(self, "nvidia-open.modaliases") |
| 80 | ++ |
| 81 | ++ def get_name(self): |
| 82 | ++ return "NVIDIA Graphics Driver (main series, open kernel modules)" |
| 83 | ++ |
| 84 | ++ def get_priority(self): |
| 85 | ++ return 3 |
| 86 | ++ |
| 87 | ++ def get_packages(self, context, emul32=False): |
| 88 | ++ basePackages = ["nvidia-glx-driver-common"] |
| 89 | ++ if emul32: |
| 90 | ++ basePackages.append("nvidia-glx-driver-32bit") |
| 91 | ++ if context.get_active_kernel_series() == "current": |
| 92 | ++ basePackages.append("nvidia-open-current") |
| 93 | ++ else: |
| 94 | ++ basePackages.append("nvidia-open") |
| 95 | ++ return basePackages |
| 96 | ++ |
| 97 | + |
| 98 | + class DriverBundleNvidia(DriverBundleNvidiaBase): |
| 99 | +- """ Main NVIDIA driver (nvidia-glx-driver) """ |
| 100 | ++ """ Main NVIDIA driver, proprietary kernel modules (nvidia-glx-driver) """ |
| 101 | + |
| 102 | + def __init__(self): |
| 103 | + DriverBundleNvidiaBase.__init__(self, "nvidia-glx-driver.modaliases") |
| 104 | +@@ -44,7 +66,7 @@ class DriverBundleNvidia(DriverBundleNvidiaBase): |
| 105 | + return "NVIDIA Graphics Driver (main series)" |
| 106 | + |
| 107 | + def get_priority(self): |
| 108 | +- return 3 |
| 109 | ++ return 2 |
| 110 | + |
| 111 | + def get_packages(self, context, emul32=False): |
| 112 | + basePackages = ["nvidia-glx-driver-common"] |
0 commit comments