gao-lab / Cell_BLAST

A BLAST-like toolkit for large-scale scRNA-seq data querying and annotation.
http://cblast.gao-lab.org
MIT License
82 stars 13 forks source link

How to use gpu to accelerate train? #15

Closed caiquanyou closed 3 years ago

caiquanyou commented 3 years ago

@Jeff1995 I install tensorflow-gpu , How to use gpu to accelerate train? How I can make sure that I use gpu not cpu?

Jeff1995 commented 3 years ago

If you installed tensorflow-gpu correctly, Cell BLAST would use GPU automatically. You can check nvidia-smi to see if GPU is being used. Also the output would show something like:

2021-01-27 12:06:32.738507: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1511] Adding visible gpu devices: 0
2021-01-27 12:06:32.738570: I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] Device interconnect StreamExecutor with strength 1 edge matrix:
2021-01-27 12:06:32.738582: I tensorflow/core/common_runtime/gpu/gpu_device.cc:988]      0
2021-01-27 12:06:32.738607: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1001] 0:   N
2021-01-27 12:06:32.738738: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 10237 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080 Ti, pci bus id: 0000:83:
00.0, compute capability: 6.1)
caiquanyou commented 3 years ago

OK。thanks

RuiyuRayWang commented 2 years ago

Hi, I have more question on this issue. On which step should we expect to see the output? fit_DIRECTi?

If you installed tensorflow-gpu correctly, Cell BLAST would use GPU automatically. You can check nvidia-smi to see if GPU is being used. Also the output would show something like:

2021-01-27 12:06:32.738507: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1511] Adding visible gpu devices: 0
2021-01-27 12:06:32.738570: I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] Device interconnect StreamExecutor with strength 1 edge matrix:
2021-01-27 12:06:32.738582: I tensorflow/core/common_runtime/gpu/gpu_device.cc:988]      0
2021-01-27 12:06:32.738607: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1001] 0:   N
2021-01-27 12:06:32.738738: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 10237 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080 Ti, pci bus id: 0000:83:
00.0, compute capability: 6.1)