Skip to content

Commit 86e901c

Browse files
committed
Merge branch 'main' into path_finder_dev
2 parents 1e15f5e + 9579678 commit 86e901c

File tree

109 files changed

+1143
-260
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+1143
-260
lines changed

.bandit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
13
[bandit]
24
skips = B101,B311

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
15
name: Bug Report
26
description: Create a report to help us improve
37
title: '[BUG]: '

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
15
blank_issues_enabled: true
26
contact_links:
37
- name: Questions

.github/ISSUE_TEMPLATE/doc_request.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
15
name: Documentation Request
26
description: Suggest an idea to improve cuda-python
37
title: '[DOC]: '

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
15
name: Feature Request
26
description: Suggest an idea to improve cuda-python
37
title: '[FEA]: '

.github/ISSUE_TEMPLATE/release_checklist.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
15
name: Release Checklist
26
description: Public checklist for release managers making a subpackage release
37
labels: ["P0"]

.github/actions/doc_preview/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
15
name: Preview or clean up docs built from PRs
26

37
# A re-implementation based on the logic of https://github.com/rossjrw/pr-preview-action/blob/41a957c44a456a34718e9bcf825363194db5e6d5/README.md, due to limitations illustrated in NVIDIA/cuda-python#380.

.github/actions/fetch_ctk/action.yml

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
15
name: Fetch mini CTK
26

37
description: Fetch (or create) a mini CUDA Toolkit from cache
@@ -13,7 +17,7 @@ inputs:
1317
description: "A list of the CTK components to install as a comma-separated list. e.g. 'cuda_nvcc,cuda_nvrtc,cuda_cudart'"
1418
required: false
1519
type: string
16-
default: "cuda_nvcc,cuda_cudart,cuda_nvrtc,cuda_profiler_api,cuda_cccl,cuda_sanitizer_api,libnvjitlink"
20+
default: "cuda_nvcc,cuda_cudart,cuda_nvrtc,cuda_profiler_api,cuda_cccl,libnvjitlink"
1721

