I'm not sure that Tensorflow's XLA:CPU and XLA:GPU would be "removed in subsequent releases." XLA:CPU is described as providing access to the CPU while the GPU is executing the code for modeling Tensorflow. The XLA functionality, when its environmental variable is set, allows the CPU to "help out" at specific, critical performance stages and thus to accelerate the processes one might usually think the GPU is needed for. This is explained in https://www.tensorflow.org/xla.
I had not found really clear instructions on how to set the required environmental variables in R or, more specifically, Rstudio. In another blog, an individual suggested (a) adding an environmental path variable to open up XLA in general, but then another one specifically for use by Tensorflow.
Setting up the right environmental variable(s) may vary by operating system, scripting program (Python vs R vs Windows Ubuntu), and which CUDA and CUDNN versions are installed.
The most important thing for me was to look at the output for the specific environmental variable which was not set and thus caused XLA to not activate. But also, XLA may need to be activated in the entire R session or script.
In my case, using Ubuntu 20.04 to run Rstudio 2021.09.0 with an NVIDIA GPU and driver version 470.57.02, CUDA-11.4 and CUDNN8_8.2.4.15 (which goes with CUDA 11.4), the following two R Setenv() commands caused my own "XLA error" to go away within the output from my Rstudio script:
Sys.setenv("XLA_FLAGS=--xla_gpu_cuda_data_dir"="/usr/local/cuda-11.4")
Sys.setenv("TF_XLA_FLAGS"="--tf_xla_enable_xla_devices")
Notice that both environment variables are set and the directory for xla_gpu_cuda_data is correctly named in /usr/local/cuda-11.X.
In addition, the environmental PATH and LD_LIBRARY_PATH variables as set in the user's profile script(s) (mine is .profile) upon reboot (or source command in the terminal) need to also indicate the correct cuda directories.