You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The third to the last line is an error message I added, since Error: Not Supported isn't very helpful...
$ git diff
diff --git a/examples/cuda/cpu/add/src/main.rs b/examples/cuda/cpu/add/src/main.rs
index 8ced6476e9ba..fb52be41ba67 100644
--- a/examples/cuda/cpu/add/src/main.rs+++ b/examples/cuda/cpu/add/src/main.rs@@ -18,7 +18,13 @@ fn main() -> Result<(), Box<dyn Error>> {
// initialize CUDA, this will pick the first available device and will
// make a CUDA context from it.
// We don't need the context for anything but it must be kept alive.
- let _ctx = cust::quick_init()?;+ let _ctx = match cust::quick_init() {+ Ok(c) => c,+ Err(e) => {+ println!("cust::quick_init(): {:?}", e);+ return Err(Box::new(e));+ }+ };
// Make the CUDA module, modules just house the GPU code for the kernels we created.
// they can be made from PTX code, cubins, or fatbins.
Is there anything I've missed?
The text was updated successfully, but these errors were encountered:
Ok, I'm quickly becoming not a fan of ? error handling. In cust::quick_init(), which line would throw NotSupported?
#[must_use = "The CUDA Context must be kept alive or errors will be issued for any CUDA function that is run"]pubfnquick_init() -> CudaResult<Context>{init(CudaFlags::empty())?;let device = Device::get_device(0)?;let ctx = Context::new(device)?;
ctx.set_flags(ContextFlags::SCHED_AUTO)?;Ok(ctx)}
All,
Today I followed the instructions at https://github.com/Rust-GPU/Rust-CUDA/blob/master/guide/src/guide/getting_started.md#docker and I appear to have a successful, running docker container for building Rust-CUDA.
The Nvidia tools seems to report successfully:
The host OS is Gentoo on x86_64, using this to install
nvidia-container-runtime
:IIUC, I've set the environment up correctly. However, I get the following when I try to run the
add
example:The third to the last line is an error message I added, since
Error: Not Supported
isn't very helpful...Is there anything I've missed?
The text was updated successfully, but these errors were encountered: