nvcc4jupyter
nvcc4jupyter copied to clipboard
Compilation with compilation options not working
I'm trying to use nvcc4jupyter under Google Colab, using nvcc compilation options, but unsuccessfully.
If I use %%cuda -c "-l curand", the Colab's code box says:
usage: colab_kernel_launcher.py [-h] [-t] [-p] [-l PROFILER] [-a PROFILER_ARGS] [-c COMPILER_ARGS]
%%cuda magic that compiles and runs CUDA C++ code in this cell. See
https://nvcc4jupyter.readthedocs.io/en/latest/magics.html#cuda for usage details.
options:
-h, --help show this help message and exit
-t, --timeit
-p, --profile
-l PROFILER, --profiler PROFILER
-a PROFILER_ARGS, --profiler-args PROFILER_ARGS
-c COMPILER_ARGS, --compiler-args COMPILER_ARGS
usage: colab_kernel_launcher.py [-h] [-t] [-p] [-l PROFILER] [-a PROFILER_ARGS] [-c COMPILER_ARGS]
colab_kernel_launcher.py: error: argument -c/--compiler-args: expected one argument
Normal compilation without options works correctly.
Hello! That indeed does not work and I'll try to figure out why as soon as I find some time.
Did not figure it out, but there's a workaround by adding an include path that does not exist. No idea why it works.
%%cuda -c "-I /does/not/exist -l curand"
#include <stdio.h>
int main()
{
printf("It works!");
return 0;
}
The following does not work:
%%cuda -c "-l curand"
#include <stdio.h>
int main()
{
printf("It works!");
return 0;
}
The "cuda" magic has a "-l" option so I think it's interpreting it as an option for it instead of passing it to nvcc