Skip to content
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

CUDA compiler family detection failed #1121

Open
mrjbom opened this issue Jul 3, 2024 · 2 comments
Open

CUDA compiler family detection failed #1121

mrjbom opened this issue Jul 3, 2024 · 2 comments

Comments

@mrjbom
Copy link

mrjbom commented Jul 3, 2024

cc 1.0.104
My build.rs the script successfully compiles the CUDA file, but it has problems running its detect_compiler_family.c
This is due to the fact that nvcc does not see cl.exe .
But I can't help him by setting -ccbin how I do it to compile my CUDA file.
How can I get rid of the warnings related to this?

fn main() {
    println!("cargo::rerun-if-changed=cuda/mandelbrot.cu");

    let mut build = cc::Build::new();
    let compiler = build.get_compiler();
    let ccbin = compiler.path();

    build
        .cuda(true)
        .cudart("static")
        .ccbin(false)
        .flag("-ccbin").flag(ccbin)
        .file("cuda/mandelbrot.cu");
    build.compile("mandelbrotcuda");
}

Warning is: Compiler family detection failed due to error: ToolExecError: Command "nvcc" "-E" "C:\Rust\mandelbrot_test_render\target\debug\build\mandelbrot_test_render-02f861198c0a4c7d\out\4903743526134228929detect_compiler_family.c" with args nvcc did not execute successfully (status code exit code: 1).
If i run this directly in cmd
nvcc fatal : Cannot find compiler 'cl.exe' in PATH

@NobodyXu
Copy link
Collaborator

NobodyXu commented Jul 3, 2024

nvcc fatal : Cannot find compiler 'cl.exe' in PATH

That's probably a limitation of our detection logic:

let stdout = run_output(

I think maybe we should special case cuda here?

@mrjbom
Copy link
Author

mrjbom commented Jul 6, 2024

I think maybe we should special case cuda here?

Of course. Although this is not critical, a lot of warnings get in the way.

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

No branches or pull requests

2 participants