gpustack-runtime 0.1.39.post3__py3-none-any.whl → 0.1.40.post1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. gpustack_runtime/__main__.py +7 -3
  2. gpustack_runtime/_version.py +2 -2
  3. gpustack_runtime/_version_appendix.py +1 -1
  4. gpustack_runtime/cmds/__init__.py +4 -0
  5. gpustack_runtime/cmds/deployer.py +84 -2
  6. gpustack_runtime/cmds/images.py +2 -0
  7. gpustack_runtime/deployer/__init__.py +2 -0
  8. gpustack_runtime/deployer/__types__.py +52 -28
  9. gpustack_runtime/deployer/__utils__.py +99 -112
  10. gpustack_runtime/deployer/cdi/__init__.py +81 -0
  11. gpustack_runtime/deployer/cdi/__types__.py +667 -0
  12. gpustack_runtime/deployer/cdi/thead.py +103 -0
  13. gpustack_runtime/deployer/docker.py +36 -22
  14. gpustack_runtime/deployer/kuberentes.py +8 -4
  15. gpustack_runtime/deployer/podman.py +35 -21
  16. gpustack_runtime/detector/__init__.py +62 -3
  17. gpustack_runtime/detector/__types__.py +11 -0
  18. gpustack_runtime/detector/iluvatar.py +10 -3
  19. gpustack_runtime/detector/nvidia.py +186 -97
  20. gpustack_runtime/detector/pyacl/__init__.py +9 -1
  21. gpustack_runtime/detector/pyamdgpu/__init__.py +8 -0
  22. gpustack_runtime/detector/pycuda/__init__.py +9 -1
  23. gpustack_runtime/detector/pydcmi/__init__.py +9 -2
  24. gpustack_runtime/detector/pyhgml/__init__.py +5879 -0
  25. gpustack_runtime/detector/pyhgml/libhgml.so +0 -0
  26. gpustack_runtime/detector/pyhgml/libuki.so +0 -0
  27. gpustack_runtime/detector/pyhsa/__init__.py +9 -0
  28. gpustack_runtime/detector/pyixml/__init__.py +89 -164
  29. gpustack_runtime/detector/pyrocmcore/__init__.py +42 -24
  30. gpustack_runtime/detector/pyrocmsmi/__init__.py +138 -129
  31. gpustack_runtime/detector/thead.py +733 -0
  32. gpustack_runtime/envs.py +127 -54
  33. {gpustack_runtime-0.1.39.post3.dist-info → gpustack_runtime-0.1.40.post1.dist-info}/METADATA +3 -2
  34. gpustack_runtime-0.1.40.post1.dist-info/RECORD +55 -0
  35. gpustack_runtime-0.1.39.post3.dist-info/RECORD +0 -48
  36. {gpustack_runtime-0.1.39.post3.dist-info → gpustack_runtime-0.1.40.post1.dist-info}/WHEEL +0 -0
  37. {gpustack_runtime-0.1.39.post3.dist-info → gpustack_runtime-0.1.40.post1.dist-info}/entry_points.txt +0 -0
  38. {gpustack_runtime-0.1.39.post3.dist-info → gpustack_runtime-0.1.40.post1.dist-info}/licenses/LICENSE +0 -0
@@ -11,6 +11,50 @@ import threading
11
11
  from ctypes import *
12
12
  from functools import wraps
13
13
  from pathlib import Path
