title: Cronjob with task utilizing GPU in Ubuntu
body: <p>Recently I want to utilize cronjob to do some tasks with the GPU memory periodically.
  Here is the information:</p>
  <ol>
  <li>Ubuntu 20.04</li>
  <li>Tensorflow 2.0</li>
  <li>Python 3.7</li>
  <li>Cuda 10.0</li>
  <li>Anaconda</li>
  </ol>
  <p>My cronjob is simply calling a python script with a task running with GPU.
  I can successfully run my python script with command and it can successfully utilize the GPU.
  However, when I use the cronjob to periodically switch the conda environment and trigger the script, it can only use CPU to process the task.</p>