How to run the example with add.cubin file?
I'm trying to run the example with the add.cubin kernel but it seems not to work.
I've tried "... let module_data = CString::new(include_str!("../add.cubin"))?; let module = Module::load_from_string(&module_data)?; ..."
but I got error: src/../add.cubin wasn't a utf-8 file
the I've tried "... let filename = CString::new("./sub.cubin")?; let module = Module::load_from_file(&filename)?; ..." but I got Error: InvalidSouce
That's a fair point! I don't know, I've only ever used PTX files.
include_str! won't work with binary files. I always meant to create an include_cstr! macro if I could figure out how to implement it, but never got around to it.
Using load_from_file is probably the right way to go, but you'll need to make sure your path is correct. If you're using relative paths, then I think they'll be relative to the current working directory when you run the program.
Unfortunately even the load_from_file() doesn't work even if I set the correct path, Is there a workaround?
I'm successfully using load_from_file to load a fatbin. You can generate a fatbin by passing '-fatbin' to nvcc.
How are you compiling the binary?
I'm successfully using
load_from_fileto load a fatbin. You can generate a fatbin by passing '-fatbin' to nvcc.How are you compiling the binary?
I tried to use nvcc-fatbin add.cu to compile the file using load_from_fiile to load. Error NoBinaryForGpu
Can you directly load the CU file to call