Skip to content

gpu utilization rate 0 or near 0 #4658

@yutao-li

Description

@yutao-li

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-143-generic x86_64)
  • Ray installed from (source or binary): pip install ray[rllib]==0.6.4
  • Ray version:0.6.4
  • Python version:3.7.3
  • Exact command to reproduce:
    curl -O https://repo.anaconda.com/archive/Anaconda3-2019.03-Linux-x86_64.sh
    sh Anaconda3-2019.03-Linux-x86_64.sh -y
    source ~/.bashrc
    conda install -y keras tensorflow-gpu pandas numpy matplotlib psutil
    pip install gym ray[rllib]==0.6.4 ray[debug]==0.6.4

Describe the problem

I use ddpg algorithm in rllib to train in the pendulum env,
Screenshot from 2019-04-18 12-49-21
Screenshot from 2019-04-18 12-45-38

and I find that the gpu utilization rate is near 0, while cpu usage is 100%, why is that? Actually, I am just testing the gpu usage with this toy example, and I am currently attempting to train ddpg with offline dataset, in that case, the gpu utilization is 0, although the process is allocated.

Source code / logs

the code is as follows,

import os
import ray.rllib.agents.ddpg as ddpg
import ray
from ray.tune.logger import pretty_print
from ray.tune import run_experiments
ray.init(num_gpus=1, temp_dir='/tmp/yutao')
config = ddpg.DEFAULT_CONFIG.copy()
config.update({
    'num_workers': 1,
    "input_evaluation": [],
    'num_cpus_per_worker': 6,
    'num_gpus_per_worker': 1,
    'num_gpus': 1,
    'exploration_final_eps': 0,
    'exploration_fraction': 0
})
agent = ddpg.DDPGAgent(config=config, env="Pendulum-v0")
for i in range(10000):
    result = agent.train()
    print(pretty_print(result))

    if i % 200 == 0:
        checkpoint = agent.save(os.getcwd() + '/checkpoint/')
        print("checkpoint saved at", checkpoint)

below is the output during training, I interrupt it in advance in light of the training time.
log.txt

please remind me if other information is needed, since I haven't posted an issue before, I don't know what is needed, thanks!

Metadata

Metadata

Assignees

Labels

questionJust a question :)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions