From 5f1661434aa23c1bfad72fd4c720740f61e1b70b Mon Sep 17 00:00:00 2001 From: themylogin Date: Thu, 12 Dec 2024 12:38:15 +0100 Subject: [PATCH] Run `ldconfig` after loading nvidia sysext (#15188) --- src/middlewared/middlewared/plugins/docker/update.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/middlewared/middlewared/plugins/docker/update.py b/src/middlewared/middlewared/plugins/docker/update.py index e27f1d1b4223d..6270f4c253981 100644 --- a/src/middlewared/middlewared/plugins/docker/update.py +++ b/src/middlewared/middlewared/plugins/docker/update.py @@ -89,7 +89,9 @@ async def do_update(self, job, data): # We want to clear upgrade alerts for apps at this point await self.middleware.call('app.clear_upgrade_alerts_for_all') - if address_pool_changed or apps_pool_changed: + nvidia_changed = old_config['nvidia'] != config['nvidia'] + + if address_pool_changed or apps_pool_changed or nvidia_changed: job.set_progress(20, 'Stopping Docker service') try: await self.middleware.call('service.stop', 'docker') @@ -112,6 +114,9 @@ async def do_update(self, job, data): await self.middleware.call('datastore.update', self._config.datastore, old_config['id'], config) + if nvidia_changed: + await self.middleware.call('docker.configure_nvidia') + if apps_pool_changed: job.set_progress(60, 'Applying requested configuration') await self.middleware.call('docker.setup.status_change') @@ -119,9 +124,6 @@ async def do_update(self, job, data): job.set_progress(60, 'Starting docker') await self.middleware.call('service.start', 'docker') - if old_config['nvidia'] != config['nvidia']: - await self.middleware.call('docker.configure_nvidia') - if config['pool'] and config['address_pools'] != old_config['address_pools']: job.set_progress(95, 'Initiating redeployment of applications to apply new address pools changes') await self.middleware.call( @@ -174,6 +176,7 @@ def configure_nvidia(self): if refresh: subprocess.run(['systemd-sysext', 'refresh'], capture_output=True, check=True, text=True) + subprocess.run(['ldconfig'], capture_output=True, check=True, text=True) if config['nvidia']: cp = subprocess.run(['modprobe', 'nvidia'], capture_output=True, text=True)