validateAdditionalDriverComponents validates additional driver components such as gdrcopy, gds, nvidia-peermem(rdma) if they are enabled.
(ctx context.Context, statusFilePath string)
| 840 | // validateAdditionalDriverComponents validates additional driver components such as |
| 841 | // gdrcopy, gds, nvidia-peermem(rdma) if they are enabled. |
| 842 | func validateAdditionalDriverComponents(ctx context.Context, statusFilePath string) error { |
| 843 | data, err := os.ReadFile(statusFilePath) |
| 844 | if err != nil { |
| 845 | return err |
| 846 | } |
| 847 | |
| 848 | supportedFeatures := map[string]string{ |
| 849 | "GDRCOPY_ENABLED": GDRCOPY, |
| 850 | "GDS_ENABLED": NVIDIAFS, |
| 851 | "GPU_DIRECT_RDMA_ENABLED": NVIDIAPEERMEM, |
| 852 | } |
| 853 | |
| 854 | features := map[string]bool{} |
| 855 | if err := yaml.Unmarshal(data, &features); err != nil { |
| 856 | return err |
| 857 | } |
| 858 | |
| 859 | for k, enabled := range features { |
| 860 | if !enabled { |
| 861 | log.Debugf("%s is disabled, skipping...", k) |
| 862 | continue |
| 863 | } |
| 864 | |
| 865 | component, ok := supportedFeatures[k] |
| 866 | if !ok { |
| 867 | log.Infof("unsupported feature flag: %s, skipping...", k) |
| 868 | continue |
| 869 | } |
| 870 | |
| 871 | log.Infof("Validating additional driver component: %s", component) |
| 872 | if err := validateComponent(ctx, component); err != nil { |
| 873 | return err |
| 874 | } |
| 875 | } |
| 876 | |
| 877 | return nil |
| 878 | } |
| 879 | |
| 880 | func (d *Driver) validate() error { |
| 881 | // delete driver status file if already present |