14
+ from typing import ClassVar
15
+
16
+ # Example ROCM_SMI_LIB_PATH
17
+ # - /opt/hyhal/lib
18
+ # - /opt/rocm/rocm_smi/lib
19
+ # Example ROCM_PATH/ROCM_HOME
20
+ # - /opt/dtk-24.04.3
21
+ # - /opt/dtk
22
+ # - /opt/rocm
23
+ rocmsmi_lib_path = os.getenv("ROCM_SMI_LIB_PATH")
24
+ if not rocmsmi_lib_path:
25
+ rocm_path = Path(os.getenv("ROCM_HOME", os.getenv("ROCM_PATH") or "/opt/rocm"))
26
+ rocmsmi_lib_path = str(rocm_path / "lib")
27
+ if not Path(rocmsmi_lib_path).exists():
28
+ rocmsmi_lib_path = str(rocm_path / "rocm_smi" / "lib")
29
+ else:
30
+ rocm_path = Path(
31
+ os.getenv(
32
+ "ROCM_HOME",
33
+ os.getenv("ROCM_PATH") or str(Path(rocmsmi_lib_path).parent.parent),
34
+ )
35
+ )
36
+
37
+ rocmsmi_lib_loc = Path(rocmsmi_lib_path) / "librocm_smi64.so"
38
+ if rocmsmi_lib_loc.exists():
39
+ rocmsmi_bindings_paths = [
40
+ (rocm_path / "rocm_smi" / "bindings"),
41
+ (rocm_path / "libexec" / "rocm_smi"),
42
+ ]
43
+ rocmsmi_bindings_path = None
44
+ for p in rocmsmi_bindings_paths:
45
+ if p.exists():
46
+ rocmsmi_bindings_path = p
47
+ break
48
+
49
+ # Refer to https://github.com/ROCm/rocm_smi_lib/blob/amd-staging_deprecated/python_smi_tools/rsmiBindings.py.
50
+ # Add bindings path to sys.path for importing rsmiBindings
51
+ if rocmsmi_bindings_path and rocmsmi_bindings_path.exists():
52
+ if str(rocmsmi_bindings_path) not in sys.path:
53
+ sys.path.append(str(rocmsmi_bindings_path))
54
+ try:
55
+ from rsmiBindings import *
56
+ except ImportError:
57
+ pass
14
58
 
15
59
  ## Enums ##
16
60
  ROCMSMI_IOLINK_TYPE_UNDEFINED = 0
@@ -20,66 +64,42 @@ ROCMSMI_IOLINK_TYPE_NUMIOLINKTYPES = 3
20
64
 
21
65
  ## Error Codes ##
22
66
  ROCMSMI_ERROR_UNINITIALIZED = -99997
67
+ ROCMSMI_ERROR_FUNCTION_NOT_FOUND = -99998
23
68
 
24
69
  ## Lib loading ##
25
70
  rocmsmiLib = None
26
71
  libLoadLock = threading.Lock()
27
72
 
28
- if rocmsmiLib is None:
29
- # Example ROCM_SMI_LIB_PATH
30
- # - /opt/hyhal/lib
31
- # - /opt/rocm/rocm_smi/lib
32
- # Example ROCM_PATH/ROCM_HOME
33
- # - /opt/dtk-24.04.3
34
- # - /opt/dtk
35
- # - /opt/rocm
36
- rocmsmi_lib_path = os.getenv("ROCM_SMI_LIB_PATH")
37
- if not rocmsmi_lib_path:
38
- rocm_path = Path(os.getenv("ROCM_HOME", os.getenv("ROCM_PATH") or "/opt/rocm"))
39
- rocmsmi_lib_path = str(rocm_path / "lib")
40
- if not Path(rocmsmi_lib_path).exists():
41
- rocmsmi_lib_path = str(rocm_path / "rocm_smi" / "lib")
42
- else:
43
- rocm_path = Path(
44
- os.getenv(
45
- "ROCM_HOME",
46
- os.getenv("ROCM_PATH") or str(Path(rocmsmi_lib_path).parent.parent),
47
- )
48
- )
49
-
50
- rocmsmi_lib_loc = Path(rocmsmi_lib_path) / "librocm_smi64.so"
51
- if rocmsmi_lib_loc.exists():
52
- rocmsmi_bindings_paths = [
53
- (rocm_path / "rocm_smi" / "bindings"),
54
- (rocm_path / "libexec" / "rocm_smi"),
55
- ]
56
- rocmsmi_bindings_path = None
57
- for p in rocmsmi_bindings_paths:
58
- if p.exists():
59
- rocmsmi_bindings_path = p
60
- break
61
73
 
