Describe the bug
I created a ubuntu 24.04 virtual machine using virtual box. and then
I compiled the project using below flow:
git clone https://github.com/commaai/openpilot.git
git submodule update --init --recursive
cd openpilot
sudo sed -i '/cdrom/d' /etc/apt/sources.list
tools/op.sh setup
source .venv/bin/activate
git lfs install
git lfs pull
scons -u
But I got a error below:
(openpilot) peter@peter:~/Desktop/openpilot/openpilot$ scons -u
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
Building compilation database compile_commands.json
Retrieved selfdrive/modeld/models/warp_1928x1208_tinygrad.pkl' from cache Retrieved selfdrive/modeld/models/dm_warp_1928x1208_tinygrad.pkl' from cache
Retrieved selfdrive/modeld/models/warp_1344x760_tinygrad.pkl' from cache Retrieved selfdrive/modeld/models/dm_warp_1344x760_tinygrad.pkl' from cache
DEV=CPU CPU_LLVM=1 THREADS=0 python3 /home/peter/Desktop/openpilot/openpilot/selfdrive/modeld/get_model_metadata.py /home/peter/Desktop/openpilot/openpilot/selfdrive/modeld/models/dmonitoring_model.onnx
/home/peter/Desktop/openpilot/openpilot/tinygrad/nn/onnx.py:41: UserWarning: dtype dtypes.half on CPU from buffer parse is not supported, falling back to dtypes.float
warnings.warn(f"dtype {dtype} on {Device.DEFAULT} from {fallback_context} is not supported, falling back to {default_dtype}")
Traceback (most recent call last):
File "/home/peter/Desktop/openpilot/openpilot/selfdrive/modeld/get_model_metadata.py", line 40, in
model = MetadataOnnxPBParser(model_path).parse()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/nn/onnx.py", line 142, in parse
return self._parse_ModelProto()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/selfdrive/modeld/get_model_metadata.py", line 17, in _parse_ModelProto
obj["graph"] = self._parse_GraphProto()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/nn/onnx.py", line 178, in _parse_GraphProto
case 5: obj["initializer"].append(self._parse_TensorProto())
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/nn/onnx.py", line 256, in _parse_TensorProto
data = Tensor(data.item(), dtype=to_dtype).reshape(shape)
^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/tensor.py", line 4113, in _wrapper
ret = fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/tensor.py", line 344, in item
return self.data()[(0,) * len(self.shape)]
^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/tensor.py", line 4087, in _wrapper
if TRACEMETA < 1 or _METADATA.get() is not None: return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/tensor.py", line 332, in data
return self._buffer().as_typed_buffer(self.shape)
^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/tensor.py", line 4087, in _wrapper
if TRACEMETA < 1 or _METADATA.get() is not None: return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/tensor.py", line 318, in _buffer
return cast(Buffer, x.realize().uop.base.buffer).ensure_allocated()
^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/tensor.py", line 4087, in _wrapper
if TRACEMETA < 1 or METADATA.get() is not None: return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/home/peter/.local/share/uv/python/cpython-3.12.13-linux-x86_64-gnu/lib/python3.12/contextlib.py", line 81, in inner
return func(*args, **kwds)
^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/tensor.py", line 276, in realize
run_schedule(*Tensor.schedule_with_vars(*to_realize), do_update_stats=do_update_stats)
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/engine/realize.py", line 195, in run_schedule
ei = schedule.pop(0).lower()
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/engine/realize.py", line 153, in lower
raise e
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/engine/realize.py", line 147, in lower
try: self.prg = cast(Runner, si_lowerer.rewrite(self.ast, self.bufs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/uop/ops.py", line 1057, in rewrite
if (ret:=match(uop, ctx)) is not None and ret is not uop: return ret
^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/uop/ops.py", line 1031, in lazy_compile
return entry[1](uop, ctx)
^^^^^^^^^^^^^^^^^^
File "", line 3, in compiled_match
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/engine/realize.py", line 128, in
(UPat((Ops.SINK, Ops.PROGRAM), name="sink"), lambda ctx,sink: get_runner(ctx[0].device, sink)),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/engine/realize.py", line 121, in get_runner
method_cache[ckey] = method_cache[bkey] = ret = CompiledRunner(replace(prg, device=device))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/engine/realize.py", line 44, in init
p = replace(p, lib=Device[p.device].compiler.compile_cached(p.src))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/device.py", line 280, in compile_cached
lib = self.compile(src)
^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/runtime/support/compiler_cpu.py", line 85, in compile
def compile(self, src:str) -> bytes: return jit_loader(self.compile_to_obj(src)) if self.jit else self.compile_to_obj(src)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/runtime/support/elf.py", line 49, in jit_loader
image, _, relocs = elf_loader(obj, link_libs=link_libs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/runtime/support/elf.py", line 43, in elf_loader
relocs += [(target_image_off + roff, link_sym(_strtab(sh_strtab, sym.st_name), link_libs or []) if sym.st_shndx == 0 else
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/runtime/support/elf.py", line 13, in link_sym
raise RuntimeError(f'Attempting to relocate against an undefined symbol {sym}')
RuntimeError: Attempting to relocate against an undefined symbol __extendhfsf2
scons: *** [selfdrive/modeld/models/dmonitoring_model_metadata.pkl] Error 1
scons: building terminated because of errors.
I tried to modify the file (selfdrive/modeld/SConscript) to set CPU_LLVM=0. There was other errors happened.
OS Version
ubuntu 24.04
openpilot version or commit
No response
Additional info
No response
Describe the bug
I created a ubuntu 24.04 virtual machine using virtual box. and then
I compiled the project using below flow:
git clone https://github.com/commaai/openpilot.git
git submodule update --init --recursive
cd openpilot
sudo sed -i '/cdrom/d' /etc/apt/sources.list
tools/op.sh setup
source .venv/bin/activate
git lfs install
git lfs pull
scons -u
But I got a error below:
(openpilot) peter@peter:~/Desktop/openpilot/openpilot$ scons -u
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
Building compilation database compile_commands.json
Retrieved
selfdrive/modeld/models/warp_1928x1208_tinygrad.pkl' from cache Retrievedselfdrive/modeld/models/dm_warp_1928x1208_tinygrad.pkl' from cacheRetrieved
selfdrive/modeld/models/warp_1344x760_tinygrad.pkl' from cache Retrievedselfdrive/modeld/models/dm_warp_1344x760_tinygrad.pkl' from cacheDEV=CPU CPU_LLVM=1 THREADS=0 python3 /home/peter/Desktop/openpilot/openpilot/selfdrive/modeld/get_model_metadata.py /home/peter/Desktop/openpilot/openpilot/selfdrive/modeld/models/dmonitoring_model.onnx
/home/peter/Desktop/openpilot/openpilot/tinygrad/nn/onnx.py:41: UserWarning: dtype dtypes.half on CPU from buffer parse is not supported, falling back to dtypes.float
warnings.warn(f"dtype {dtype} on {Device.DEFAULT} from {fallback_context} is not supported, falling back to {default_dtype}")
Traceback (most recent call last):
File "/home/peter/Desktop/openpilot/openpilot/selfdrive/modeld/get_model_metadata.py", line 40, in
model = MetadataOnnxPBParser(model_path).parse()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/nn/onnx.py", line 142, in parse
return self._parse_ModelProto()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/selfdrive/modeld/get_model_metadata.py", line 17, in _parse_ModelProto
obj["graph"] = self._parse_GraphProto()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/nn/onnx.py", line 178, in _parse_GraphProto
case 5: obj["initializer"].append(self._parse_TensorProto())
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/nn/onnx.py", line 256, in _parse_TensorProto
data = Tensor(data.item(), dtype=to_dtype).reshape(shape)
^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/tensor.py", line 4113, in _wrapper
ret = fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/tensor.py", line 344, in item
return self.data()[(0,) * len(self.shape)]
^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/tensor.py", line 4087, in _wrapper
if TRACEMETA < 1 or _METADATA.get() is not None: return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/tensor.py", line 332, in data
return self._buffer().as_typed_buffer(self.shape)
^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/tensor.py", line 4087, in _wrapper
if TRACEMETA < 1 or _METADATA.get() is not None: return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/tensor.py", line 318, in _buffer
return cast(Buffer, x.realize().uop.base.buffer).ensure_allocated()
^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/tensor.py", line 4087, in _wrapper
if TRACEMETA < 1 or METADATA.get() is not None: return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/home/peter/.local/share/uv/python/cpython-3.12.13-linux-x86_64-gnu/lib/python3.12/contextlib.py", line 81, in inner
return func(*args, **kwds)
^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/tensor.py", line 276, in realize
run_schedule(*Tensor.schedule_with_vars(*to_realize), do_update_stats=do_update_stats)
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/engine/realize.py", line 195, in run_schedule
ei = schedule.pop(0).lower()
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/engine/realize.py", line 153, in lower
raise e
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/engine/realize.py", line 147, in lower
try: self.prg = cast(Runner, si_lowerer.rewrite(self.ast, self.bufs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/uop/ops.py", line 1057, in rewrite
if (ret:=match(uop, ctx)) is not None and ret is not uop: return ret
^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/uop/ops.py", line 1031, in lazy_compile
return entry[1](uop, ctx)
^^^^^^^^^^^^^^^^^^
File "", line 3, in compiled_match
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/engine/realize.py", line 128, in
(UPat((Ops.SINK, Ops.PROGRAM), name="sink"), lambda ctx,sink: get_runner(ctx[0].device, sink)),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/engine/realize.py", line 121, in get_runner
method_cache[ckey] = method_cache[bkey] = ret = CompiledRunner(replace(prg, device=device))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/engine/realize.py", line 44, in init
p = replace(p, lib=Device[p.device].compiler.compile_cached(p.src))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/device.py", line 280, in compile_cached
lib = self.compile(src)
^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/runtime/support/compiler_cpu.py", line 85, in compile
def compile(self, src:str) -> bytes: return jit_loader(self.compile_to_obj(src)) if self.jit else self.compile_to_obj(src)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/runtime/support/elf.py", line 49, in jit_loader
image, _, relocs = elf_loader(obj, link_libs=link_libs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/runtime/support/elf.py", line 43, in elf_loader
relocs += [(target_image_off + roff, link_sym(_strtab(sh_strtab, sym.st_name), link_libs or []) if sym.st_shndx == 0 else
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/peter/Desktop/openpilot/openpilot/tinygrad/runtime/support/elf.py", line 13, in link_sym
raise RuntimeError(f'Attempting to relocate against an undefined symbol {sym}')
RuntimeError: Attempting to relocate against an undefined symbol __extendhfsf2
scons: *** [selfdrive/modeld/models/dmonitoring_model_metadata.pkl] Error 1
scons: building terminated because of errors.
I tried to modify the file (selfdrive/modeld/SConscript) to set CPU_LLVM=0. There was other errors happened.
OS Version
ubuntu 24.04
openpilot version or commit
No response
Additional info
No response