rocSHMEM environment variables

rocSHMEM environment variables#

This section describes the important environment variables used to control the behavior of rocSHMEM.

Environment variable

Default

Value

ROCSHMEM_DEBUG_LEVEL

Debug output level

ERROR

Levels (from least to most verbose):

  • NONE: Suppress all output.

  • ERROR: Print error messages only (default).

  • WARN: Print warnings and errors.

  • ENV: Print modified environment variables at startup.

  • VERSION: Print build/version information at startup.

  • INFO: Print informational messages and above.

  • API: Print API call tracing (requires BUILD_DEBUG_TRACE_HOST/BUILD_DEBUG_TRACE_DEVICE).

  • TRACE: Print all messages including internal traces (requires BUILD_DEBUG_TRACE_HOST/BUILD_DEBUG_TRACE_DEVICE).

Modifiers can be appended with : to suppress specific categories:

  • :noerror, :nowarn, :noenv, :noversion, :noinfo, :noapi, :notrace

  • :full or :all after env or :env modifier controls env print detail.

  • :color (default) or :nocolor enables/disables ANSI color output.

Examples: trace:noversion, env:full, api:noenv, trace:nocolor

ROCSHMEM_HEAP_ALLOCATOR_TYPE

Selects the GPU memory allocator used for the symmetric heap.

arch-dependent

  • uncached: GPU memory in uncached mode (default on most architectures).

  • finegrained: Fine-grained coherent GPU memory (default on gfx1100, gfx1201).

  • coarsegrained: Coarse-grained coherent GPU memory.

  • vmm_posix: VMM with POSIX fd-based IPC (requires ROCm 7.2+, Linux 5.6+, TCP bootstrap).

  • vmm_fabric: VMM with fabric handle IPC (requires ROCm 7.14+, gfx1250/MI455 only). Values are case-insensitive.

ROCSHMEM_HEAP_SIZE

Defines the size of the rocSHMEM symmetric heap in bytes (per PE).

1073741824 (1 GB)

Size in bytes (per PE). Note: the heap is on GPU memory.

ROCSHMEM_MAX_NUM_HOST_CONTEXTS

Maximum number of host-side communication contexts

1

Maximum number of host-side contexts.

ROCSHMEM_MAX_NUM_CONTEXTS

Defines the number of contexts an application can use.

32

Maximum number of contexts.

ROCSHMEM_MAX_NUM_TEAMS

Defines the number of teams an application can use.

40

Maximum number of teams.

ROCSHMEM_BACKEND

When rocSHMEM is compiled for all backends, this environment variable selects which backend to execute. The default value is an empty string and rocSHMEM auto-selects the most appropriate backend.

`` ``

  • ipc: IPC Backend

  • ro: Reverse Offload Backend

  • gda: GPU Direct Async Backend

ROCSHMEM_UNIQUEID_WITH_MPI

Defines whether rocSHMEM is expected to use MPI internally when using the uniqueId based initialization.

0

  • 0: Do not use MPI.

  • 1: Use MPI.

ROCSHMEM_DISABLE_MIXED_IPC

Defines whether to force using the network backend even when IPC is available.

0

  • 0: Use IPC when available.

  • 1: Force network backend.

ROCSHMEM_DISABLE_IPC

Deprecated synonym for ROCSHMEM_DISABLE_MIXED_IPC. Prefer the latter in new configurations.

0

  • 0: Use IPC when available.

  • 1: Force network backend.

ROCSHMEM_HOST_TRANSPORT

Selects the transport backing the host-initiated API (requires rocSHMEM built with -DUSE_HOST_VERBS=ON). The default (empty) keeps the MPI-window host path.

`` ``

  • `` `` (default): Use the MPI-window host path.

  • verbs: Use the native host-verbs stack.

ROCSHMEM_USE_IB_HCA

Forces the NIC that this PE uses. When this value is set NIC auto-detection and mapping is disabled, the NIC specified in the variable will be selected. Also used to select the NIC for the host-verbs transport (ROCSHMEM_HOST_TRANSPORT=verbs). The default value is an empty string and rocSHMEM auto-detects the most appropriate NIC.

`` ``

Example value: bnxt_re0

ROCSHMEM_HCA_LIST

Comma separated list of NIC names that can be used by rocSHMEM. Unlike ROCSHMEM_USE_IB_HCA, when this variable is set, NIC auto-detection and mapping still executes, but NICs that are not in the list are discarded before auto-detection runs. Prefixing the list with ^ turns the list in an exclude list, NICs that are in the list are discarded before auto-detection runs. The default value is an empty string and rocSHMEM auto-detects the most appropriate NIC.

`` ``

Example value: bnxt_re1,bnxt_re11, ^mlx5_0,mlx5_3

ROCSHMEM_BOOTSTRAP_SOCKET_IFNAME

