How do you disable gpu from being utilized?

How severe does this issue affect your experience of using Ray?

  • None

I have tried setting num_gpus=0, os.environ [‘CUDA_AVAILABLE_DEVICES’] = ‘-1’, os.environ[“RLLIB_NUM_GPUS”] = “0”, and even uninstalling cuda entirely. But for some reason, it still utilizes the gpu when training the agent. The environment is using PettingZoo with Pygame, render is disabled.

One thing you could try:

import os
os.environ[“CUDA_VISIBLE_DEVICES”] = “some_string_which_is_NOT_gpu_name”
from torch.cuda import device_count
print('Number of Devices: ', device_count())

I just use torch to count the devices, the CUDA_VISIBLE_DEVICES setting is not torch specific but should also work for tf.

I have tried using os.environ[“CUDA_VISIBLE_DEVICES”] but Ray still uses GPU vram. When I run the code on AMD GPU it doesn’t consume any vram.