how to activate GPU for R

As far as I know, activating GPU in Python should be done by this code

## choose GPU=0
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
 os.environ["CUDA_VISIBLE_DEVICES"]="0"

But I don't know about R and I haven't found it.
Is there anybody who knows about that?
Thanks in advance

The equivalent commands in R would be

Sys.setenv(CUDA_DEVICE_ORDER="PCI_BUS_ID")
Sys.setenv(CUDA_VISIBLE_DEVICES="0")
```

this would set the environment variables as specified. You can check the parameter values by running 

```
Sys.getenv("CUDA_DEVICE_ORDER")
Sys.getenv("CUDA_VISIBLE_DEVICES")
```
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.