Chooses the interface to bootstrap rocSHMEM with. Only valid when not using MPI. The default value is an empty string and rocSHMEM auto-detects the most appropriate interface.

`` ``

Example value: eno8303

ROCSHMEM_GDA_PROVIDER

When rocSHMEM is compiled with support for multiple NIC vendors, the environment variable selects the desired provider. The default value is an empty string and rocSHMEM auto-detects the most appropriate NIC.

`` ``

  • bnxt: Broadcom Thor 2

  • pensando: AMD Pensando Pollara

  • ionic: AMD Pensando Pollara (alias)

  • mlx5: Mellanox ConnectX-7

ROCSHMEM_GDA_ALTERNATE_QP_PORTS

Enables or disables alternating QP mappings across rocSHMEM contexts.

1

  • 0: Disabled.

  • 1: Enabled. This helps saturate bandwidth on multiport bonded interfaces.

ROCSHMEM_GDA_TRAFFIC_CLASS

When using an NIC with an Ethernet link layer, this sets the traffic class for the QPs.

0

The traffic class number.

ROCSHMEM_GDA_PCIE_RELAXED_ORDERING

Enables PCIe Relaxed Ordering when registering the symmetric heap with the RDMA NICs.

0

  • 0: Disabled.

  • 1: Enabled.

ROCSHMEM_GDA_ENABLE_DMABUF

Enable dmabuf support for memory registration.

0

  • 0: Disabled.

  • 1: Enabled.

ROCSHMEM_GDA_ALLTOALLV_WG_ALGO

Selects between two algorithms to use for GDA based alltoallv. The GET algorithm uses an initial round of alltoallv communication to distribute displacements then a second round to get transfer data. This algorithm has a higher latency but has better performance for large messages. The COPY algorithm does an alltoallv communication pattern into a staging buffer then does a copy into the destination buffers. This reduces latency but requires more memory, this algorithm only works for small messages.

GET

  • GET: GET-based alltoallv algorithm

  • COPY: Copy alltoallv algorithm

ROCSHMEM_GDA_OVERRIDE_NIC_FIRMWARE_CHECK

This environment variable should be used with caution. It overrides the NIC firmware check if a user wants to use an unsupported NIC firmware. If the firmware check is disabled rocSHMEM is not guaranteed to work.

0

  • 0: Disabled.

  • 1: Enabled.

ROCSHMEM_GDA_SQ_SIZE

This environment variable sets the length of the Send Queue (SQ) for GDA.

1024

Maximum number of Work Queue Entries (WQEs) posted on the Send Queue (SQ)

ROCSHMEM_GDA_NUM_QPS_PER_PE_DEFAULT_CTX

Sets the number of Queue Pairs (QPs) to create per PE for the default context.

1

Number of QPs per PE for the default context.

ROCSHMEM_GDA_NUM_QPS_PER_PE_USR_CTX

Sets the number of Queue Pairs (QPs) to create per PE for each user context.

1

Number of QPs per PE for each user context.

ROCSHMEM_GDA_MAX_NUM_USER_BUFFERS

GDA supports rocshmem_buffer_register and rocshmem_buffer_unregister for user buffers. This variable sets the number of user buffers an application may register when using the GDA backend. If the application uses more user buffers than what is defined with this variable, then the behavior is undefined.

4

Maximum number of user buffer registrations for GDA

ROCSHMEM_GDA_MERGE_NICS

Enables automatic topology-based NIC fusion, so a single PE can drive several NICs that are close to it in the PCIe topology (multi-NIC).

0

  • 0: Disabled.

  • 1: Enabled.

ROCSHMEM_GDA_NET_MERGE_LEVEL

Maximum PCIe path type considered when auto-merging NICs. NICs reachable only through a longer path than this are not merged. Only meaningful when ROCSHMEM_GDA_MERGE_NICS is enabled.

PIX

  • PIX: Same PCIe switch (default).

  • PXB: Multiple PCIe switches.

  • PHB: Same PCIe host bridge.

  • SYS: Anywhere in the system.

ROCSHMEM_GDA_NET_FORCE_MERGE

Force-merges specific NICs by name, bypassing topology detection. NIC names within a rank group are comma-separated; rank groups are semicolon-separated.

`` ``

Example value: mlx5_0,mlx5_1;mlx5_2,mlx5_3

ROCSHMEM_GDA_NIC_POLICY

Controls how Queue Pairs (QPs) are bound to NICs when more than one NIC is in use.

ROUND_ROBIN

  • ROUND_ROBIN: QPs within a context are spread across NICs.

  • PER_CONTEXT: All QPs in a context use one NIC; use multiple contexts to drive multiple NICs.

ROCSHMEM_MAX_SYMM_REGIONS

rocSHMEM supports rocshmem_buffer_register_symmetric and rocshmem_buffer_unregister_symmetric for symmetric user buffers. This variable sets the maximum number of symmetric user buffers an application may register concurrently. It is backend-agnostic and is currently honored by the IPC backend.

