Skip to content

Commit

Permalink
Run ldconfig after loading nvidia sysext (#15190)
Browse files Browse the repository at this point in the history
(cherry picked from commit 797bed1)

Co-authored-by: themylogin <[email protected]>
  • Loading branch information
bugclerk and themylogin authored Dec 12, 2024
1 parent 4d5e20b commit 3903fed
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/middlewared/middlewared/plugins/docker/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,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 pool_changed or address_pools_changed:
nvidia_changed = old_config['nvidia'] != config['nvidia']

if pool_changed or address_pools_changed or nvidia_changed:
job.set_progress(20, 'Stopping Docker service')
try:
await self.middleware.call('service.stop', 'docker')
Expand All @@ -102,6 +104,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 pool_changed:
job.set_progress(60, 'Applying requested configuration')
await self.middleware.call('docker.setup.status_change')
Expand All @@ -113,9 +118,6 @@ async def do_update(self, job, data):

await self.middleware.call('service.start', 'docker')

if old_config['nvidia'] != config['nvidia']:
await self.middleware.call('docker.configure_nvidia')

if config['pool'] and address_pools_changed:
job.set_progress(95, 'Initiating redeployment of applications to apply new address pools changes')
await self.middleware.call(
Expand Down Expand Up @@ -163,6 +165,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)
Expand Down

0 comments on commit 3903fed

Please sign in to comment.