Last active
March 8, 2024 12:16
-
-
Save zekefeu/afb29296db34d2451cdddcc14dbeef3c to your computer and use it in GitHub Desktop.
This script automates the installation of the Intel SDE, to fix compatibility issues with older CPU's that do not support the AVX2 instruction set. It fixes the "Illegal hardware instruction" error.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Solution provided by https://github.com/renhiyama | |
# (https://github.com/Jarred-Sumner/bun/issues/282#issuecomment-1177154684) | |
# License agreement | |
echo "The Intel Software Development Emulator is distributed under the Intel Software License Agreement, available at https://www.intel.com/content/dam/develop/external/us/en/documents/pdf/intel-simplified-software-license-version-august-2021.pdf" | |
echo "" | |
echo "If you do not accept the terms of the license agreement, you have 10 seconds to stop this script (Ctrl+C)" | |
sleep 10 | |
# Create directories | |
[ ! -d /tmp/bun-sde-fix ] && mkdir /tmp/bun-sde-fix | |
[ ! -d ~/.sde ] && mkdir ~/.sde | |
echo "Downloading SDE package" && \ | |
curl -sS https://downloadmirror.intel.com/732268/sde-external-9.7.0-2022-05-09-lin.tar.xz -o /tmp/bun-sde-fix/sde-package.tar.xz && \ | |
echo "Extracting into ~/.sde" && \ | |
tar -xf /tmp/bun-sde-fix/sde-package.tar.xz --strip-components=1 -C ~/.sde | |
# Create aliases | |
[ -f ~/.bashrc ] && echo '[ -d ~/.sde ] && alias bun="~/.sde/sde -chip-check-disable -- bun"' >> ~/.bashrc | |
[ -f ~/.zshrc ] && echo '[ -d ~/.sde ] && alias bun="~/.sde/sde -chip-check-disable -- bun"' >> ~/.zshrc | |
alias bun="~/.sde/sde -chip-check-disable -- bun" | |
echo "The default supported shells are bash and zsh." | |
echo 'For other shells, add [ -d ~/.sde ] && alias bun="~/.sde/sde -chip-check-disable -- bun" to the config file.' | |
echo "When the issue will be fixed, remove ~/.sde." | |
rm -rf /tmp/bun-sde-fix | |
echo "Done, thank you." | |
Had to switch from
~/.sde/sde
to~/.sde/sde64
in the alias when installing under WSL2 for some reason, without it I would get the errorzsh: no such file or directory: /home/k/.sde/sde
That happens because "no such file" error even includes if the binary is for 32 bit instead of 64 bit... @fuka-g replace sde with sde64 if the CPU is 64 bit (I'm sure there's some cheap command to do that smile )
Fixed here https://gist.github.com/spidyhackx/194108a0df2b4fc8df642f126edcc0e5
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm going on break for a week or two, can you work on a fix ? If not, I'll do it when I get back.