[Redmi Note 10] wvthoog:
Hi,

so I've build ROM before (LineageOS and more recently Pixel Experience) but am running into an error which might be just a syntax problem in one of the source files. Before messing things up by editing these files myself, wanted to ask here which best course of action to take. (target phone: Redmi Note 10 Pro)

My build setup is a Proxmox 7 server hosting an Ubuntu 20.04 VM which has a Nvidia vGPU installed.

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Mon_Nov_30_19:08:53_PST_2020
Cuda compilation tools, release 11.2, V11.2.67
Build cuda_11.2.r11.2/compiler.29373293_0

The build starts, but after completing the kernel compilation the following error occurs.

In file included from ../../../../../../kernel/xiaomi/sm6150/init/version.c:9:
./include/generated/compile.h:7:24: warning: missing terminating '"' character [-Winvalid-pp-token]
#define LINUX_COMPILER "Android (6877366 based on r383902b1) clang version 11.0.2 (https://android.googlesource.com/toolchai
n/llvm-project b397f81060ce6d701042b782172ed13bee898b79)
^
./include/generated/compile.h:8:1: error: unknown type name 'Found'
Found CUDA installation: /usr/local/cuda, version 7.0, GNU ld (binutils-2.27-bd24d23f) 2.27.0.20170315"
^
./include/generated/compile.h:8:11: error: expected ';' after top level declarator
Found CUDA installation: /usr/local/cuda, version 7.0, GNU ld (binutils-2.27-bd24d23f) 2.27.0.20170315"
^
;
./include/generated/compile.h:8:103: warning: missing terminating '"' character [-Winvalid-pp-token]
Found CUDA installation: /usr/local/cuda, version 7.0, GNU ld (binutils-2.27-bd24d23f) 2.27.0.20170315"
^
In file included from ../../../../../../kernel/xiaomi/sm6150/init/version.c:10:
In file included from ../../../../../../kernel/xiaomi/sm6150/include/linux/module.h:9:
In file included from ../../../../../../kernel/xiaomi/sm6150/include/linux/list.h:5:
../../../../../../kernel/xiaomi/sm6150/include/linux/types.h:102:10: error: unknown type name '__s8'; did you mean '__u8'?
typedef __s8 int8_t;
^~~~
__u8
../../../../../../kernel/xiaomi/sm6150/include/uapi/asm-generic/int-ll64.h:21:23: note: '__u8' declared here
typedef unsigned char __u8;
^
../../../../../../kernel/xiaomi/sm6150/init/version.c:46:26: error: expected ';' after top level declarator
LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION "\n";
^
;
../../../../../../kernel/xiaomi/sm6150/init/version.c:51:6: error: expected ';' after top level declarator
" (" LINUX_COMPILER ") %s\n";
^
;
2 warnings and 5 errors generated.
make[2]: *** [/home/wvthoog/android/pixel-experience/kernel/xiaomi/sm6150/scripts/Makefile.build:361: init/version.o] Error
1
make[2]: *** Waiting for unfinished jobs....

Like i said before, it looks like there are some syntax errors somewhere in one of the sourcefiles but at this point have no clue which files to edit to remedy this error.

Also, if i compile the same ROM for my Redmi Note 10 Pro (sweet) on another VM (Ubuntu 20.04) without a Nvidia GPU the build succeeds .

This sounds like a bug somewhere in one of the source files of Pixel Experience. Tried filing an issue on their Github page but their bot is fairly aggressive in closing issues if they don't meet their posting requirements.

So my question drills down to.... do other experience the same problem when using CUDA during the build process of Pixel Experience and possibly have a solution ?

Secondly, is there an option to disable CUDA during the build process ?

Thanks