Skip to content

Commit 2754abf

Browse files
committed
Merge remote-tracking branch 'upstream/main' into documentation-remove-gpu-dependency
2 parents 3f7fc69 + 291ed64 commit 2754abf

File tree

5 files changed

+29
-5
lines changed

5 files changed

+29
-5
lines changed

.github/workflows/backport.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ jobs:
1414
backport:
1515
name: Backport pull request
1616
if: ${{ github.repository_owner == 'nvidia' &&
17-
github.event.pull_request.merged == true
17+
github.event.pull_request.merged == true &&
18+
contains( github.event.pull_request.labels.*.name, 'to-be-backported')
1819
}}
1920
runs-on: ubuntu-latest
2021
steps:
@@ -32,6 +33,4 @@ jobs:
3233
copy_assignees: true
3334
copy_labels_pattern: true
3435
copy_requested_reviewers: true
35-
label_pattern: to-be-backported
3636
target_branches: ${{ env.OLD_BRANCH }}
37-
conflict_resolution: draft_commit_conflicts
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Environment Variables
2+
3+
## Build-Time Environment Variables
4+
5+
- `CUDA_HOME` or `CUDA_PATH`: Specifies the location of the CUDA Toolkit.
6+
7+
- `CUDA_PYTHON_PARSER_CACHING` : bool, toggles the caching of parsed header files during the cuda-bindings build process. If caching is enabled (`CUDA_PYTHON_PARSER_CACHING` is True), the cache path is set to ./cache_<library_name>, where <library_name> is derived from the cuda toolkit libraries used to build cuda-bindings.
8+
9+
- `CUDA_PYTHON_PARALLEL_LEVEL` (previously `PARALLEL_LEVEL`) : int, sets the number of threads used in the compilation of extension modules. Not setting it or setting it to 0 would disable parallel builds.
10+
11+
## Runtime Environment Variables
12+
13+
- `CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM` : When set to 1, the default stream is the per-thread default stream. When set to 0, the default stream is the legacy default stream. This defaults to 0, for the legacy default stream. See [Stream Synchronization Behavior](https://docs.nvidia.com/cuda/cuda-runtime-api/stream-sync-behavior.html) for an explanation of the legacy and per-thread default streams.

cuda_bindings/docs/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
overview.md
1010
motivation.md
1111
release.md
12+
environment_variables.md
1213
api.rst
1314

1415

cuda_bindings/docs/source/install.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ Source builds require that the provided CUDA headers are of the same major.minor
3737
$ export CUDA_HOME=/usr/local/cuda
3838
```
3939

40+
See [Environment Variables](environment_variables.md) for a description of other build-time environment variables.
41+
4042
```{note}
4143
Only `cydriver`, `cyruntime` and `cynvrtc` are impacted by the header requirement.
4244
```

cuda_bindings/setup.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import sys
1616
import sysconfig
1717
import tempfile
18+
from warnings import warn
1819

1920
from Cython import Tempita
2021
from Cython.Build import cythonize
@@ -32,7 +33,15 @@
3233
raise RuntimeError("Environment variable CUDA_HOME or CUDA_PATH is not set")
3334

3435
CUDA_HOME = CUDA_HOME.split(os.pathsep)
35-
nthreads = int(os.environ.get("PARALLEL_LEVEL", "0") or "0")
36+
if os.environ.get("PARALLEL_LEVEL") is not None:
37+
warn(
38+
"Environment variable PARALLEL_LEVEL is deprecated. Use CUDA_PYTHON_PARALLEL_LEVEL instead",
39+
DeprecationWarning,
40+
stacklevel=1,
41+
)
42+
nthreads = int(os.environ.get("PARALLEL_LEVEL", "0"))
43+
else:
44+
nthreads = int(os.environ.get("CUDA_PYTHON_PARALLEL_LEVEL", "0") or "0")
3645
PARSER_CACHING = os.environ.get("CUDA_PYTHON_PARSER_CACHING", False)
3746
PARSER_CACHING = bool(PARSER_CACHING)
3847

@@ -80,7 +89,7 @@
8089
found_values = []
8190

8291
include_path_list = [os.path.join(path, "include") for path in CUDA_HOME]
83-
print(f'Parsing headers in "{include_path_list}" (Caching {PARSER_CACHING})')
92+
print(f'Parsing headers in "{include_path_list}" (Caching = {PARSER_CACHING})')
8493
for library, header_list in header_dict.items():
8594
header_paths = []
8695
for header in header_list:

0 commit comments

Comments
 (0)