Skip to content

Commit 1b672c9

Browse files
author
Ranjan Venkatesh
committed
Fix bug 5811173: update cufile tests and configuration
test_cufile.py: skip compat bool params in set_get_parameter_bool Avoid setting allow_compat_mode/force_compat_mode before driver_open; pending values can be applied on first open and interact badly with cufile.json when nvidia-fs is not loaded (DRIVER_NOT_INITIALIZED). Compat behavior remains covered elsewhere. cufile.json: Set allow_compat_mode to true
1 parent 613be11 commit 1b672c9

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

cuda_bindings/tests/cufile.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
// e.g : export CUFILE_ENV_PATH_JSON="/home/<xxx>/cufile.json"
44

55

6+
"properties" : {
7+
"allow_compat_mode" : true
8+
},
9+
610
"execution" : {
711
// max number of workitems in the queue;
812
"max_io_queue_depth": 128,

cuda_bindings/tests/test_cufile.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,6 +1412,14 @@ def test_param(param, val):
14121412
@pytest.mark.usefixtures("ctx")
14131413
def test_set_get_parameter_bool():
14141414
"""Test setting and getting boolean parameters with cuFile validation."""
1415+
# Do not exercise allow/force compat via set_parameter_bool before any driver_open:
1416+
# pending API values are applied after JSON load on first open and can overwrite
1417+
# cufile.json (e.g. allow_compat_mode: true), causing DRIVER_NOT_INITIALIZED when
1418+
# nvidia-fs is not loaded. Other tests cover compat behavior where appropriate.
1419+
_COMPAT_PARAMS = (
1420+
cufile.BoolConfigParameter.PROPERTIES_ALLOW_COMPAT_MODE,
1421+
cufile.BoolConfigParameter.FORCE_COMPAT_MODE,
1422+
)
14151423
param_val_pairs = (
14161424
(cufile.BoolConfigParameter.PROPERTIES_USE_POLL_MODE, True),
14171425
(cufile.BoolConfigParameter.PROPERTIES_ALLOW_COMPAT_MODE, False),
@@ -1426,6 +1434,7 @@ def test_set_get_parameter_bool():
14261434
(cufile.BoolConfigParameter.SKIP_TOPOLOGY_DETECTION, False),
14271435
(cufile.BoolConfigParameter.STREAM_MEMOPS_BYPASS, True),
14281436
)
1437+
param_val_pairs = tuple((p, v) for p, v in param_val_pairs if p not in _COMPAT_PARAMS)
14291438

14301439
def test_param(param, val):
14311440
orig_val = cufile.get_parameter_bool(param)

0 commit comments

Comments
 (0)