NVIDIA / NVIDIA/cccl

[BUG]: Compiling local .cu file with `nvrtcc` skips code generation and is non-fatal

Open
#4,728 0 comments 0 reactions 1 assignee Claimed by @wmaxey View on GitHub
Dominant language
C++
Stars
2.5k
Forks
487
Avg merge
2d 7h
Merged PRs (30d)
296

Description

### Is this a duplicate?

- [x] I confirmed there appear to be no [duplicate issues](https://github.com/NVIDIA/cccl/issues) for this bug and that I agree to the [Code of Conduct](CODE_OF_CONDUCT.md)

### Type of Bug

Silent Failure

### Component

libcu++

### Describe the bug

nvrtcc needs to check that the input file is a non-empty string before compiling.

### How to Reproduce

Bad case:
```
(cccl) coder ➜ ~/cccl/testing $ ../build/cuda12.8-gcc13/libcudacxx-nvrtc-cpp17/libcudacxx/test/utils/nvidia/nvrtc/nvrtcc --std=c++20 -gencode=arch=c
ompute_80,code=compute_80 -c ./test.cu
NVRTCC Configuration:
Output dir:
Output file:
Input file:
Building: true
Skipping output: false
Executing: false
NVRTC opt list:
-DCCCL_ENABLE_ASSERTIONS
--gpu-architecture=compute_80
Compiling program...
Collecting logs...
```

test.cu can then contain anything and will never fail to compile. An empty wrapping compute_80 file will be emitted.

### Expected behavior

Good case:
```
../build/cuda12.8-gcc13/libcudacxx-nvrtc-cpp17/libcudacxx/test/utils/nvidia/nvrtc/nvrtcc --std=c++20 -gencode=arch=compute_80,code=compute_80 -c "/home/coder/cccl/testing/test.cu"
NVRTCC Configuration:
Output dir:
Output file:
Input file: /home/coder/cccl/testing/test.cu
Building: true
Skipping output: false
Executing: false
NVRTC opt list:
-I /home/coder/cccl/testing
-DCCCL_ENABLE_ASSERTIONS
--gpu-architecture=compute_80
```

### Reproduction link

_No response_

### Operating System

_No response_

### nvidia-smi output

_No response_

### NVCC version

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.