|
|
@ -56,17 +56,15 @@ for model_name in ['driving_vision', 'driving_policy', 'dmonitoring_model']: |
|
|
|
tg_compile(flags, model_name) |
|
|
|
tg_compile(flags, model_name) |
|
|
|
|
|
|
|
|
|
|
|
# Compile BIG model if USB GPU is available |
|
|
|
# Compile BIG model if USB GPU is available |
|
|
|
import subprocess |
|
|
|
if "USBGPU" in os.environ: |
|
|
|
from tinygrad import Device |
|
|
|
import subprocess |
|
|
|
|
|
|
|
# because tg doesn't support multi-process |
|
|
|
# because tg doesn't support multi-process |
|
|
|
devs = subprocess.check_output('python3 -c "from tinygrad import Device; print(list(Device.get_available_devices()))"', shell=True, cwd=env.Dir('#').abspath) |
|
|
|
devs = subprocess.check_output('python3 -c "from tinygrad import Device; print(list(Device.get_available_devices()))"', shell=True, cwd=env.Dir('#').abspath) |
|
|
|
if b"AMD" in devs: |
|
|
|
if b"AMD" in devs: |
|
|
|
print("USB GPU detected... building") |
|
|
|
del Device |
|
|
|
flags = "AMD=1 AMD_IFACE=USB AMD_LLVM=1 NOLOCALS=0 IMAGE=0" |
|
|
|
print("USB GPU detected... building") |
|
|
|
bp = tg_compile(flags, "big_driving_policy") |
|
|
|
flags = "AMD=1 AMD_IFACE=USB AMD_LLVM=1 NOLOCALS=0 IMAGE=0" |
|
|
|
bv = tg_compile(flags, "big_driving_vision") |
|
|
|
bp = tg_compile(flags, "big_driving_policy") |
|
|
|
lenv.SideEffect('lock', [bp, bv]) # tg doesn't support multi-process so build serially |
|
|
|
bv = tg_compile(flags, "big_driving_vision") |
|
|
|
else: |
|
|
|
lenv.SideEffect('lock', [bp, bv]) # tg doesn't support multi-process so build serially |
|
|
|
print("USB GPU not detected... skipping") |
|
|
|
else: |
|
|
|
|
|
|
|
print("USB GPU not detected... skipping") |
|
|
|
|
|
|
|