Skip to content

Instantly share code, notes, and snippets.

@nagadomi
Last active May 21, 2023 07:39
Show Gist options
  • Save nagadomi/b878dc37468b5ffe141d1c2d2984334b to your computer and use it in GitHub Desktop.
Save nagadomi/b878dc37468b5ffe141d1c2d2984334b to your computer and use it in GitHub Desktop.
build onnxruntime-web webgpu on Ubuntu
#!/bin/bash
export NODE_OPTIONS=""
git submodule sync --recursive
git submodule update --init --recursive
BUILD_DIR=build_jsep_st
rm -fr ${BUILD_DIR}
cd cmake/external/emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
cd -
./build.sh --config Debug --enable_wasm_debug_info --skip_submodule_sync --build_wasm --skip_tests --enable_wasm_simd --use_jsep --target onnxruntime_webassembly --build_dir ${BUILD_DIR}
#!/bin/bash
export NODE_OPTIONS=" --max_old_space_size=4096 --dns-result-order=ipv4first "
BUILD_DIR=build_jsep_st/Debug
cd js
npm ci
cd common
npm ci
cd ../web
npm ci
npm run pull:wasm
cp ../../${BUILD_DIR}/ort-wasm-simd.wasm ./dist/ort-wasm-simd.jsep.wasm
cp ../../${BUILD_DIR}/ort-wasm-simd.js ./lib/wasm/binding/ort-wasm-simd.jsep.js
npm run build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment