Hi,I heard that root 6.26 will support RooFit automatic GPU acceleration. I tried it soon using
auto result = pdf.fitTo(*data, RooFit::BatchMode(“GPU”), RooFit::Save());
just like ACAT 2021 (29 November 2021 - 3 December 2021): Accelerating RooFit with GPUs · Indico . but it report
Only supported string values for BatchMode() are “off”, “cpu”, or “cuda”.
then i changed BatchMode(“GPU”)
to BatchMode(“cuda”)
, my terminal report
terminate called after throwing an instance of ‘std::runtime_error’
what(): In: RooFitDriver(), /home/conda/feedstock_root/build_artifacts/root_base_1646481317233/work/root-source/roofit/roofitcore/src/RooFitDriver.cxx:201: Cuda implementation of the computing library is not available
I wonder how i can use GPU acceleration succesfully.
Here is my code
using namespace RooFit;
void test()
{
RooRealVar x(“x”,“x”,-10,10);
RooRealVar mean(“mean”,“mean”,0,-5,5);
RooRealVar width(“width”,“width”,0.1,0.01,5);
RooGaussian model(“model”,“model”,x,mean,width);
RooDataSet *data=model.generate(x,1000);
auto r1=model.fitTo(*data,Save(),RooFit::BatchMode(“cuda”));
}
Thanks