﻿# UCX memory-type detection is not a GPUDirect path certificate

Separate GPU module availability, explicit transport filtering and memory-type-cache behavior when UCX treats a device pointer as host memory.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/ucx-memory-type-cache-staleness/
Language: en

## A device pointer reaches a CPU access path

A UCX integration fails when a GPU buffer is passed through an otherwise working network connection. The pointer's numeric value does not tell ordinary application code which memory operations are safe. UCX needs the relevant memory-type support and correct identification before selecting a transfer protocol. Distinguish failure to recognize GPU memory from failure to register it or use a direct network path after recognition.

## Establish the prerequisite modules

The [OpenUCX FAQ](https://openucx.readthedocs.io/en/master/faq.html) identifies missing GPU build support, failed CUDA or ROCm module loading and library path or version problems as possible causes of misclassification and invalid access. It also states that an explicit transport restriction must retain the relevant GPU memory transports. A reliable-connected network selection alone is not sufficient. Record the effective worker environment and library dependencies rather than treating GPU support in another administrator shell as proof for the failing process.

## Inspect the cache as one hypothesis

The FAQ separately notes that the internal memory-type cache can misidentify GPU memory as host memory and documents a way to disable it for diagnosis. That observation does not establish that every invalid access is a cache defect. Compare the same application allocation path under a controlled configuration after confirming module support. Disabling a cache can change overhead and detection behavior; it is not proof that the original mapping or remote registration became valid.

## Linking changes the hook boundary

The [HPC-X UCX guide](https://networking-docs.nvidia.com/hpcxum/225/unified-communication-x-framework-library) documents that CUDA memory hooks may not work with statically built CUDA applications and gives a scoped workaround involving the relevant caches. Preserve how the actual application and communication stack are linked, not only the executable's model name. A dynamically linked diagnostic can work while a differently linked production binary misses lifecycle information. Do not generalize the workaround into a universal requirement to disable every cache for every GPU workload.

## Qualification follows the whole allocation path

Use an isolated fixture with the same allocation method, library loading and linking arrangement as the affected integration. Test host and GPU buffers distinctly, then repeated allocation and release if lifecycle behavior is implicated. Preserve detected memory type, selected protocol, completion status and transferred content. A correct payload verifies more than successful initialization, but even it does not independently establish a zero-copy path. Direct-path claims need their own supported protocol and device evidence rather than an inferred absence of errors.

## Keep the two cache questions separate

A memory-type cache answers what kind of memory an address represents; a registration cache manages mappings and their lifetime. The [registration guide](/journal/guide-net-rdma-memory-registration/) explains the latter resource boundary, while [transport evidence](/journal/guide-perf-nccl-transport/) separates installed support from actual path selection. Report which prerequisite or detection stage failed and what controlled change resolved it. If the evidence only establishes that a cache-disabled configuration succeeds, retain that limited finding rather than naming an unobserved invalidation bug as the proven root cause.
