CUDA 10.1 Update 2 is compatible to gcc 7.3.0, mine is 7.4.0, is this the cause the installation failed?

I downloaded the cuda installer from here.

I ran the installer on Ubuntu 18.04 LTS (Bionic Beaver) with gcc 7.4.0.

and I got this error.

[INFO]: Driver not installed. [INFO]: Checking compiler version... [INFO]: gcc location: /usr/bin/gcc  [INFO]: gcc version: gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)  [INFO]: Initializing menu [INFO]: Setup complete [INFO]: Components to install: [INFO]: Driver [INFO]: 418.87.00 [INFO]: Executing NVIDIA-Linux-x86_64-418.87.00.run --ui=none --no-questions --accept-license --disable-nouveau --no-cc-ver$   [INFO]: Finished with code: 256 [ERROR]: Install of driver component failed. [ERROR]: Install of 418.87.00 failed, quitting 

This table indicates the compatible gcc is 7.3.0, is this the reason causes installation failed? Do I need to reinstall or downgrade gcc?