I want to disable GPU from Python program.
I tried but the program is still using GPU. I am using Dlib face recognition.
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # see issue #152
os.environ["CUDA_VISIBLE_DEVICES"] = ""
Try this instead:
os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
The docs recommend using an invalid index (-1) instead of trying to pass a blank value; setting this value to something blank is something that various people have come up with on their own but doesn't always seem to work. Source: https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#env-vars
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With