Opened 9 years ago

Closed 8 years ago

#572 closed defect (fixed)

allow user to control where to run the model

Reported by: pkienzle Owned by: wojciech
Priority: major Milestone: SasView 4.0.0
Component: SasView Keywords:
Cc: Work Package: SasView Bug Fixing

Description

We need to be able to control where the model is run from within sasview (GPU vs. CPU). On lower end GPUs and bigger models the code may run very slowly or even segmentation fault. We saw this with the Hayter MSA kernel but got around it by setting single=False (which happens to be necessary for this model). This worked because older lower end hardware doesn't support double precision, but may not work if users write complicated models that fail in double precision on higher end hardware.

At a minimum we need to be able to shut off GPU processing for the sasview installation if the hardware doesn't even support single precision models. The Intel HD 3000 chipset on older macbooks for example will have this problem for some models. Controlling this on a per-model basis might be useful, especially if we can query the GPU capabilities and estimate the model complexity so that good defaults appear automatically.

This is a major bug since a user defined model might crash the program if run on the GPU, and they currently have no easy way to get around it. Setting the PYOPENCL_CTX environment variable would work but is not easy for the user and interferes with other programs.

Change History (5)

comment:1 Changed 9 years ago by pkienzle

We may want to default to only using the GPU if it is in a list of known good devices, otherwise the user will have to activate it themselves.

For custom models, setting GPU=False in the model definition may be good enough. The user controls the model and the device it is running on. This means we don't have to have extra clutter in the GUI.

We may be able to give a device a rating based on the opencl info such as LOCAL_MEM_SIZE, GLOBAL_MEM_SIZE, MAX_COMPUTE_UNITS, MAX_CLOCK_FREQUENCY; we may be able to give the code a rating by looking at code size and number of parameters and measuring how long it takes to run on the CPU; still need the amount of local memory per thread to make a good decision.

comment:2 Changed 8 years ago by wojciech

  • Owner set to wojciech
  • Status changed from new to assigned

comment:3 Changed 8 years ago by wojciech

The issue seems to be resolved. I need to update documentation and link it properly to close the ticket. At the moment the documentation resides in: sasmodels/doc/ref/compilation.rst

comment:4 Changed 8 years ago by wojciech

The relevant documentation is in SasView? user section. sasview/docs/sphinx-docs/source/user/gpu_coputations.rst and sasview/docs/sphinx-docs/source/user/opencl_installation.rst

comment:5 Changed 8 years ago by wojciech

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.