GPU not getting detected when lspci | grep NVIDIA is run

I have a Nvidia Geforce RTX 2080 GPU on an Ubuntu 18.04 machine. When I run lspci | grep NVIDIA command, the GPU is not getting detected.
But when I run nvidia-smi it shows the GPU. Below is the output.

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 510.54       Driver Version: 510.54       CUDA Version: 11.6     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:86:00.0 Off |                  N/A |
| 36%   34C    P0    37W / 250W |      0MiB / 11264MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

Furthermore I am running a JavaScript code which is not able to detect GPU.
Can anyone please help me with that?