62
- if rocmsmi_bindings_path and rocmsmi_bindings_path.exists():
63
- if str(rocmsmi_bindings_path) not in sys.path:
64
- sys.path.append(str(rocmsmi_bindings_path))
65
-
66
- libLoadLock.acquire()
67
-
68
- try:
69
- # Refer to https://github.com/ROCm/rocm_smi_lib/blob/amd-staging_deprecated/python_smi_tools/rsmiBindings.py.
70
- from rsmiBindings import *
71
-
72
- if not rocmsmiLib:
73
- rocmsmiLib = CDLL(rocmsmi_lib_loc)
74
- except OSError:
75
- pass
76
- finally:
77
- libLoadLock.release()
74
+ def _LoadRocmSmiLibrary():
75
+ """
76
+ Load the library if it isn't loaded already.
77
+ """
78
+ global rocmsmiLib
79
+
80
+ if rocmsmiLib is None:
81
+ # lock to ensure only one caller loads the library
82
+ libLoadLock.acquire()
83
+ try:
84
+ # ensure the library still isn't loaded
85
+ if (
86
+ rocmsmiLib is None
87
+ and not sys.platform.startswith("win")
88
+ and rocmsmi_lib_loc.is_file()
89
+ ):
90
+ try:
91
+ rocmsmiLib = CDLL(str(rocmsmi_lib_loc))
92
+ except OSError:
93
+ pass
94
+ finally:
95
+ # lock is always released
96
+ libLoadLock.release()
78
97
 
79
98
 
80
99
  class ROCMSMIError(Exception):
81
100
  _extend_errcode_to_string: ClassVar[dict[int, str]] = {
82
101
  ROCMSMI_ERROR_UNINITIALIZED: "Library Not Initialized",
102
+ ROCMSMI_ERROR_FUNCTION_NOT_FOUND: "Function Not Found in Library",
83
103
  }
84
104
 
85
105
  def __init__(self, value):
@@ -99,6 +119,31 @@ def _rocmsmiCheckReturn(ret):
99
119
  return ret
100
120
 
101
121
 
122
+ ## Function access ##
123
+ _rocmsmiGetFunctionPointer_cache = {} # function pointers are cached to prevent unnecessary libLoadLock locking
124
+
125
+
126
+ def _rocmsmiGetFunctionPointer(name):
127
+ global rocmsmiLib
128
+
129
+ if name in _rocmsmiGetFunctionPointer_cache:
130
+ return _rocmsmiGetFunctionPointer_cache[name]
131
+
132
+ libLoadLock.acquire()
133
+ try:
134
+ # ensure library was loaded
135
+ if rocmsmiLib is None:
136
+ raise ROCMSMIError(ROCMSMI_ERROR_UNINITIALIZED)
137
+ try:
138
+ _rocmsmiGetFunctionPointer_cache[name] = getattr(rocmsmiLib, name)
139
+ return _rocmsmiGetFunctionPointer_cache[name]
140
+ except AttributeError:
141
+ raise ROCMSMIError(ROCMSMI_ERROR_FUNCTION_NOT_FOUND)
142
+ finally:
143
+ # lock is always freed
144
+ libLoadLock.release()
145
+
146
+
102
147
  ## string/bytes conversion for ease of use
103
148
  def convertStrBytes(func):
104
149
  @wraps(func)
@@ -120,108 +165,90 @@ def convertStrBytes(func):
120
165
 
121
166
  ## C function wrappers ##
122
167
  def rsmi_init(flags=0):
123
- if not rocmsmiLib:
124
- raise ROCMSMIError(ROCMSMI_ERROR_UNINITIALIZED)
168
+ _LoadRocmSmiLibrary()
125
169
 
126
- ret = rocmsmiLib.rsmi_init(flags)
170
+ fn = _rocmsmiGetFunctionPointer("rsmi_init")
171
+ ret = fn(flags)
127
172
  _rocmsmiCheckReturn(ret)
128
173
 
129
174
 
130
175
  @convertStrBytes
131
176
  def rsmi_driver_version_get():
132
- if not rocmsmiLib:
133
- raise ROCMSMIError(ROCMSMI_ERROR_UNINITIALIZED)
134
-
135
177
  component = rsmi_sw_component_t.RSMI_SW_COMP_DRIVER
136
178
  c_version = create_string_buffer(256)
137
- ret = rocmsmiLib.rsmi_version_str_get(component, c_version, 256)
179
+ fn = _rocmsmiGetFunctionPointer("rsmi_version_str_get")
180
+ ret = fn(component, c_version, 256)
138
181
  _rocmsmiCheckReturn(ret)
139
182
  return c_version.value
140
183
 
141
184
 
142
185
  def rsmi_num_monitor_devices():
143
- if not rocmsmiLib:
144
- raise ROCMSMIError(ROCMSMI_ERROR_UNINITIALIZED)
145
-
146
186
  c_num_devices = c_uint32()
