bandwidthTest example throws cudaErrorCallRequiresNewerDriver error when launched via nv-nsight-cu-cli

I got the following error while installing CUDA 10.2.

[INFO]: Driver not installed.
[INFO]: Checking compiler version...
[INFO]: gcc location: /usr/bin/gcc

[INFO]: gcc version: gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)

[ERROR]: unsupported compiler version: 11.4.0. Use --override to override this check.

To fix that, I installed GCC 8 on Ubuntu 22.04 according to this answer, only to get another error

[INFO]: Driver not installed.
[INFO]: Checking compiler version...
[INFO]: gcc location: /usr/bin/gcc

[INFO]: gcc version: gcc version 8.4.0 (Ubuntu 8.4.0-3ubuntu2)

[INFO]: Initializing menu
[INFO]: Setup complete
[INFO]: Components to install:
[INFO]: Driver
[INFO]: 440.33.01
[INFO]: Executing NVIDIA-Linux-x86_64-440.33.01.run --ui=none --no-questions --accept-license --disable-nouveau --no-cc-version-check --install-libglvnd  2>&1
[INFO]: Finished with code: 256
[ERROR]: Install of driver component failed.
[ERROR]: Install of 440.33.01 failed, quitting

The error message is too ambiguous for me to do anything. Any advice on how to proceed?

For the record, I would rather we fix the driver issue on CUDA 12.3 than try to install CUDA 10.2. The latter is hopelessly outdated, and the bundled driver version 440.33.01 has already reached its end of life. I wish I could just install CUDA 12.3 normally. Newer drivers are supposed to work with old CUDA versions, aren’t they?