source: sasview/docs/sphinx-docs/source/user/gpu_computations.rst @ 7c05b63

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since 7c05b63 was 6e0c7b2, checked in by wojciech, 8 years ago

Documentation added for gpu computations of sasmodels (related to ticket #572)

  • Property mode set to 100644
File size: 2.5 KB
RevLine 
[6e0c7b2]1.. _models-complitation:
2
3****************
4GPU Computations
5****************
6SasView model evaluations can run on your graphics card (GPU) or they can run
7on the processor (CPU).
8
9To run on the GPU, your computer must have OpenCL drivers installed.
10For information about OpenCL installation see the
11:ref:`opencl-installation` documentation
12
13Where the model is evaluated is a little bit complicated.
14If the model has the line *single=False* then it requires double precision.
15If the GPU is single precision only, then it will try running via OpenCL
16on the CPU.  If the OpenCL driver is not available for the CPU then
17it will run as a normal program on the CPU.
18For models with a large number of parameters or with a lot of code,
19the GPU may be too small to run the program effectively.
20In this case, you should try simplifying the model, maybe breaking it
21into several different models so that you don't need if statements in your code.
22If it is still too big, you can set *opencl=False* in the model file and
23the model will only run as a normal program on the CPU.
24This will not usually be necessary.
25
26If you have multiple GPU devices you can tell SasView which device to use.
27By default, SasView looks for one GPU and one CPU device
28from available OpenCL platforms.
29
30It prefers AMD or NVIDIA drivers for GPU, and prefers Intel or
31Apple drivers for CPU.
32Both GPU and CPU are included on the assumption that CPU is always available
33and supports double precision.
34
35The device order is important: GPU is checked before CPU on the assumption that
36it will be faster. By examining ~/sasview.log you can see which device SasView
37chose to run the model.
38If you don't want to use OpenCL, you can set *SAS_OPENCL=None*
39in the environment, and it will only use normal programs.
40If you want to use one of the other devices, you can run the following
41from the python console in SasView::
42
43    import pyopencl as cl
44    cl.create_some_context()
45
46This will provide a menu of different OpenCL drivers available.
47When one is selected, it will say "set PYOPENCL_CTX=..."
48Use that value as the value of *SAS_OPENCL*.
49
50For models run as normal programs, you may need to specify a compiler.
51This is done using the SAS_COMPILER environment variable.
52Set it to *tinycc* for the tinycc compiler, *msvc* for the
53Microsoft Visual C compiler, or *mingw* for the MinGW compiler.
54TinyCC is provided with SasView so that is the default.
55If you want one of the other compilers, be sure to have it available
56on the path so SasView can find it.
Note: See TracBrowser for help on using the repository browser.