147
- ret = rocmsmiLib.rsmi_num_monitor_devices(byref(c_num_devices))
187
+ fn = _rocmsmiGetFunctionPointer("rsmi_num_monitor_devices")
188
+ ret = fn(byref(c_num_devices))
148
189
  _rocmsmiCheckReturn(ret)
149
190
  return c_num_devices.value
150
191
 
151
192
 
152
193
  @convertStrBytes
153
194
  def rsmi_dev_name_get(device=0):
154
- if not rocmsmiLib:
155
- raise ROCMSMIError(ROCMSMI_ERROR_UNINITIALIZED)
156
-
157
195
  c_name = create_string_buffer(256)
158
- ret = rocmsmiLib.rsmi_dev_name_get(device, c_name, 256)
196
+ fn = _rocmsmiGetFunctionPointer("rsmi_dev_name_get")
197
+ ret = fn(device, c_name, 256)
159
198
  _rocmsmiCheckReturn(ret)
160
199
  return c_name.value
161
200
 
162
201
 
163
202
  @convertStrBytes
164
203
  def rsmi_dev_serial_number_get(device=0):
165
- if not rocmsmiLib:
166
- raise ROCMSMIError(ROCMSMI_ERROR_UNINITIALIZED)
167
-
168
204
  c_serial = create_string_buffer(256)
169
- ret = rocmsmiLib.rsmi_dev_serial_number_get(device, c_serial, 256)
205
+ fn = _rocmsmiGetFunctionPointer("rsmi_dev_serial_number_get")
206
+ ret = fn(device, c_serial, 256)
170
207
  _rocmsmiCheckReturn(ret)
171
208
  return c_serial.value
172
209
 
173
210
 
174
211
  def rsmi_dev_unique_id_get(device=0):
175
- if not rocmsmiLib:
176
- raise ROCMSMIError(ROCMSMI_ERROR_UNINITIALIZED)
177
-
178
212
  c_uid = c_uint64()
179
- ret = rocmsmiLib.rsmi_dev_unique_id_get(device, byref(c_uid))
213
+ fn = _rocmsmiGetFunctionPointer("rsmi_dev_unique_id_get")
214
+ ret = fn(device, byref(c_uid))
180
215
  _rocmsmiCheckReturn(ret)
181
216
  return hex(c_uid.value)
182
217
 
183
218
 
184
219
  def rsmi_dev_busy_percent_get(device=0):
185
- if not rocmsmiLib:
186
- raise ROCMSMIError(ROCMSMI_ERROR_UNINITIALIZED)
187
-
188
220
  c_percent = c_uint32()
189
- ret = rocmsmiLib.rsmi_dev_busy_percent_get(device, byref(c_percent))
221
+ fn = _rocmsmiGetFunctionPointer("rsmi_dev_busy_percent_get")
222
+ ret = fn(device, byref(c_percent))
190
223
  _rocmsmiCheckReturn(ret)
191
224
  return c_percent.value
192
225
 
193
226
 
194
227
  def rsmi_dev_memory_usage_get(device=0, memory_type=None):
195
- if not rocmsmiLib:
196
- raise ROCMSMIError(ROCMSMI_ERROR_UNINITIALIZED)
197
-
198
228
  if memory_type is None:
199
229
  memory_type = rsmi_memory_type_t.RSMI_MEM_TYPE_VRAM
200
230
  c_used = c_uint64()
201
- ret = rocmsmiLib.rsmi_dev_memory_usage_get(device, memory_type, byref(c_used))
231
+ fn = _rocmsmiGetFunctionPointer("rsmi_dev_memory_usage_get")
232
+ ret = fn(device, memory_type, byref(c_used))
202
233
  _rocmsmiCheckReturn(ret)
203
234
  return c_used.value
204
235
 
205
236
 
206
237
  def rsmi_dev_memory_total_get(device=0, memory_type=None):
207
- if not rocmsmiLib:
208
- raise ROCMSMIError(ROCMSMI_ERROR_UNINITIALIZED)
209
-
210
238
  if memory_type is None:
211
239
  memory_type = rsmi_memory_type_t.RSMI_MEM_TYPE_VRAM
212
240
  c_total = c_uint64()
213
- ret = rocmsmiLib.rsmi_dev_memory_total_get(device, memory_type, byref(c_total))
241
+ fn = _rocmsmiGetFunctionPointer("rsmi_dev_memory_total_get")
242
+ ret = fn(device, memory_type, byref(c_total))
214
243
  _rocmsmiCheckReturn(ret)
