Skip to content

Commit

Permalink
Reorder and reenable UCX_MEMTYPE_CACHE=n for all UCX versions
Browse files Browse the repository at this point in the history
UCX_MEMTYPE_CACHE=n is still required even for UCX 1.12 (see
openucx/ucx#7575), so we reenable it.
Reordering the import is also required to prevent UCS warnings when
Cython code is imported.
  • Loading branch information
pentschev committed Nov 4, 2021
1 parent 0e42ee0 commit 8713950
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions ucp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,21 @@
import logging
import os

from ._version import get_versions as _get_versions
from .core import * # noqa
from .core import get_ucx_version
from .utils import get_address, get_ucxpy_logger # noqa

logger = logging.getLogger("ucx")

# Notice, if we have to update environment variables
# we need to do it before importing UCX
if "UCX_MEMTYPE_CACHE" not in os.environ and get_ucx_version() < (1, 12, 0):
# Notice, if we have to update environment variables we need to do it
# before importing UCX, which must happen also before the Cython code
# import to prevent UCS unused variable warnings.
if "UCX_MEMTYPE_CACHE" not in os.environ:
# See <https://github.com/openucx/ucx/wiki/NVIDIA-GPU-Support#known-issues>
logger.debug("Setting env UCX_MEMTYPE_CACHE=n, which is required by UCX")
os.environ["UCX_MEMTYPE_CACHE"] = "n"

from ._version import get_versions as _get_versions # noqa
from .core import * # noqa
from .core import get_ucx_version # noqa
from .utils import get_address, get_ucxpy_logger # noqa

if "UCX_SOCKADDR_TLS_PRIORITY" not in os.environ and get_ucx_version() < (1, 11, 0):
logger.debug(
"Setting env UCX_SOCKADDR_TLS_PRIORITY=sockcm, "
Expand Down

0 comments on commit 8713950

Please sign in to comment.