The root cause is that the current XPU runtime limits single allocations to ~4GB by default.
Solution:
Enable “UR_L0_USE_RELAXED_ALLOCATION_LIMITS”:
export UR_L0_USE_RELAXED_ALLOCATION_LIMITS=1
Restart your terminal and try again — the 4GB allocation should succeed.