215
244
  return c_total.value
216
245
 
217
246
 
218
247
  def rsmi_dev_target_graphics_version_get(device=0):
219
- if not rocmsmiLib:
220
- raise ROCMSMIError(ROCMSMI_ERROR_UNINITIALIZED)
221
-
222
248
  try:
223
249
  c_version = c_uint64()
224
- ret = rocmsmiLib.rsmi_dev_target_graphics_version_get(device, byref(c_version))
250
+ fn = _rocmsmiGetFunctionPointer("rsmi_dev_target_graphics_version_get")
251
+ ret = fn(device, byref(c_version))
225
252
  _rocmsmiCheckReturn(ret)
226
253
  if c_version.value < 2000:
227
254
  return "gfx" + str(c_version.value)
@@ -231,15 +258,15 @@ def rsmi_dev_target_graphics_version_get(device=0):
231
258
 
232
259
 
233
260
  def rsmi_dev_temp_metric_get(device=0, sensor=None, metric=None):
234
- if not rocmsmiLib:
235
- raise ROCMSMIError(ROCMSMI_ERROR_UNINITIALIZED)
236
-
237
261
  if metric is None:
238
262
  metric = rsmi_temperature_metric_t.RSMI_TEMP_CURRENT
239
263
 
264
+ fn = _rocmsmiGetFunctionPointer("rsmi_dev_temp_metric_get")
265
+
240
266
  if sensor is not None:
241
267
  c_temp = c_int64(0)
