Skip to main content

GPU-accelerated 3GPP channel models (TR 38.901)

Project description

cu3GPPChan Python Bindings

Python interface to the GPU-accelerated cu3gppchan C++/CUDA library via nanobind.

Prerequisites

Component Version
Python 3.10+
CUDA Toolkit 12.x+
GPU SM 8.0+ (Ampere / Hopper)
numpy any
h5py any
pyyaml any
cupy (optional) cupy-cuda13x — required for StatisticalChannel and FadingChannel

The wheel build invokes the repo CMake project and packages both _cu3gppchan*.so and libchanModels.so into the wheel. The target machine must still provide the CUDA driver/runtime and system libraries such as HDF5.

Build a Wheel

# From the repository root:
bash scripts/build_wheel.sh --clean

# Install the generated wheel
python3 -m pip install dist/cu3gppchan-*.whl

# Verify import and basic config construction
python3 scripts/use_python_wheel.py

Set CUDA architectures with:

CU3GPPCHAN_CUDA_ARCHS="80;90" bash scripts/build_wheel.sh --clean

For editable development:

bash scripts/build.sh --python
python3 -m pip install -e python/

Verify:

import cu3gppchan
print(cu3gppchan.__version__)  # 0.1.0

Package Structure

python/
  pyproject.toml
  src/cu3gppchan/
    __init__.py              Public API re-exports
    _cu3gppchan*.so          nanobind C++ extension (built by CMake)
    libchanModels.so         bundled runtime library used by the extension
    statistical_channel.py   StatisticalChannel — system-level SLS wrapper
    fading_channel.py        FadingChannel — link-level TDL/CDL wrapper
    channel_config.py        TdlChannelConfig / CdlChannelConfig
    channel_api_ref.py       3GPP TR 38.901 reference data
    cuda_utils.py            CUDA stream and array helpers

API Overview

Low-Level Bindings (no CuPy needed)

These are direct nanobind wrappers of C++ classes. Use when you manage GPU memory yourself or only need configuration objects.

Class Description
SimConfig Simulation parameters (frequency, bandwidth, run mode)
SystemLevelConfig Scenario, topology (sites, sectors, UTs)
LinkLevelConfig Fading type, delay profile, mobility
ExternalConfig External cell/UT/antenna configuration
TdlConfig / TdlChan TDL channel config and engine
CdlConfig / CdlChan CDL channel config and engine
StatisChanModel System-level stochastic channel engine
GauNoiseAdder AWGN noise on GPU
OfdmModulate / OfdmDeModulate OFDM mod/demod
Scenario Enum: UMa, UMi, RMa, etc.

High-Level Wrappers (require CuPy)

These provide a Pythonic interface with CuPy array I/O and automatic GPU memory management.

StatisticalChannel — System-Level Channel

from cu3gppchan import (
    StatisticalChannel, SimConfig, SystemLevelConfig,
    LinkLevelConfig, ExternalConfig, Scenario,
)

sim_cfg = SimConfig(center_freq_hz=3.5e9, bandwidth_hz=100e6, run_mode=1)
sys_cfg = SystemLevelConfig(scenario=Scenario.UMa, n_site=1, n_ut=10)
link_cfg = LinkLevelConfig(fast_fading_type=2)  # CDL
ext_cfg = ExternalConfig()

chan = StatisticalChannel(sim_cfg, sys_cfg, link_cfg, ext_cfg)

# Run one TTI
chan.run(ref_time=0.0)

FadingChannel — Link-Level TDL / CDL

from cu3gppchan import FadingChannel, TdlChannelConfig

config = TdlChannelConfig(
    n_cell=1, n_ue=1,
    n_bs_ant=4, n_ue_ant=4,
    delay_profile='A',
    delay_spread_ns=30,
    max_doppler_hz=5,
    sc_spacing_hz=30e3,
)

chan = FadingChannel(config)
rx_signal = chan.run(tx_signal, ref_time=0.0, snr_db=20.0)

Configuration Classes

Class Description
TdlChannelConfig TDL channel parameters (profiles A–E, delay spread, Doppler)
CdlChannelConfig CDL channel parameters (antenna arrays, spatial correlation)
CellParam Per-cell parameters (position, antenna panel)
UtParamCfg Per-UT parameters (position, velocity, type)
AntPanelConfig Antenna panel geometry [M_g, N_g, M, N, P] per TR 38.901

Enums

Enum Values
Scenario UMa, UMi, RMa, InH, InF
SensingTargetType ISAC target types
UeType UE mobility types

Running Tests

# Static analysis (flake8 / pylint / mypy)
bash tests/run_static_tests.sh

# Python unit tests
bash tests/run_unit_tests.sh --python_only

Dependencies

Required (installed automatically by pip install):

  • numpy
  • h5py
  • pyyaml

Optional:

  • cupy-cuda13x — for StatisticalChannel, FadingChannel, and GPU array wrappers

License

Apache-2.0. See file headers for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

cu3gppchan-0.1.0-cp314-cp314-manylinux_2_34_x86_64.whl (38.4 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

cu3gppchan-0.1.0-cp313-cp313-manylinux_2_34_x86_64.whl (38.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

cu3gppchan-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl (38.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

cu3gppchan-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl (38.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

cu3gppchan-0.1.0-cp310-cp310-manylinux_2_34_x86_64.whl (38.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

File details

Details for the file cu3gppchan-0.1.0-cp314-cp314-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for cu3gppchan-0.1.0-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 e14ae43a1f4d2130ec4619247f6d1272dc25dd0c9947aa6d19274c36b8640b05
MD5 369fd6f4b62878885a53155cb1718902
BLAKE2b-256 0bf9b5cd42fea0cf1094f647415f49c3192c20f61d0ebe1f1b82f9a8ee052b40

See more details on using hashes here.

File details

Details for the file cu3gppchan-0.1.0-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for cu3gppchan-0.1.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 2d48b7dacdac0e8cdf5a3aa35f5ad96111f60e39ca846578a490efd67b2a890f
MD5 b251ad7276e39a6981239c2bd707cd74
BLAKE2b-256 06461a30929c55a2199112222ad625a7c0ca4b656a85cde95b74bc02f2d14a94

See more details on using hashes here.

File details

Details for the file cu3gppchan-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for cu3gppchan-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 89e217757784831a69a40db55e93eaf7d0a2a54c848ea4816fdd48709bcc8b26
MD5 5a82e790169cd4fa5be45c1872049759
BLAKE2b-256 5f8023e6442fe2c428179ab7357c13fe35371789940fb4ec1e263728ff0e5231

See more details on using hashes here.

File details

Details for the file cu3gppchan-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for cu3gppchan-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ddda8fa715fc26c0cf72be89c801eeb0a7a225b2139e2a414a650c62f8d582f3
MD5 8c8f119bd92f18c05cb7bcc130a6b37f
BLAKE2b-256 5954a572ba6c06ae92fffaec3922d6f13e75ed7509f985d4446c836d9d8af061

See more details on using hashes here.

File details

Details for the file cu3gppchan-0.1.0-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for cu3gppchan-0.1.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 fe0caac8ac4b00c8805e8bd744a34d3b54a70531d5e8a4f385f58cb8905705d0
MD5 1d7ed952e643ba3c37aeac3149c523b8
BLAKE2b-256 7dd5d515c7f467da53bfb3aea7d1b45cac252cb49891aa368b1e02e862bc0fb3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page