diff --git a/.github/workflows/ci-pixi-source-test.yml b/.github/workflows/ci-pixi-source-test.yml index e512f7c8ebd..74b800a8b8b 100644 --- a/.github/workflows/ci-pixi-source-test.yml +++ b/.github/workflows/ci-pixi-source-test.yml @@ -286,7 +286,8 @@ jobs: runs-on: "linux-amd64-gpu-l4-latest-1" # same label scheme as test-wheel-linux.yml timeout-minutes: 90 container: - options: -u root --security-opt seccomp=unconfined --shm-size 16g + # /run/udev: cuFile 12.x needs the udev database; see test-wheel-linux.yml. + options: -u root --security-opt seccomp=unconfined --shm-size 16g -v /run/udev:/run/udev:ro image: ubuntu:24.04 env: NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }} diff --git a/.github/workflows/test-wheel-linux.yml b/.github/workflows/test-wheel-linux.yml index 156827cc61c..2319b55456f 100644 --- a/.github/workflows/test-wheel-linux.yml +++ b/.github/workflows/test-wheel-linux.yml @@ -117,7 +117,10 @@ jobs: # Custom-DRIVER rows need --privileged --pid=host so install_gpu_driver.sh # can nsenter to the host for the install + refresh the toolkit bind mounts # back inside the container. Stock options for latest/earliest rows. - options: ${{ ((matrix.DRIVER == 'latest' || matrix.DRIVER == 'earliest') && '-u root --security-opt seccomp=unconfined --shm-size 16g') || '-u root --security-opt seccomp=unconfined --shm-size 16g --privileged --pid=host' }} + # /run/udev: cuFile 12.x (libcufile 1.14) looks up the block device behind + # a file in the udev database; without it, cuFileHandleRegister fails with + # CU_FILE_INTERNAL_ERROR on the workspace. + options: ${{ ((matrix.DRIVER == 'latest' || matrix.DRIVER == 'earliest') && '-u root --security-opt seccomp=unconfined --shm-size 16g -v /run/udev:/run/udev:ro') || '-u root --security-opt seccomp=unconfined --shm-size 16g -v /run/udev:/run/udev:ro --privileged --pid=host' }} image: ubuntu:24.04 env: NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }} diff --git a/cuda_bindings_12/tests/test_cufile.py b/cuda_bindings_12/tests/test_cufile.py index 6a6f0408770..9271fdabbcd 100644 --- a/cuda_bindings_12/tests/test_cufile.py +++ b/cuda_bindings_12/tests/test_cufile.py @@ -7,6 +7,7 @@ import os import pathlib import platform +import subprocess import tempfile from contextlib import suppress from functools import cache @@ -95,29 +96,13 @@ def cufileVersionLessThan(target): @cache def isSupportedFilesystem(): - """Check if the current filesystem is supported (ext4 or xfs).""" - try: - # Try to get filesystem type from /proc/mounts - with open("/proc/mounts") as f: - for line in f: - parts = line.split() - if len(parts) >= 2: - mount_point = parts[1] - fs_type = parts[2] - - # Check if current directory is under this mount point - current_dir = os.path.abspath(".") - if current_dir.startswith(mount_point): - fs_type_lower = fs_type.lower() - logging.info(f"Current filesystem type: {fs_type_lower}") - return fs_type_lower in ["ext4", "xfs"] - - # If we get here, we couldn't determine the filesystem type - logging.warning("Could not determine filesystem type from /proc/mounts") - return False - except Exception as e: - logging.error(f"Error checking filesystem type: {e}") - return False + """Check if the current filesystem is supported (ext4 or xfs). + + This uses `findmnt` so the kernel's mount table logic owns the decoding of the filesystem type. + """ + fs_type = subprocess.check_output(["findmnt", "-no", "FSTYPE", "-T", os.getcwd()], text=True).strip() # noqa: S603, S607 + logging.info(f"Current filesystem type (findmnt): {fs_type}") + return fs_type in ("ext4", "xfs") # These tests open/close the process-global driver inside their bodies, so