Skip to content

build: use the validated NVCC compiler - #2

Open
morluto wants to merge 1 commit into
cursor:mainfrom
morluto:fix/use-validated-nvcc
Open

build: use the validated NVCC compiler#2
morluto wants to merge 1 commit into
cursor:mainfrom
morluto:fix/use-validated-nvcc

Conversation

@morluto

@morluto morluto commented Aug 4, 2026

Copy link
Copy Markdown

Fixes #1.

Problem

setup.py validated the compiler selected by NVCC, but the Make invocation used MOK_NVCC (falling back to nvcc). An NVCC-only configuration could therefore validate one CUDA toolkit and compile with another compiler resolved from PATH.

Change

  • Select MOK_NVCC, then NVCC, then nvcc as the compiler command.
  • Return the resolved executable from check_nvcc().
  • Pass that exact resolved executable to Make.
  • Document the compiler override in the installation instructions.

This preserves MOK_NVCC support while making validation and compilation use one compiler path.

Regression coverage

A focused harness loads setup.py, exercises both environment-variable paths, stubs a CUDA 13 NVCC version response, and captures the Make command. It verifies that an NVCC-only selection passes the validated executable path to Make rather than NVCC=nvcc.

Validation

  • python -m py_compile setup.py
  • git diff --check
  • Focused NVCC selection/build-command regression harness — passed

Note

Low Risk
Build/install wiring only; no runtime kernel or training behavior changes.

Overview
Fixes a mismatch where setup.py could validate one compiler (via NVCC) but invoke Make with another (MOK_NVCC or bare nvcc on PATH).

Compiler selection is now centralized: MOK_NVCCNVCCnvcc, resolved with shutil.which, version-checked in check_nvcc(), and that same resolved path is passed to make as NVCC=.... The README documents overriding the compiler with MOK_NVCC or NVCC for both the check and the build.

Reviewed by Cursor Bugbot for commit 25e607c. Bugbot is set up for automated code reviews on this repo. Configure here.

Signed-off-by: morluto <76467478+morluto@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build with the same NVCC compiler that setup.py validates

1 participant