Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ if (NOT BUILD_PYTHON AND PYTHON_VERSIONS)
message(WARNING "The BUILD_PYTHON option is set to off and the PYTHON_VERSIONS variable is
provided. The latter will be ignored.")
elseif (BUILD_PYTHON AND "${PYTHON_VERSIONS}" STREQUAL "")
set(PYTHON_VERSIONS "3.9;3.10;3.11;3.12;3.13")
set(PYTHON_VERSIONS "3.9;3.10;3.11;3.12;3.13;3.13t")
endif ()

if (BUILD_PYTHON)
Expand Down
2 changes: 1 addition & 1 deletion dali/python/nvidia/dali/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def deprecation_warning(what):
"Please update your environment to use Python 3.9, "
"or newer."
)
# py3.13 warning
# py3.13 warning. Handles both 3.13 and 3.13t.
if sys.version_info[0] == 3 and sys.version_info[1] == 13:
deprecation_warning("Python 3.13 support is experimental and not officially tested.")

Expand Down
6 changes: 3 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ ENV PYVER=${PYVER} \
PYTHONPATH=/opt/python/v \
PYBIN=${PYTHONPATH}/bin \
PYLIB=${PYTHONPATH}/lib \
PATH=/opt/python/cp${PYV}-cp${PYV}/bin:/opt/python/cp39-cp39/bin:${PYBIN}:/opt/python/cp310-cp310/bin:/opt/python/cp311-cp311/bin:${PYBIN}:/opt/python/cp312-cp312/bin:/opt/python/cp313-cp313/bin:${PYBIN}:${PATH} \
LD_LIBRARY_PATH=/opt/python/cp${PYV}-cp${PYV}/lib:/usr/local/lib:/opt/dali/${DALI_BUILD_DIR}:/opt/python/cp39-cp39/lib:/opt/python/cp310-cp310/lib:/opt/python/cp311-cp311/lib:${PYLIB}:/opt/python/cp312-cp312/lib:/opt/python/cp313-cp313/lib:${PYLIB}:${LD_LIBRARY_PATH} \
LIBRARY_PATH=/opt/python/cp${PYV}-cp${PYV}/lib:/usr/local/lib:/opt/dali/${DALI_BUILD_DIR}:/opt/python/cp39-cp39/lib:/opt/python/cp310-cp310/lib:/opt/python/cp311-cp311/lib:${PYLIB}:/opt/python/cp312-cp312/lib:/opt/python/cp313-cp313/lib:${PYLIB}:${LIBRARY_PATH}
PATH=/opt/python/cp${PYV}-cp${PYV}/bin:/opt/python/cp39-cp39/bin:${PYBIN}:/opt/python/cp310-cp310/bin:/opt/python/cp311-cp311/bin:${PYBIN}:/opt/python/cp312-cp312/bin:/opt/python/cp313-cp313/bin:${PYBIN}:/opt/python/cp313-cp313t/bin:${PYBIN}:${PATH} \
LD_LIBRARY_PATH=/opt/python/cp${PYV}-cp${PYV}/lib:/usr/local/lib:/opt/dali/${DALI_BUILD_DIR}:/opt/python/cp39-cp39/lib:/opt/python/cp310-cp310/lib:/opt/python/cp311-cp311/lib:${PYLIB}:/opt/python/cp312-cp312/lib:/opt/python/cp313-cp313t/lib:${PYLIB}:/opt/python/cp313t-cp313t/lib:${PYLIB}:${LD_LIBRARY_PATH} \
LIBRARY_PATH=/opt/python/cp${PYV}-cp${PYV}/lib:/usr/local/lib:/opt/dali/${DALI_BUILD_DIR}:/opt/python/cp39-cp39/lib:/opt/python/cp310-cp310/lib:/opt/python/cp311-cp311/lib:${PYLIB}:/opt/python/cp312-cp312/lib:/opt/python/cp313-cp313t/lib:${PYLIB}:/opt/python/cp313t-cp313t/lib:${PYLIB}:${LIBRARY_PATH}

RUN ln -s /opt/python/cp${PYV}* /opt/python/v

Expand Down
3 changes: 2 additions & 1 deletion docker/Dockerfile.build.aarch64-linux
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/
python3.10 python3.10-dev \
python3.11 python3.11-dev \
python3.12 python3.12-dev \
python3.13 python3.13-dev && \
python3.13 python3.13-dev python3.13-nogil && \
apt-key adv --fetch-key http://repo.download.nvidia.com/jetson/jetson-ota-public.asc && \
add-apt-repository 'deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/cross-linux-aarch64/ /' && \
apt-get update && \
Expand Down Expand Up @@ -97,6 +97,7 @@ RUN /bin/bash -c 'DALI_DEPS_VERSION_SHA=${DALI_DEPS_VERSION_SHA:-$(cat /tmp/DALI
/tmp/dali_deps/build_scripts/build_deps.sh && rm -rf /tmp/dali_deps && rm -rf /tmp/DALI_DEPS_VERSION'

# hack - install cross headers in the default python paths, so host python3-config would point to them
# free-threaded sources are included in 3.13.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Headers are indeed shared between 3.13.x and 3.13.xt but pyconfig.h is generated at build-time and differs. Can this be an issue here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L105 should generate these configs. But I would give it a go and check how it works.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L105 will generate a pyconfig.h for 3.13 with GIL enabled, in which Py_GIL_DISABLED is set to 0. Extension modules built for free-threaded Python will see headers with this variable set to 0 but link with libpython.so built with it set to 1.

Copy link
Contributor

@JanuszL JanuszL May 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So both python3.13t-config and python3.13-config will use the same config?

link with libpython.so built with it set to 1.

it just links to libpython.so and it will run fine as long as the one you have in the system where you deploy libpython.so that matches the configuration flag used during the compilation

RUN export PYVERS="3.8.5 3.9.0 3.10.0 3.11.0 3.12.0 3.13.0" && \
for PYVER in ${PYVERS}; do \
cd /tmp && (curl -L https://www.python.org/ftp/python/${PYVER}/Python-${PYVER}.tgz | tar -xzf - || exit 1) && \
Expand Down
3 changes: 3 additions & 0 deletions docker/build_helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ export BUNDLE_PATH_PREFIX=${BUNDLE_PATH_PREFIX}
export TEST_BUNDLED_LIBS=${TEST_BUNDLED_LIBS:-YES}
export PYTHON_VERSIONS=${PYTHON_VERSIONS}
# use all available pythons
if [[ "$PYTHON_VERSIONS" == *"t"* ]]; then
export PYTHON_GIL=0
fi

cmake ../ -DCMAKE_INSTALL_PREFIX=. \
-DARCH=${ARCH} \
Expand Down
Loading