quantalea / AleaNotebooks

Notebooks for Alea GPU
MIT License
12 stars 7 forks source link

Hamiltonian Monte Carlo notebook exception ('cublas64_75') #3

Closed cgravill closed 7 years ago

cgravill commented 7 years ago

The Hamiltonian Monte Carlo sample looks really promising and I'd love to try it out. I cloned the repository and attempted to execute it. I get several cells down but on the first "Using the Matrix Expression Library" cell I get:

System.DllNotFoundException: Unable to load DLL 'cublas64_75': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
   at Alea.DynamicInterop.cublasCreate_v2.Invoke(IntPtr )
   at A.c39ae6037153677652e6d07f8065f34d4.-ctor@1040-289.Invoke(Unit _arg3)
   at Alea.cuBLAS.Blas..ctor(Gpu c576ee02bf9031529e5bc6b09c7c03f66, FSharpOption`1 cdd5e91d5c509dec430918468c49a7937)
   at Alea.cuBLAS.Blas..ctor(Gpu gpu)
   at FSI_0014.Session..ctor(Gpu gpu) in E:\dev\AleaNotebooks\input.fsx:line 7
   at <StartupCode$FSI_0015>.$FSI_0015.main@() in E:\dev\AleaNotebooks\input.fsx:line 10
Stopped due to error

Is there some kind of set-up I need to do? I have the Cuda toolkit on my machine but I saw elsewhere I shouldn't need it? I searched my packages directory for cublas64 and didn't find anything.

In case it's important: GPU is [0|3.0|GeForce GTX 680], Number of Cores 1536, GPU DRAM is 2.000 GB, Process is 64 bit (I have a better GPU elsewhere if that's the issue) Prerelease IfSharp, master from a few days ago: https://github.com/fsprojects/IfSharp/commit/43af61ebecde2e9960c6a676f04eb2e666b69c79

Thanks for any suggestions!

soloman817 commented 7 years ago

Hi, this script uses cublas wrapping (and perhaps also cuRAND wrapping), to do that, you need also install CUDA ToolKit, and if you are using CUDA ToolKit 8.0, you should set Alea to use 8.0 toolkit (you can do it via env var): http://www.aleagpu.com/release/3_0_2/doc/faq.html#config_cuda_version

soloman817 commented 7 years ago

if you installed CUDA Toolkit, say 8.0, then make sure you added the env var as suggested above, and also the cublas64_75.dll should be in your PATH.

cgravill commented 7 years ago

Thanks, I have 8.0 so your link was exactly the fix I needed, thanks.

If Alea could probe for the dll that's present i.e. cublas64_75.dll or cublas64_80.dll rather than requiring configuration that would be great. There are some circumstances where from a notebook it's awkward to either set an environment variable or adjust the app.config.