1822
runs:
1923
using: composite
@@ -46,8 +50,11 @@ runs:
4650
if: ${{ steps.ctk-get-cache.outputs.cache-hit != 'true' }}
4751
shell: bash --noprofile --norc -xeuo pipefail {0}
4852
run: |
49-
CUDA_PATH="./cuda_toolkit"
50-
mkdir $CUDA_PATH
53+
# Everything under this folder is packed and stored in the GitHub Cache space,
54+
# and unpacked after retrieving from the cache.
55+
CACHE_TMP_DIR="./cache_tmp_dir"
56+
rm -rf $CACHE_TMP_DIR
57+
mkdir $CACHE_TMP_DIR
5158
5259
# The binary archives (redist) are guaranteed to be updated as part of the release posting.
5360
CTK_BASE_URL="https://developer.download.nvidia.com/compute/cuda/redist/"
@@ -59,15 +66,17 @@ runs:
5966
CTK_SUBDIR="linux-sbsa"
6067
fi
6168
function extract() {
62-
tar -xvf $1 -C $CUDA_PATH --strip-components=1
69+
tar -xvf $1 -C $CACHE_TMP_DIR --strip-components=1
6370
}
6471
elif [[ "${{ inputs.host-platform }}" == "win-64" ]]; then
6572
CTK_SUBDIR="windows-x86_64"
6673
function extract() {
6774
_TEMP_DIR_=$(mktemp -d)
6875
unzip $1 -d $_TEMP_DIR_
69-
cp -r $_TEMP_DIR_/*/* $CUDA_PATH
76+
cp -r $_TEMP_DIR_/*/* $CACHE_TMP_DIR
7077
rm -rf $_TEMP_DIR_
78+
# see commit NVIDIA/cuda-python@69410f1d9228e775845ef6c8b4a9c7f37ffc68a5
79+
chmod 644 $CACHE_TMP_DIR/LICENSE
7180
}
7281
fi
7382
function populate_cuda_path() {
@@ -95,11 +104,21 @@ runs:
95104
for item in $(echo $CTK_CACHE_COMPONENTS | tr ',' ' '); do
96105
populate_cuda_path "$item"
97106
done
98-
ls -l $CUDA_PATH
107+
ls -l $CACHE_TMP_DIR
99108
100109
# Prepare the cache
101110
# Note: try to escape | and > ...
102-
tar -czvf ${CTK_CACHE_FILENAME} ${CUDA_PATH}
111+
tar -czvf ${CTK_CACHE_FILENAME} ${CACHE_TMP_DIR}
112+
113+
# "Move" files from temp dir to CUDA_PATH
114+
CUDA_PATH="./cuda_toolkit"
115+
mkdir -p $CUDA_PATH
116+
# Unfortunately we cannot use "rsync -av $CACHE_TMP_DIR/ $CUDA_PATH" because
117+
# not all runners have rsync pre-installed (or even installable, such as
118+
# Git Bash). We do it in the dumb way.
119+
cp -r $CACHE_TMP_DIR/* $CUDA_PATH
120+
rm -rf $CACHE_TMP_DIR
121+
ls -l $CUDA_PATH
103122
104123
- name: Upload CTK cache
105124
if: ${{ always() &&
@@ -114,8 +133,13 @@ runs:
114133
shell: bash --noprofile --norc -xeuo pipefail {0}
115134
run: |
116135
ls -l
136+
CACHE_TMP_DIR="./cache_tmp_dir"
117137
CUDA_PATH="./cuda_toolkit"
138+
mkdir -p $CUDA_PATH
118139
tar -xzvf $CTK_CACHE_FILENAME
140+
# Can't use rsync here, see above
141+
cp -r $CACHE_TMP_DIR/* $CUDA_PATH
142+
rm -rf $CACHE_TMP_DIR $CTK_CACHE_FILENAME
119143
ls -l $CUDA_PATH
120144
if [ ! -d "$CUDA_PATH/include" ]; then
121145
exit 1
@@ -124,8 +148,17 @@ runs:
124148
- name: Set output environment variables
125149
shell: bash --noprofile --norc -xeuo pipefail {0}
126150
run: |
127-
CUDA_PATH=$(realpath "./cuda_toolkit")
151+
# mimics actual CTK installation
152+
if [[ "${{ inputs.host-platform }}" == linux* ]]; then
153+
CUDA_PATH=$(realpath "./cuda_toolkit")
154+
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}:${CUDA_PATH}/lib:${CUDA_PATH}/nvvm/lib64" >> $GITHUB_ENV
155+
elif [[ "${{ inputs.host-platform }}" == win* ]]; then
156+
function normpath() {
157+
echo "$(echo $(cygpath -w $1) | sed 's/\\/\\\\/g')"
158+
}
159+
CUDA_PATH=$(normpath $(realpath "./cuda_toolkit"))
160+
echo "$(normpath ${CUDA_PATH}/bin)" >> $GITHUB_PATH
161+
echo "$(normpath $CUDA_PATH/nvvm/bin)" >> $GITHUB_PATH
162+
fi
128163
echo "CUDA_PATH=${CUDA_PATH}" >> $GITHUB_ENV
129164
echo "CUDA_HOME=${CUDA_PATH}" >> $GITHUB_ENV
130-
echo "${CUDA_PATH}/bin" >> $GITHUB_PATH
131-
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}:${CUDA_PATH}/lib:${CUDA_PATH}/nvvm/lib64" >> $GITHUB_ENV

.github/actions/get_pr_number/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
15
name: Get the PR number
26

37
description: Get the PR number without relying on the pull_request* event triggers.

.github/actions/install_unix_deps/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
15
name: Install dependencies on Ubuntu
26

37
description: Install needed dependencies, regardless if using GitHub- or self- hosted runners, container, sudo or not.

.github/workflows/backport.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
15
name: "CI: Backport the merged PR"
26

37
on:

.github/workflows/bandit.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
15
name: "Static Analysis: Bandit Scan"
26

37
on:

.github/workflows/build-and-test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
15
# Note: This name is referred to in the test job, so make sure any changes are sync'd up!
26
name: "CI: Build and test"
37

@@ -142,7 +146,7 @@ jobs:
142146
LIBRARY_PATH=/host/${{ env.CUDA_PATH }}/lib
143147
CUDA_BINDINGS_PARALLEL_LEVEL=${{ env.CUDA_BINDINGS_PARALLEL_LEVEL }}
144148
CIBW_ENVIRONMENT_WINDOWS: >
145-
CUDA_HOME="$(cygpath -w ${{ env.CUDA_PATH }})"
149+
CUDA_HOME=${{ env.CUDA_PATH }}
146150
LIB="${CUDA_HOME}\\lib\\x64;${LIB}"
147151
CUDA_BINDINGS_PARALLEL_LEVEL=${{ env.CUDA_BINDINGS_PARALLEL_LEVEL }}
148152
with:

.github/workflows/build-docs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
15
name: "CI: Build and update docs"
26

37
on:

.github/workflows/codeql.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
15
name: "Static Analysis: CodeQL Scan"
26

37
on:

.github/workflows/guess_latest.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
# Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
# URL to search
7+
URL="https://developer.download.nvidia.com/compute/cuda/redist/"
8+
9+
# Fetch the directory listing and extract the latest version number
10+
get_latest_version() {
11+
# Get the HTML content of the page
12+
local html_content=$(wget -q -O - "$URL")
13+
14+
# Extract links matching the pattern redistrib_?.?.?.json
15+
local files=$(echo "$html_content" | grep -oP 'redistrib_[0-9]+\.[0-9]+\.[0-9]+\.json' | cut -d'"' -f2)
16+
17+
# If files were found, extract the version numbers and find the latest
18+
if [ -n "$files" ]; then
19+
# Extract just the version numbers using regex
20+
local versions=$(echo "$files" | grep -oP 'redistrib_\K[0-9]+\.[0-9]+\.[0-9]+(?=\.json)')
21+
22+
# Sort the versions and get the latest
23+
local latest_version=$(echo "$versions" | sort -V | tail -n 1)
24+
echo "$latest_version"
25+
else
26+
echo "No files matching the pattern were found."
27+
return 1
28+
fi
29+
}
30+
31+
# Call the function and store the result
32+
latest_version=$(get_latest_version)
33+
echo $latest_version

.github/workflows/install_gpu_driver.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#Requires -RunAsAdministrator
1+
# Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
24

35
# Install the driver
46
function Install-Driver {
@@ -23,7 +25,7 @@ function Install-Driver {
2325
$ProgressPreference = $ProgressPreference_tmp
2426
Write-Output 'Download complete!'
2527

26-
# Install the file with the specified path from earlier as well as the RunAs admin option
28+
# Install the file with the specified path from earlier
2729
Write-Output 'Running the driver installer...'
2830
Start-Process -FilePath $file_dir -ArgumentList $install_args -Wait
2931
Write-Output 'Done!'

.github/workflows/release-upload.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
15
name: "CI: Upload git archive"
26

37
on:

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
15
name: "CI: Release"
26

37
description: Manually-triggered release workflow. Must have a release note in the draft state and the release commit tagged.

.github/workflows/status-check.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
15
name: "CI: Summary"
26

37
on:

0 commit comments

Comments
 (0)