Skip to content

Commit 2935f8f

Browse files
authored
Merge pull request #155 from ykulazhenkov/host-ofed
Add support for host OFED to peer-mem POD
2 parents 50c2717 + 4a55f2b commit 2935f8f

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

manifests/stage-nv-peer-mem-driver/0010_nv-peer-mem-driver-ds.yaml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,11 @@ spec:
7878
- name: NO_PROXY
7979
value: {{ .RuntimeSpec.NoProxy }}
8080
volumeMounts:
81-
- name: run-mlnx-ofed
82-
mountPath: /run/mellanox/drivers
81+
- name: mlnx-ofed-usr-src
82+
mountPath: /run/mellanox/drivers/usr/src
83+
mountPropagation: HostToContainer
84+
- name: mlnx-ofed-lib-modules
85+
mountPath: /run/mellanox/drivers/lib/modules
8386
mountPropagation: HostToContainer
8487
- name: run-nvidia
8588
mountPath: /run/nvidia/drivers
@@ -108,9 +111,16 @@ spec:
108111
initialDelaySeconds: 10
109112
failureThreshold: 1
110113
volumes:
111-
- name: run-mlnx-ofed
114+
{{ $ofedPath := "/run/mellanox/drivers" }}
115+
{{ if .RuntimeSpec.UseHostOFED }}
116+
{{ $ofedPath = "" }}
117+
{{end}}
118+
- name: mlnx-ofed-usr-src
119+
hostPath:
120+
path: {{ $ofedPath }}/usr/src
121+
- name: mlnx-ofed-lib-modules
112122
hostPath:
113-
path: /run/mellanox/drivers
123+
path: {{ $ofedPath }}/lib/modules
114124
- name: run-nvidia
115125
hostPath:
116126
path: {{ .CrSpec.GPUDriverSourcePath }}

pkg/state/state_nv_peer.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,13 @@ type stateNVPeer struct {
4747

4848
type nvPeerRuntimeSpec struct {
4949
runtimeSpec
50-
CPUArch string
51-
OSName string
52-
OSVer string
53-
HTTPProxy string
54-
HTTPSProxy string
55-
NoProxy string
50+
CPUArch string
51+
OSName string
52+
OSVer string
53+
HTTPProxy string
54+
HTTPSProxy string
55+
NoProxy string
56+
UseHostOFED bool
5657
}
5758

5859
type nvPeerManifestRenderData struct {
@@ -146,6 +147,7 @@ func (s *stateNVPeer) getManifestObjects(
146147
HTTPProxy: os.Getenv(consts.HTTPProxy),
147148
HTTPSProxy: os.Getenv(consts.HTTPSProxy),
148149
NoProxy: os.Getenv(consts.NoProxy),
150+
UseHostOFED: cr.Spec.OFEDDriver == nil,
149151
},
150152
}
151153
// render objects

0 commit comments

Comments
 (0)