1

I'm using Ubunut 22.04, I want to install nvidia driver: sudo ./cuda_12.1.0_530.30.02_linux.run, but I get a warning first:

   warning: the compiler differs from the one used to build the kernel
     The kernel was built by: x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0
     You are using:           cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
   
   Warning: Compiler version check failed:
   
   The major and minor number of the compiler used to
   compile the kernel:
   
   x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38
   
   does not match the compiler used here:
   
   cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

I already followed this solution to change the version to 12.3, and when I check from the terminal I get gcc/g++ version 12.3.

Finally I get an error: cc: error: unrecognized command-line option '-ftrivial-auto-var-init=zero', can you please tell me how can I solve that? thanks in advance.

1

1 Answer 1

1

Defining the gcc version explicitly

CC="gcc-12" sudo ./cuda_12.1.0_530.30.02_linux.run

solved this issue.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.