@@ -150,6 +150,15 @@ OS memory provider supports two types of memory mappings (set by the `visibility
150
150
IPC API requires the ` UMF_MEM_MAP_SHARED ` memory ` visibility ` mode
151
151
(` UMF_RESULT_ERROR_INVALID_ARGUMENT ` is returned otherwise).
152
152
153
+ IPC API uses the file descriptor duplication. It requires using ` pidfd_getfd(2) ` to obtain
154
+ a duplicate of another process's file descriptor (` pidfd_getfd(2) ` is supported since Linux 5.6).
155
+ Permission to duplicate another process's file descriptor is governed by a ptrace access mode
156
+ ` PTRACE_MODE_ATTACH_REALCREDS ` check (see ` ptrace(2) ` ) that can be changed using
157
+ the ` /proc/sys/kernel/yama/ptrace_scope ` interface in the following way:
158
+ ``` sh
159
+ $ sudo bash -c " echo 0 > /proc/sys/kernel/yama/ptrace_scope"
160
+ ```
161
+
153
162
There are available two mechanisms for the shared memory mapping:
154
163
1 ) a named shared memory object (used if the ` shm_name ` parameter is not NULL) or
155
164
2 ) an anonymous file descriptor (used if the ` shm_name ` parameter is NULL)
@@ -162,23 +171,37 @@ An anonymous file descriptor for the shared memory mapping will be created using
162
171
163
172
##### Requirements
164
173
165
- Required packages for tests (Linux-only yet):
174
+ IPC API on Linux requires the ` PTRACE_MODE_ATTACH_REALCREDS ` permission (see ` ptrace(2) ` )
175
+ to duplicate another process's file descriptor (see above).
176
+
177
+ Packages required for tests (Linux-only yet):
166
178
- libnuma-dev
167
179
168
180
#### Level Zero memory provider
169
181
170
182
A memory provider that provides memory from L0 device.
171
183
184
+ IPC API uses the file descriptor duplication. It requires using ` pidfd_getfd(2) ` to obtain
185
+ a duplicate of another process's file descriptor (` pidfd_getfd(2) ` is supported since Linux 5.6).
186
+ Permission to duplicate another process's file descriptor is governed by a ptrace access mode
187
+ ` PTRACE_MODE_ATTACH_REALCREDS ` check (see ` ptrace(2) ` ) that can be changed using
188
+ the ` /proc/sys/kernel/yama/ptrace_scope ` interface in the following way:
189
+ ``` sh
190
+ $ sudo bash -c " echo 0 > /proc/sys/kernel/yama/ptrace_scope"
191
+ ```
192
+
172
193
##### Requirements
173
194
174
195
1 ) Linux or Windows OS
175
196
2 ) The ` UMF_BUILD_LEVEL_ZERO_PROVIDER ` option turned ` ON ` (by default)
197
+ 3 ) IPC API on Linux requires the ` PTRACE_MODE_ATTACH_REALCREDS ` permission (see ` ptrace(2) ` )
198
+ to duplicate another process's file descriptor (see above).
176
199
177
200
Additionally, required for tests:
178
201
179
- 3 ) The ` UMF_BUILD_GPU_TESTS ` option turned ` ON `
180
- 4 ) System with Level Zero compatible GPU
181
- 5 ) Required packages:
202
+ 4 ) The ` UMF_BUILD_GPU_TESTS ` option turned ` ON `
203
+ 5 ) System with Level Zero compatible GPU
204
+ 6 ) Required packages:
182
205
- liblevel-zero-dev (Linux) or level-zero-sdk (Windows)
183
206
184
207
#### DevDax memory provider (Linux only)
0 commit comments