Skip to content

Commit 9a403dc

Browse files
committed
Improve testing of cuda_core examples
1 parent 346afc8 commit 9a403dc

17 files changed

+161
-77
lines changed

.github/workflows/test-wheel-linux.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,15 @@ jobs:
9696
uses: nv-gha-runners/setup-proxy-cache@main
9797
continue-on-error: true
9898

99+
- name: Install uv
100+
uses: astral-sh/setup-uv@v7
101+
99102
- name: Install dependencies
100103
uses: ./.github/actions/install_unix_deps
101104
continue-on-error: false
102105
with:
103106
# for artifact fetching, graphics libs
104-
dependencies: "jq wget libgl1 libegl1"
107+
dependencies: "jq wget libgl1 libegl1 g++"
105108
dependent_exes: "jq wget"
106109

107110
- name: Set environment variables

cuda_core/examples/cuda_graphs.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

@@ -10,6 +10,10 @@
1010
#
1111
# ################################################################################
1212

13+
# /// script
14+
# dependencies = ["cuda_bindings", "cuda_core", "cupy-cuda13x"]
15+
# ///
16+
1317
import sys
1418
import time
1519

cuda_core/examples/gl_interop_plasma.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@
5353
# effect popular in the demoscene). The window title shows the current FPS.
5454
# Close the window or press Escape to exit.
5555
#
56-
# Requirements
57-
# ============
58-
# pip install pyglet
56+
57+
# /// script
58+
# dependencies = ["cuda_bindings", "cuda_core>0.6.0", "pyglet"]
59+
# ///
5960

6061
import ctypes
6162
import sys

cuda_core/examples/jit_lto_fractal.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

@@ -12,6 +12,10 @@
1212
#
1313
# ################################################################################
1414

15+
# /// script
16+
# dependencies = ["cuda_bindings", "cuda_core", "cupy-cuda13x"]
17+
# ///
18+
1519
import argparse
1620
import sys
1721

cuda_core/examples/memory_ops.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

@@ -10,6 +10,10 @@
1010
#
1111
# ################################################################################
1212

13+
# /// script
14+
# dependencies = ["cuda_bindings", "cuda_core", "cupy-cuda13x"]
15+
# ///
16+
1317
import sys
1418

1519
import cupy as cp

cuda_core/examples/pytorch_example.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

@@ -9,6 +9,10 @@
99
#
1010
# ################################################################################
1111

12+
# /// script
13+
# dependencies = ["cuda_bindings", "cuda_core", "torch"]
14+
# ///
15+
1216
import sys
1317

1418
import torch

cuda_core/examples/saxpy.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

@@ -10,6 +10,10 @@
1010
#
1111
# ################################################################################
1212

13+
# /// script
14+
# dependencies = ["cuda_bindings", "cuda_core", "cupy-cuda13x"]
15+
# ///
16+
1317
import sys
1418

1519
import cupy as cp

cuda_core/examples/show_device_properties.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

@@ -9,6 +9,10 @@
99
#
1010
# ################################################################################
1111

12+
# /// script
13+
# dependencies = ["cuda_bindings", "cuda_core"]
14+
# ///
15+
1216
import sys
1317

1418
from cuda.core import Device, system

cuda_core/examples/simple_multi_gpu_example.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

@@ -9,6 +9,10 @@
99
#
1010
# ################################################################################
1111

12+
# /// script
13+
# dependencies = ["cuda_bindings", "cuda_core", "cupy-cuda13x"]
14+
# ///
15+
1216
import sys
1317

1418
import cupy as cp

cuda_core/examples/strided_memory_view_cpu.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

@@ -9,6 +9,10 @@
99
#
1010
# ################################################################################
1111

12+
# /// script
13+
# dependencies = ["cuda_bindings", "cuda_core", "cffi", "setuptools"]
14+
# ///
15+
1216
import importlib
1317
import string
1418
import sys

0 commit comments

Comments
 (0)