Rasa x not use GPU

Hi everyone. I installed Rasa x full from belowing link via docker compose. [Docker Compose Installation](https://Rasa x docker compose)

I insert approximately 100-150 nlu,response,story data. When i train model it takes 5-6 min. It use CPU. My machine has GPU. I installed tensorflow and nvidia drivers from here. https://www.tensorflow.org/install/gpu

But when i train my model it still use cpu. I run nvidia-smi command it says you have gpu driver s but no runnign processes found.

After this i tried belowing operations;

sudo mkdir -p /etc/systemd/system/docker.service.d sudo tee /etc/systemd/system/docker.service.d/override.conf <<EOF [Service] ExecStart= ExecStart=/usr/bin/dockerd --host=fd:// --add-runtime=nvidia=/usr/bin/nvidia-container-runtime EOF sudo systemctl daemon-reload sudo systemctl restart docker

nano /etc/docker/daemon.json

{ “default-runtime”: “nvidia”, “runtimes”: { “nvidia”: { “path”: “/usr/bin/nvidia-container-runtime”, “runtimeArgs”: [] } } } sudo pkill -SIGHUP dockerd systemctl daemon-reload systemctl restart docker

But it still not use.

I changed my docker-compose file like;

in services area insert nvsmi test service; nvsmi: image: ubuntu:18.04 environment: NVIDIA_VISIBLE_DEVICES: all NVIDIA_DRIVER_CAPABILITIES: all command: nvidia-smi

I run new compose file then nvsmi container return gpu driver list(as expected) I added belowing value in environment area to x-rasa-services: &default-rasa-service and rasa-production and rasa-worker NVIDIA_VISIBLE_DEVICES: all NVIDIA_DRIVER_CAPABILITIES: all

But it still not use.

I tried belowing code in python it uses my GPU import tensorflow as tf tf.debugging.set_log_device_placement(True) a = tf.constant([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]) b = tf.constant([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]) c = tf.matmul(a, b)


How can i use my gpu in rasa. Please help me?

My OS version: Ubuntu 18.04 rasa 2.1.2 full version docker-compose version: 1.26.0 tensorflow: 2.4.0 python version: 2.7.17, 3, 3.6(multiple version) NVIDIA-SMI 460.27.04 Driver Version: 460.27.04 CUDA Version: 11.2


I use python 3.7 and downgrade tensorflow 2.3.1 but result not changed. Still it doesnt use GPU.

What are the Rasa 2.1.2 requirements? (tensorflow,python etc version) I did not find it anywhere. Maybe this is version compatibility problem.

I have the same problem. Since I don`t have much experience with docker I decided to try Rasa local install. First I had latest CUDA 11.3 and tensorflow 2.4 but noticed that local Rasa installs 2.3.2 despite the presence of 2.4. Therefore I uninstalled all tensorflow versions, installed tensorflow 2.3.2. Installed CUDA 10.1 (version which was tested with TF 2.3.2) and cudnn 7.6.

When I run rasa train from command line, it works and use GPU for training.

Then I tried to reinstall Rasa X from docker but it didn`t want to use GPU. May be your changes to docker compose file will help. But it will be great if somebody with docker experience will fix Rasa X dockers to be able to use GPU