Verifying if GPU is actually used in Keras/Tensorflow, not just verified as present

前端 未结 2 1213
北荒
北荒 2021-01-15 23:33

I\'ve just built a deep learning rig (AMD 12 core threadripper; GeForce RTX 2080 ti; 64Gb RAM). I originally wanted to install CUDnn and CUDA on Ubuntu 19.0, but the install

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-16 00:22

    Another way to analyse the performance of the GPU which I ended up finding (for Windows users) was to go to the "Task Manager" and change one of the Monitors in the "Performance" tab to CUDA, then simply run the script and watch it spike.

    Also adding this

    os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
    

    before the keras import to toggle between CPU and GPU also shows a remarkable difference (although for my simple network, the quicker CPU can be explained here).

提交回复
热议问题