mozilla / mozilla/sccache

Always stops while compiling CUDA with CMAKE_CUDA_LAUNCHER environment var

Open
#2,828 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
7.7k
Forks
748
Avg merge
4d 7h
Merged PRs (30d)
21

Description

The build always fail when building CUDA with CMAKE_CUDA_LAUNCHER environment variable set. I have also set other environment variables for C and CPP but they work fine. I figured this out while compiling llama.cpp. Here is the error message while compiling a sample CUDA hello world program with CMAKE:

cmake .
-- The CUDA compiler identification is NVIDIA 13.3.73 with host compiler GNU 15.3.0
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - failed
-- Check for working CUDA compiler: /opt/cuda/bin/nvcc
-- Check for working CUDA compiler: /opt/cuda/bin/nvcc - broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCUDACompiler.cmake:70 (message):
  The CUDA compiler

    "/opt/cuda/bin/nvcc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/tmp/untitledcuda/CMakeFiles/CMakeScratch/TryCompile-bXs3gZ'

    Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_0c617/fast
    /usr/bin/make  -f CMakeFiles/cmTC_0c617.dir/build.make CMakeFiles/cmTC_0c617.dir/build
    make[1]: Entering directory '/tmp/untitledcuda/CMakeFiles/CMakeScratch/TryCompile-bXs3gZ'
    Building CUDA object CMakeFiles/cmTC_0c617.dir/main.cu.o
    sccache /opt/cuda/bin/nvcc -forward-unknown-to-host-compiler   "--generate-code=arch=compute_75,code=[compute_75,sm_75]" -MD -MT CMakeFiles/cmTC_0c617.dir/main.cu.o -MF CMakeFiles/cmTC_0c617.dir/main.cu.o.d -x cu -c /tmp/untitledcuda/CMakeFiles/CMakeScratch/TryCompile-bXs3gZ/main.cu -o CMakeFiles/cmTC_0c617.dir/main.cu.o
    fatbinary fatal   : Could not open input file 'main.ptx'
    sccache: Compiler killed by signal 1
    make[1]: *** [CMakeFiles/cmTC_0c617.dir/build.make:82: CMakeFiles/cmTC_0c617.dir/main.cu.o] Error 254
    make[1]: Leaving directory '/tmp/untitledcuda/CMakeFiles/CMakeScratch/TryCompile-bXs3gZ'
    make: *** [Makefile:134: cmTC_0c617/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)


-- Configuring incomplete, errors occurred!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the CMake CUDA compiler test and the failing sccache/nvcc command shown in the report, then trace how CMAKE_CUDA_LAUNCHER is handled compared with the C and C++ launcher variables. Done means a simple CUDA project configures and compiles successfully when that environment variable is set.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, rust
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.