# TMVA does not work on GPU with ROOT 6.18

**URL:** <https://root-forum.cern.ch/t/tmva-does-not-work-on-gpu-with-root-6-18/35872>\
**Category:** TMVA\
**Created:** [September 4, 2019, 7:58am UTC](https://root-forum.cern.ch/t/tmva-does-not-work-on-gpu-with-root-6-18/35872 "2019-09-04T07:58:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hercules\_Jack](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/hercules_jack/32/19354_2.png) [@Hercules\_Jack](https://root-forum.cern.ch/u/Hercules_Jack)\
**Post date:** [September 4, 2019, 7:58am UTC](https://root-forum.cern.ch/t/tmva-does-not-work-on-gpu-with-root-6-18/35872/1 "2019-09-04T07:58:53Z")

</div>

Hi ROOT experts,

I just upgraded ROOT from 6.16 to 6.18. I installed ROOT 6.18 with:

> /home/testroot/cmake/3.14/bin/cmake -DCMAKE\_INSTALL\_PREFIX=/home/testroot/root/618 …/root-6.18.00 -DCMAKE\_BUILD\_TYPE=RELEASE -Dtmva=on -Dcuda=on -Dtestring=on -Droofit=on -Dfftw3=on -Dclad=off -Dfail-on-missing=OFF -Dxrootd=off -Dpython=on -DCUDA\_TOOLKIT\_ROOT\_DIR=/usr/local/cuda-10.1/ -DCUDA\_INCLUDE\_DIRS=/usr/local/cuda-10.1/include -DCUDA\_CUDART\_LIBRARY=/usr/local/cuda-10.1/lib -DCUDA\_NVCC\_EXECUTABLE=/usr/local/cuda-10.1/bin -DCMAKE\_CUDA\_COMPILER=/usr/local/cuda-10.1/bin/nvcc -DPYTHON\_EXECUTABLE=/usr/bin/python2.7 -DPYTHON\_INCLUDE\_DIR=/usr/include/python2.7 -DPYTHON\_LIBRARY=/usr/lib/python2.7/config-x86\_64-linux-gnu/libpython2.7.so -Dbuiltin\_vdt=on  
> make -j6 #if find error, use  
> #cmake --build . – -j6  
> #make install –j5

With ROOT 6.16, TMVA worked fine on both CPU and GPU, but now I had some problem with ROOT 6.18. I tried to run `root-6.18.02/tmva/tmva/test/DNN/CNN/TestMethodDLCNN.cxx`, where I changed `TString archCPU = "CPU"` to `TString archCPU = "GPU"`. But then it said:

> : CUDA backend not enabled. Please make sure you have CUDA installed and it was successfully detected by CMAKE by using -Dcuda=On  
> : Will use now the CPU architecture !

It still worked fine on CPU though.

So can you please give me some idea how to solve this problem? Thanks!

---

<div class="post-metadata">

**Author:** ![amadio](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/amadio/32/12562_2.png) [@amadio](https://root-forum.cern.ch/u/amadio)\
**Post date:** [September 4, 2019, 8:24am UTC](https://root-forum.cern.ch/t/tmva-does-not-work-on-gpu-with-root-6-18/35872/2 "2019-09-04T08:24:50Z")

</div>

You need to enable `-Dtmva-gpu=ON`, do you have that enabled?

---

<div class="post-metadata">

**Author:** ![Hercules\_Jack](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/hercules_jack/32/19354_2.png) [@Hercules\_Jack](https://root-forum.cern.ch/u/Hercules_Jack)\
**Post date:** [September 5, 2019, 10:34pm UTC](https://root-forum.cern.ch/t/tmva-does-not-work-on-gpu-with-root-6-18/35872/3 "2019-09-05T22:34:19Z")

</div>

I tried to enable that and it works now. Thanks for your help!