242
- ret = rocmsmiLib.rsmi_dev_temp_metric_get(
268
+
269
+ ret = fn(
243
270
  c_uint32(device),
244
271
  sensor,
245
272
  metric,
@@ -252,7 +279,7 @@ def rsmi_dev_temp_metric_get(device=0, sensor=None, metric=None):
252
279
  # try all sensors and return the first valid temperature.
253
280
  for sensor_i in range(7):
254
281
  c_temp = c_int64(0)
255
- ret = rocmsmiLib.rsmi_dev_temp_metric_get(
282
+ ret = fn(
256
283
  c_uint32(device),
257
284
  sensor_i,
258
285
  metric,
@@ -265,34 +292,28 @@ def rsmi_dev_temp_metric_get(device=0, sensor=None, metric=None):
265
292
 
266
293
 
267
294
  def rsmi_dev_power_cap_get(device=0):
268
- if not rocmsmiLib:
269
- raise ROCMSMIError(ROCMSMI_ERROR_UNINITIALIZED)
270
-
271
295
  c_power_cap = c_uint64(0)
272
- ret = rocmsmiLib.rsmi_dev_power_cap_get(device, 0, byref(c_power_cap))
296
+ fn = _rocmsmiGetFunctionPointer("rsmi_dev_power_cap_get")
297
+ ret = fn(device, 0, byref(c_power_cap))
273
298
  _rocmsmiCheckReturn(ret)
274
299
  return c_power_cap.value // 1000000
275
300
 
276
301
 
277
302
  def rsmi_dev_power_ave_get(device=0):
278
- if not rocmsmiLib:
279
- raise ROCMSMIError(ROCMSMI_ERROR_UNINITIALIZED)
280
-
281
303
  c_device_chip = c_uint32(0)
282
304
  c_power = c_uint64(0)
283
- ret = rocmsmiLib.rsmi_dev_power_ave_get(device, c_device_chip, byref(c_power))
305
+ fn = _rocmsmiGetFunctionPointer("rsmi_dev_power_ave_get")
306
+ ret = fn(device, c_device_chip, byref(c_power))
284
307
  _rocmsmiCheckReturn(ret)
285
308
  return c_power.value // 1000000
286
309
 
287
310
 
288
311
  def rsmi_dev_power_get(device=0):
289
- if not rocmsmiLib:
290
- raise ROCMSMIError(ROCMSMI_ERROR_UNINITIALIZED)
291
-
292
312
  try:
293
313
  c_power = c_uint64(0)
294
314
  c_power_type = rsmi_power_type_t()
295
- ret = rocmsmiLib.rsmi_dev_power_get(device, byref(c_power), byref(c_power_type))
315
+ fn = _rocmsmiGetFunctionPointer("rsmi_dev_power_get")
316
+ ret = fn(device, byref(c_power), byref(c_power_type))
296
317
  _rocmsmiCheckReturn(ret)
297
318
  return c_power.value // 1000000
298
319
  except NameError:
@@ -301,21 +322,17 @@ def rsmi_dev_power_get(device=0):
301
322
 
302
323
 
303
324
  def rsmi_dev_node_id_get(device=0):
304
- if not rocmsmiLib:
305
- raise ROCMSMIError(ROCMSMI_ERROR_UNINITIALIZED)
306
-
307
325
  c_node_id = c_uint32()
308
- ret = rocmsmiLib.rsmi_dev_node_id_get(device, byref(c_node_id))
326
+ fn = _rocmsmiGetFunctionPointer("rsmi_dev_node_id_get")
327
+ ret = fn(device, byref(c_node_id))
309
328
  _rocmsmiCheckReturn(ret)
310
329
  return c_node_id.value
311
330
 
312
331
 
313
332
  def rsmi_dev_pci_id_get(device=0):
314
- if not rocmsmiLib:
315
- raise ROCMSMIError(ROCMSMI_ERROR_UNINITIALIZED)
316
-
333
+ fn = _rocmsmiGetFunctionPointer("rsmi_dev_pci_id_get")
317
334
  c_pci_id = c_uint64()
318
- ret = rocmsmiLib.rsmi_dev_pci_id_get(device, byref(c_pci_id))
335
+ ret = fn(device, byref(c_pci_id))
319
336
  _rocmsmiCheckReturn(ret)
320
337
 
321
338
  return str_bdfid(c_pci_id.value)
@@ -333,22 +350,18 @@ def str_bdfid(bdfid: int) -> str:
333
350
 
334
351
 
335
352
  def rsmi_topo_get_numa_node_number(device=0):
336
- if not rocmsmiLib:
337
- raise ROCMSMIError(ROCMSMI_ERROR_UNINITIALIZED)
338
-
339
353
  c_numa_node = c_uint32()
340
- ret = rocmsmiLib.rsmi_topo_get_numa_node_number(device, byref(c_numa_node))
354
+ fn = _rocmsmiGetFunctionPointer("rsmi_topo_get_numa_node_number")
355
+ ret = fn(device, byref(c_numa_node))
341
356
  _rocmsmiCheckReturn(ret)
342
357
  return c_numa_node.value
343
358
 
344
359
 
345
360
  def rsmi_topo_get_link_type(device_a=0, device_b=0):
346
- if not rocmsmiLib:
347
- raise ROCMSMIError(ROCMSMI_ERROR_UNINITIALIZED)
348
-
349
361
  c_hops = c_uint64()
350
362
  c_type = c_uint32()
351
- ret = rocmsmiLib.rsmi_topo_get_link_type(
363
+ fn = _rocmsmiGetFunctionPointer("rsmi_topo_get_link_type")
364
+ ret = fn(
352
365
  device_a,
353
366
  device_b,
354
367
  byref(c_hops),
@@ -359,11 +372,9 @@ def rsmi_topo_get_link_type(device_a=0, device_b=0):
359
372
 
360
373
 
361
374
  def rsmi_topo_get_link_weight(device_a=0, device_b=0):
362
- if not rocmsmiLib:
363
- raise ROCMSMIError(ROCMSMI_ERROR_UNINITIALIZED)
364
-
365
375
  c_weight = c_uint64()
366
- ret = rocmsmiLib.rsmi_topo_get_link_weight(
376
+ fn = _rocmsmiGetFunctionPointer("rsmi_topo_get_link_weight")
377
+ ret = fn(
367
378
  device_a,
368
379
  device_b,
369
380
  byref(c_weight),
@@ -373,11 +384,9 @@ def rsmi_topo_get_link_weight(device_a=0, device_b=0):
373
384
 
374
385
 
375
386
  def rsmi_is_p2p_accessible(device_a=0, device_b=0):
376
- if not rocmsmiLib:
377
- raise ROCMSMIError(ROCMSMI_ERROR_UNINITIALIZED)
378
-
379
387
  c_accessible = c_bool()
380
- ret = rocmsmiLib.rsmi_is_P2P_accessible(
388
+ fn = _rocmsmiGetFunctionPointer("rsmi_is_P2P_accessible")
389
+ ret = fn(
381
390
  device_a,
382
391
  device_b,
383
392
  byref(c_accessible),