4

Maximum number of symmetric user buffer registrations

ROCSHMEM_MAX_WF_BUFFERS

Maximum number of wavefront buffer arrays in default context (determines size of status, return, and atomic return buffers)

1024

ROCSHMEM_BOOTSTRAP_TIMEOUT

Bootstrap initialization timeout in seconds

5

ROCSHMEM_BOOTSTRAP_HOSTID

Override host identifier for bootstrap. Empty string uses hostname.

`` ``

ROCSHMEM_BOOTSTRAP_SOCKET_FAMILY

Socket family for bootstrap.

AF_UNSPEC

  • AF_UNSPEC: Let the runtime choose (default).

  • AF_INET: Force IPv4.

  • AF_INET6: Force IPv6.

ROCSHMEM_RO_DISABLE_IPC

Deprecated synonym for ROCSHMEM_DISABLE_MIXED_IPC, scoped to the reverse-offload (RO) backend.

0

  • 0: Use IPC when available.

  • 1: Force network backend.

ROCSHMEM_RO_PROGRESS_DELAY

Delay of the RO backend’s host-side progress engine, in microseconds. A larger delay reduces load on the memory subsystem at the cost of latency.

3

Delay in microseconds.

ROCSHMEM_RO_NET_CPU_QUEUE

Use a CPU-side queue for network operations in the reverse-offload backend.

0

  • 0: Disabled.

  • 1: Enabled.

ROCSHMEM_SDMA_ENABLED

Enable or disable the SDMA transport at runtime. (build option USE_SDMA=OFF disables this feature).

0

  • 0: Disabled. All transfers use load/store (IPC path).

  • 1: Enabled. Transfers at or above ROCSHMEM_SDMA_THRESHOLD use the SDMA engine.

ROCSHMEM_SDMA_THRESHOLD

Minimum transfer size in bytes to route through the SDMA engine for per-lane operations. Wave and workgroup operations automatically scale the threshold by the wavefront size (e.g., 1024 × 64 = 64KB on gfx9). Transfers smaller than the effective threshold use load/store (IPC path) instead.

1024

Size in bytes.

ROCSHMEM_SDMA_NUM_CHANNELS

Number of SDMA channels (ring buffers) allocated per destination PE. More channels reduce CAS contention when many wavefronts submit concurrently, at the cost of additional queue memory and SDMA engine resources. If any rank on a node sets a value outside 1-8, every rank on that node aborts during initialization and names the rank(s) with the bad value.

1

Number of channels per destination PE (1-8).

ROCSHMEM_SDMA_SPREAD_CHANNELS

When enabled, each wavefront within a workgroup selects its SDMA channel using an offset based on its wavefront index: effective_channel = (ctx_channel + wf_id) % num_channels. This reduces CAS contention when multiple wavefronts in the same workgroup target the same destination PE on a shared context. By default, spreading is automatically enabled only for the default context (ctx_id=0), which is shared by all workgroups when contexts are not created per-workgroup. Per-workgroup contexts (created via rocshmem_wg_ctx_create) already distribute workgroups across channels via their context ID; enabling spreading for them reshuffles contention without reducing it.

0

  • 0: Apply wf_id spreading only for the default (shared) context.

  • 1: Apply wf_id spreading for all contexts.

ROCSHMEM_LDS_STAGE_TILE_BYTES

Tile size in bytes for LDS-staged work-group or wave put/get (requires USE_LDS_STAGE or USE_TDM build option, gfx1250 only). Backed by the portable async backend, or by TDM (Tensor Data Mover) specifically when built with USE_TDM. Doubled internally for double buffering; see rocshmem_query_lds_stage_bytes(). Wave put/get splits the registered LDS buffer evenly across the block’s waves, so each wave’s effective tile is smaller than this value.

131072

  • 0: auto-size the tile to use all LDS available per block on this device.

  • Nonzero (default 131072): use this tile size explicitly. Must be a multiple of 8 bytes (the element size); non-multiples are rounded down with a warning. On the TDM backend, must also fit the descriptor’s 65535-element tile_dim0 field. If the requested size (doubled) doesn’t fit in this device’s shared memory per block, falls back to the auto-sized value instead.

ROCSHMEM_LDS_STAGE_PUT_THRESHOLD

Minimum transfer size in bytes to route a put through the LDS-staged copy path for work-group or wave put (requires USE_LDS_STAGE or USE_TDM build option). Transfers smaller than this use the normal (non-staged) copy path instead, since the fast path’s issue latency isn’t amortized for small transfers.

16384

Size in bytes.

ROCSHMEM_LDS_STAGE_GET_THRESHOLD

Minimum transfer size in bytes to route a get through the LDS-staged copy path for work-group or wave get (requires USE_LDS_STAGE or USE_TDM build option). Gets are latency-bound on the remote read, so this path pays off at a much smaller size than put.

1024

Size in bytes.