laugh12321/TensorRT-YOLO

[Bug]: pycuda.driver.CompileError: nvcc compilation of kernel.cu failed on Jetson

Closed this issue · 0 comments

I am encountering an error while attempting to run the detect.py script on my Jetson board. The error message is as follows:

Traceback (most recent call last):
  File "detect.py", line 67, in <module>
    model = YOLO(opt.weights, reduce(mul, opt.max_image_size))
  File "/home/nvidia/Documents/TensorRT-YOLO/python/infer/yolo.py", line 54, in __init__
    self._init_cuda_kernel()
  File "/home/nvidia/Documents/TensorRT-YOLO/python/infer/yolo.py", line 69, in _init_cuda_kernel
    preprocess = SourceModule(open(ROOT / 'preprocess.cu').read())
  File "/home/nvidia/.local/lib/python3.8/site-packages/pycuda/compiler.py", line 355, in __init__
    cubin = compile(
  File "/home/nvidia/.local/lib/python3.8/site-packages/pycuda/compiler.py", line 304, in compile
    return compile_plain(source, options, keep, nvcc, cache_dir, target)
  File "/home/nvidia/.local/lib/python3.8/site-packages/pycuda/compiler.py", line 154, in compile_plain
    raise CompileError(
pycuda.driver.CompileError: nvcc compilation of /tmp/tmpqnmtbwww/kernel.cu failed
[command: nvcc --cubin -arch sm_87 -I/home/nvidia/.local/lib/python3.8/site-packages/pycuda/cuda kernel.cu]
[stderr:
kernel.cu(5): warning: attribute "__global__" does not apply here

kernel.cu(5): error: incomplete type is not allowed

kernel.cu(5): error: identifier "uint8_t" is undefined

kernel.cu(5): error: identifier "src" is undefined

kernel.cu(5): error: type name is not allowed

kernel.cu(5): error: expected a ")"

kernel.cu(8): warning: parsing restarts here after previous syntax error

kernel.cu(8): error: expected a ";"

kernel.cu(31): warning: parsing restarts here after previous syntax error

kernel.cu(32): error: "uint8_t" is not a type name

kernel.cu(32): error: identifier "y_low" is undefined

kernel.cu(32): error: identifier "src_line_size" is undefined

kernel.cu(32): error: identifier "x_high" is undefined

kernel.cu(33): error: "uint8_t" is not a type name

kernel.cu(33): error: identifier "y_high" is undefined

kernel.cu(33): error: identifier "x_low" is undefined

kernel.cu(34): error: "uint8_t" is not a type name

kernel.cu(37): error: this declaration has no storage class or type specifier

kernel.cu(37): error: identifier "w1" is undefined

kernel.cu(37): error: identifier "v1" is undefined

kernel.cu(37): error: identifier "w2" is undefined

kernel.cu(37): error: identifier "w3" is undefined

kernel.cu(37): error: identifier "w4" is undefined

kernel.cu(38): error: this declaration has no storage class or type specifier

kernel.cu(39): error: this declaration has no storage class or type specifier

kernel.cu(43): error: this declaration has no storage class or type specifier

kernel.cu(43): error: variable "c2" has already been defined

kernel.cu(44): error: this declaration has no storage class or type specifier

kernel.cu(44): error: variable "c0" has already been defined

kernel.cu(47): error: this declaration has no storage class or type specifier

kernel.cu(47): error: variable "c0" has already been defined

kernel.cu(47): error: expected a ";"

kernel.cu(48): error: this declaration has no storage class or type specifier

kernel.cu(48): error: variable "c1" has already been defined

kernel.cu(48): error: expected a ";"

kernel.cu(49): error: this declaration has no storage class or type specifier

kernel.cu(49): error: variable "c2" has already been defined

kernel.cu(49): error: expected a ";"

kernel.cu(52): error: identifier "dst_width" is undefined

kernel.cu(52): error: identifier "dst_height" is undefined

kernel.cu(53): error: identifier "dst" is undefined

kernel.cu(53): error: identifier "dy" is undefined

kernel.cu(53): error: identifier "dx" is undefined

kernel.cu(57): error: this declaration has no storage class or type specifier

kernel.cu(57): error: variable "pdst_c0" has already been defined

kernel.cu(57): error: a value of type "int" cannot be used to initialize an entity of type "int *"

kernel.cu(58): error: this declaration has no storage class or type specifier

kernel.cu(58): error: variable "pdst_c1" has already been defined

kernel.cu(58): error: a value of type "int" cannot be used to initialize an entity of type "int *"

kernel.cu(59): error: this declaration has no storage class or type specifier

kernel.cu(59): error: variable "pdst_c2" has already been defined

kernel.cu(59): error: a value of type "int" cannot be used to initialize an entity of type "int *"

kernel.cu(60): error: expected a declaration

At end of source: warning: parsing restarts here after previous syntax error

50 errors detected in the compilation of "kernel.cu".
]