From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <d.csapak@proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 6A716A015E
 for <pve-devel@lists.proxmox.com>; Mon, 12 Jun 2023 12:00:56 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 53187217BE
 for <pve-devel@lists.proxmox.com>; Mon, 12 Jun 2023 12:00:56 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [94.136.29.106])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS
 for <pve-devel@lists.proxmox.com>; Mon, 12 Jun 2023 12:00:54 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 634AD43B20
 for <pve-devel@lists.proxmox.com>; Mon, 12 Jun 2023 12:00:54 +0200 (CEST)
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Date: Mon, 12 Jun 2023 12:00:53 +0200
Message-Id: <20230612100053.1944194-1-d.csapak@proxmox.com>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.015 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DMARC_MISSING             0.1 Missing DMARC policy
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
 T_SCC_BODY_TEXT_LINE    -0.01 -
Subject: [pve-devel] [PATCH manager stable-7] pve7to8: add check for
 nvidia-vgpu-mgr
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Mon, 12 Jun 2023 10:00:56 -0000

Currently the nvidia vgpu host driver (15.2) does not support kernels >
6.0 and thus will not work with bookworm based releases for now.

Fail when the service is running, and warn if it only exists, but is
disabled/stopped (in case a user installed it sometime but did not need
it and disabled it).

In any case, link to the known issues section in the upgrade guide
(which we can update to contain up-to-date information).

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
I opted to not parse more specific information about the driver (like
version, etc.) since it increases the complexity of the check but
without any real upside currently. If there is some future version that
supports it, we can update that to only warn/error for not supported
versions.

I'll add the section to the upgrade guide shortly

 PVE/CLI/pve7to8.pm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/PVE/CLI/pve7to8.pm b/PVE/CLI/pve7to8.pm
index 6b51e98e..dbcb87ff 100644
--- a/PVE/CLI/pve7to8.pm
+++ b/PVE/CLI/pve7to8.pm
@@ -1215,6 +1215,27 @@ sub check_apt_repos {
     }
 }
 
+sub check_nvidia_vgpu_service {
+    log_info("Checking for existance of NVIDIA vGPU Manager..");
+
+    my $state = $get_systemd_unit_state->("nvidia-vgpu-mgr.service");
+    if ($state && $state eq 'active') {
+	log_fail(
+	    "Running NVIDIA vGPU Service found, possibly not compatible with newer kernel versions,"
+	    ." check with their documentation and"
+	    ." https://pve.proxmox.com/wiki/Upgrade_from_7_to_8#Known_upgrade_issues."
+	);
+    } elsif ($state && $state ne 'unknown') {
+	log_warn(
+	    "NVIDIA vGPU Service found, possibly not compatible with newer kernel versions,"
+	    ." check with their documentation and"
+	    ." https://pve.proxmox.com/wiki/Upgrade_from_7_to_8#Known_upgrade_issues."
+	);
+    } else {
+	log_pass("No NVIDIA vGPU Service found.");
+    }
+}
+
 sub check_time_sync {
     my $unit_active = sub { return $get_systemd_unit_state->($_[0], 1) eq 'active' ? $_[0] : undef };
 
@@ -1337,6 +1358,7 @@ sub check_misc {
     check_lxcfs_fuse_version();
     check_node_and_guest_configurations();
     check_apt_repos();
+    check_nvidia_vgpu_service();
 }
 
 my sub colored_if {
-- 
2.30.2