kernel = r"""
#include <include/cutlass/cutlass.h>
extern "C" __global__ void entry0() {
return ;
}
"""
import cupy as cp
raw_module = cp.RawModule(code=kernel, backend='nvcc', options=("-I G:/cutlass-3.3.0",))
raw_module.get_function("entry0")((1, 1, 1),(1, 1, 1),())
I am including it like this, but when I try to run it I get the following error message:
cupy.cuda.compiler.CompileException: `nvcc` command returns non-zero exit status.
command: ['C:\\Program', 'Files\\NVIDIA', 'GPU', 'Computing', 'Toolkit\\CUDA\\v12.2\\bin\\nvcc.EXE', '-gencode=arch=compute_89,code=sm_89', '--cubin', '-I G:/cutlass-3.3.0', '-IC:\\Users\\mrakg\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\cupy\\_core\\include', '-IC:\\Users\\mrakg\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\cupy\\_core\\include\\cupy\\_cuda\\cuda-12', '-IC:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.2\\include', '-ftz=true', 'C:\\Users\\mrakg\\AppData\\Local\\Temp\\tmpdwwgnwt7\\e63b826e4265f53d72fc550972a60778d4e87cc0.cu']
return-code: 2
stdout/stderr:
G:/cutlass-3.3.0\include/cutlass/cutlass.h(48): fatal error C1083: Cannot open include file: 'cutlass/detail/helper_macros.hpp': No such file or directory
e63b826e4265f53d72fc550972a60778d4e87cc0.cu
It seems like the problem is that the include is not thorough enough. If I look into the Cutlass library itself I see a quoted include:
#include "cutlass/detail/helper_macros.hpp"
If it was...
#include "detail/helper_macros.hpp"
It would have worked, but as it is, it is not looking at it in the right directory. What should I do to include it properly?
"-I G:/cutlass-3.3.0/include"
It seems my memory was faulty. What I had to do was put to include directory into the path. After that, the following compiles.
kernel = r"""
#include <cutlass/cutlass.h>
extern "C" __global__ void entry0() {
return ;
}
"""
import cupy as cp
raw_module = cp.RawModule(code=kernel, backend='nvcc', options=("-I G:/cutlass-3.3.0/include",))
raw_module.get_function("entry0")((1, 1, 1),(1, 1, 1),())