Getting started with Accelerate examples

38 views
Skip to first unread message

Lyle Kopnicky

unread,
Mar 4, 2019, 1:58:48 AM3/4/19
to Accelerate
Hi folks,

I've been reading Simon Marlow's book Parallel and Concurrent Programming in Haskell. I read the chapter on Accelerate, and wanted to try it out. There's example code for the book on GitHub (parconc-examples), but it's so outdated that I couldn't figure out how to get it to compile.

So, I thought that I'd try running the Accelerate examples instead. I'm using a Mac, and I've linked stack.yaml to the 8.4 version. I managed to install, using Homebrew, the required libraries: fftw, libffi, and llvm-hs/homebrew-llvm/llvm-4.0. I don't have a CUDA-capable GPU on this machine, so I'd like to use the llvm backend.

When I run stack build, I get this error:

    The configuration process failed to locate your CUDA installation. Ensure that
    you have installed both the developer driver and toolkit, available from:
 
    > http://developer.nvidia.com/cuda-downloads
 
    and make sure that `nvcc` is available in your PATH, or set the CUDA_PATH
    environment variable appropriately. Check the above output log and run the
    command directly to ensure it can be located.

Well, as I mentioned, I don't want to use the CUDA backend. Is there some flag I need to set in the stack.yaml to make it use the LLVM backend? I couldn't find any documentation about that.

It seems to be tripping up because cuda-0.9.0.3 is listed under extra-deps, yet I don't really need that library. I can't just comment it out, because there are other packages that require it.

Thanks,
Lyle

P.S. I'm also going to be attempting to install this on a Windows machine, where I do have a CUDA-capable GPU.

Trevor McDonell

unread,
Mar 4, 2019, 4:48:59 AM3/4/19
to accelerat...@googlegroups.com
Hi Lyle,

Yes, there is a flag you can set to disable building the CUDA backends. In your `stack.yaml` something like the following should do it:

```yaml
flags:
  accelerate-fft:
    llvm-ptx: false
  accelerate-examples:
    llvm-ptx: false
```


It is also possible to install the CUDA toolkit on a machine which doesn't have a compatible GPU; building will work fine, and it will only fail when you try to run the program.

`accelerate-llvm-ptx` _should_ work on windows, but I don't have a windows machine to actually test with, so I am limited to building in a VM and rely on windows users to test it and let me know if it breaks. I don't have much experience on windows, really, so would love if somebody could help me out here, even with improving the documentation for how to install everything.

Hope that helps!
-Trev


--
You received this message because you are subscribed to the Google Groups "Accelerate" group.
To unsubscribe from this group and stop receiving emails from it, send an email to accelerate-hask...@googlegroups.com.
Visit this group at https://groups.google.com/group/accelerate-haskell.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages