@@ -500,23 +500,27 @@ func (s *DeviceState) applyComputeDomainDaemonConfig(ctx context.Context, config
500500 }
501501 configState .containerEdits = configState .containerEdits .Append (edits )
502502
503- // Only prepare files to inject to the daemon if IMEX is supported.
503+ // Create new ComputeDomain daemon settings from the ComputeDomainManager.
504+ computeDomainDaemonSettings := s .computeDomainManager .NewSettings (config .DomainID )
505+
506+ // Prepare injecting IMEX daemon config files even if IMEX is not supported.
507+ // This for example creates
508+ // '/var/lib/kubelet/plugins/compute-domain.nvidia.com/domains/<uid>' on the
509+ // host which is used as mount source mapped to /etc/nvidia-imex in the CD
510+ // daemon container.
511+ if err := computeDomainDaemonSettings .Prepare (ctx ); err != nil {
512+ return nil , fmt .Errorf ("error preparing ComputeDomain daemon settings for requests '%v' in claim '%v': %w" , requests , claim .UID , err )
513+ }
514+
515+ // Only inject dev nodes related to
516+ // /proc/driver/nvidia/capabilities/fabric-imex-mgmt if IMEX is supported
517+ // (if we want to start the IMEX daemon process in the CD daemon pod).
504518 if s .computeDomainManager .cliqueID != "" {
505519 // Parse the device node info for the fabric-imex-mgmt nvcap.
506520 nvcapDeviceInfo , err := s .nvdevlib .parseNVCapDeviceInfo (nvidiaCapFabricImexMgmtPath )
507521 if err != nil {
508522 return nil , fmt .Errorf ("error parsing nvcap device info for fabric-imex-mgmt: %w" , err )
509523 }
510-
511- // Create new ComputeDomain daemon settings from the ComputeDomainManager.
512- computeDomainDaemonSettings := s .computeDomainManager .NewSettings (config .DomainID )
513-
514- // Prepare the new ComputeDomain daemon.
515- if err := computeDomainDaemonSettings .Prepare (ctx ); err != nil {
516- return nil , fmt .Errorf ("error preparing ComputeDomain daemon settings for requests '%v' in claim '%v': %w" , requests , claim .UID , err )
517- }
518-
519- // Store information about the ComputeDomain daemon in the configState.
520524 edits := computeDomainDaemonSettings .GetCDIContainerEditsForImex (ctx , s .cdi .devRoot , nvcapDeviceInfo )
521525 configState .containerEdits = configState .containerEdits .Append (edits )
522526 }
0 commit comments