-
-
Notifications
You must be signed in to change notification settings - Fork 13
Make tutorials build on a DGX Spark w/ CUDA 13.0 #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,23 @@ | ||||||||||||||||||||
| # Common Makefile configuration for CUPTI samples | ||||||||||||||||||||
| # Copyright NVIDIA Corporation | ||||||||||||||||||||
|
|
||||||||||||||||||||
| # Detect CUDA version to determine supported SM architectures | ||||||||||||||||||||
| # CUDA 13+ removed support for compute capabilities below sm_75 | ||||||||||||||||||||
| CUDA_VERSION := $(shell $(CUDA_INSTALL_PATH)/bin/nvcc --version 2>/dev/null | grep release | sed 's/.*release //' | sed 's/,.*//' | cut -d. -f1) | ||||||||||||||||||||
|
||||||||||||||||||||
| CUDA_VERSION := $(shell $(CUDA_INSTALL_PATH)/bin/nvcc --version 2>/dev/null | grep release | sed 's/.*release //' | sed 's/,.*//' | cut -d. -f1) | |
| NVCC ?= nvcc | |
| CUDA_VERSION := $(shell $(NVCC) --version 2>/dev/null | grep release | sed 's/.*release //' | sed 's/,.*//' | cut -d. -f1) |
Copilot
AI
Feb 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CUDA version detection relies on Unix utilities (grep, sed, cut, test) in a pipeline. These are unlikely to work in the Windows_NT codepaths where GNU make may be using cmd.exe, which would break any sample Makefile that includes this file. Consider guarding auto-detection behind a non-Windows check and/or providing a simple fallback (require SMS to be set on Windows, or use a more portable parsing approach).
Copilot
AI
Feb 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DEFAULT_SM_ARCH is only set inside the ifndef SMS block. If a user overrides SMS (common when targeting a single GPU), DEFAULT_SM_ARCH remains unset and samples like pc_sampling that use -arch=$(DEFAULT_SM_ARCH) will fail. Define DEFAULT_SM_ARCH independently when it is not provided (e.g., derive it from $(firstword $(SMS))).
| # If SMS was provided by the user, ensure DEFAULT_SM_ARCH is also set. | |
| # Derive it from the first entry in SMS when not explicitly specified. | |
| ifndef DEFAULT_SM_ARCH | |
| ifdef SMS | |
| DEFAULT_SM_ARCH := sm_$(firstword $(SMS)) | |
| endif | |
| endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NVCCis now derived from$(CUDA_INSTALL_PATH), but this Makefile never definesCUDA_INSTALL_PATH(unlike most other samples). On a clean environment this will resolve to/bin/nvccand break the build. Add aCUDA_INSTALL_PATH ?= ...default (or computeNVCC ?= nvccfrom PATH) to keep the sample self-contained.