Requirements for TFJS on GPU: Trying to Compare the performance of TFJS-node and TFJS-node-GPU

350 Views Asked by At

I tried to use an NVIDIA GeForce RTX 1080Ti GPU PC Card to work with TFJS and followed the hardware and software requirements as stated in the documentation, but I could not see a drastic difference in performance yet. Seems like it's ignoring the GPU.

I am unsure if I’m following the correct guidelines as the above documentation seems like it’s for Tensorflow Python.

Do I need to do some more settings for using the GPU version of TensorFlow.js node?

1

There are 1 best solutions below

0
On

Difference in performance is massive in anything but trivial tasks (where CPU is faster simply because it takes time to get ops and data to&from GPU)

Like you said, its probably not using GPU to start with - which is most commonly due to cuda issues (its non-trivial to get cuda installation & versions right).

Increase tensorflow logging info: export TF_CPP_MIN_LOG_LEVEL=0 before running node app, you should see something like this in the output when its using GPU:

tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 9575 MB memory:  -> device: 0, name: NVIDIA GeForce RTX 3060, pci bus id: 0000:01:00.0, compute capability: 8.6

If you don't see that, go back to docs and make sure cuda is installed correctly.