Skip to content

Commit

Permalink
Refine system diagnosis
Browse files Browse the repository at this point in the history
  • Loading branch information
mayankk2308 committed Oct 23, 2019
1 parent 27c0014 commit 4490fe6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 24 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
A system backup is **always recommended** before using patches on macOS. I suggest using [Time Machine](https://support.apple.com/en-us/HT201250). Unsupported installation of newer operating systems on legacy Macs via **dosdude** patches is not supported at this time. An internet connection is required for downloading some patches.

## Installation
**WARNING**: Avoid macOS 10.15.1 beta. This release has disabled purge-wrangler AMD patches. Stay tuned for updates.

Few things of **note** before you install:
- If you are using **macOS 10.15.1 or later**, ensure you are running script **v6.0.3** or later. If this is your first time installing, the following instructions will ensure you get the latest version automatically. For previous users, the script will prompt for an update automatically.
- If you are using an NVIDIA 9xx or newer GPU, only **macOS High Sierra** is supported. Newer macOS versions do not have available web drivers to accelerate these GPUs. The script will not proceed to patch if appropriate web drivers are not available for your system.
- If you have a **Ti82** enclosure such **Razer Core V1** and **Akitio Thunder3**, the script will not be able to determine the GPU installed inside it automatically. In this scenario, the script will ask you what GPU you are using (AMD or NVIDIA).
- If you are using an AMD GPU not listed in [Apple's eGPU support document](https://support.apple.com/en-us/HT208544), such as the **R9 Nano**, legacy support will have to be enabled. In most cases, this will be done automatically. However, as above, if you have a Ti82 enclosure, the script will ask you if you would like to install this.
Expand Down Expand Up @@ -73,6 +72,9 @@ These are some of the most frequently asked questions regarding this script and
<details>
<summary>See Questions</summary>

#### Why is eGPU not working on Thunderbolt 1/2 system on Catalina?
See installation notes. If you are running **macOS 10.15.1 or later**, use script version **v6.0.3** or newer.

#### Why did the script fail to detect my enclosure?
Assuming hardware is appropriately configured and not defective, the only case when the script fails to detect eGPU configurations is when the enclosure has a Ti82 controller, which macOS does not support by default. Hence detection fails. Simply answer the questions the script asks to proceed with your setup.

Expand Down
39 changes: 17 additions & 22 deletions purge-wrangler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -351,17 +351,20 @@ check_sys_volume() {
fi
}

### macOS compatibility check and patch selection
### Old patch(es) selector
select_older_patches() {
is_10151_or_newer=0
hex_selected_thunderbolt="${hex_thunderboltswitchtype}3"
hex_selected_thunderbolt_patch="${system_thunderbolt_ver}"
}

### macOS compatibility check
check_macos_version() {
is_10151_or_newer=1
local macos_major_ver="$(echo -e "${macos_ver}" | cut -d '.' -f2)"
local macos_minor_ver="$(echo -e "${macos_ver}" | cut -d '.' -f3)"
[[ (${macos_major_ver} < 13) || (${macos_minor_ver} == 13 && ${macos_minor_ver} < 4) ]] && echo -e "\n${bold}macOS 10.13.4 or later${normal} required.\n" && exit
if [[ (${macos_major_ver} < 15) || (${macos_major_ver} == 15 && ${macos_minor_ver} < 1) ]]; then
is_10151_or_newer=0
hex_selected_thunderbolt="${hex_thunderboltswitchtype}3"
hex_selected_thunderbolt_patch="${system_thunderbolt_ver}"
fi
[[ (${macos_major_ver} < 15) || (${macos_major_ver} == 15 && ${macos_minor_ver} < 1) ]] && select_older_patches
}

### Ensure presence of system extensions
Expand Down Expand Up @@ -852,8 +855,7 @@ auto_setup_egpu() {
fi
check_patch
[[ ${binpatch_enabled} != "1" && ${amdlegacy_enabled} != "1" ]] && return
echo -e "\n${bold}Detecting anomalies...${normal}"
anomaly_states
echo
print_anomalies
echo
end_binary_modifications "Modifications complete."
Expand All @@ -874,9 +876,7 @@ uninstall() {
create_patched_binary "${iotfam_binpath}"
fi
create_hexrepresentation "${agw_binpath}"
if [[ ${tbswitch_enabled} == 1 ]]; then
patch_binary "${agw_binpath}" "${hex_selected_thunderbolt_patch}" "${hex_selected_thunderbolt}"
fi
[[ ${tbswitch_enabled} == 1 ]] && patch_binary "${agw_binpath}" "${hex_selected_thunderbolt_patch}" "${hex_selected_thunderbolt}"
if [[ ${nvidia_enabled} == 1 ]]
then
create_hexrepresentation "${iog_binpath}"
Expand Down Expand Up @@ -957,10 +957,7 @@ detect_mac_model() {
anomaly_states() {
detect_mac_model
detect_discrete_gpu_vendor
will_use_ext_disp=0
resolution_needed=0
yesno_action "Will you be using an ${bold}external monitor${normal}?" "will_use_ext_disp=1" "will_use_ext_disp=0"
[[ ${will_use_ext_disp} == 0 ]] && return
[[ ${is_desktop_mac} == 1 ]] && resolution_needed="-1" && return
if [[ "${dgpu_vendor}" == "10de" ]]
then
Expand All @@ -974,21 +971,19 @@ anomaly_states() {

### Print anomalies, if any
print_anomalies() {
local detected_gpus="$(system_profiler SPDisplaysDataType 2>/dev/null | grep -i "Chipset Model" | cut -d':' -f2 | awk '{$1=$1};1')"
echo -e "${bold}Detected System GPUs${normal}:\n${detected_gpus}\n"
echo "${bold}Analyzing system...${normal}"
anomaly_states
case "${resolution_needed}" in
1) echo -e "${bold}Problem${normal} Loss of OpenCL/GL on all NVIDIA GPUs.\n${bold}Resolution${normal} Use ${bold}purge-nvda.sh${normal} NVIDIA optimizations.";;
2) echo -e "${bold}Problem${normal} Black screens on monitors connected to eGPU.\n${bold}Resolution${normal} Use ${bold}purge-nvda.sh${normal} AMD optimizations.";;
3) echo -e "${bold}Problem${normal} Black screens/slow performance with eGPU.\n${bold}Resolution${normal} Use \`${bold}pmset -a gpuswitch 0${normal}\` to force iGPU.";;
*) [[ ${is_desktop_mac} == 1 ]] && echo "No resolutions to any anomalies if present." || echo "No anomalies expected.";;
1) echo -e "\n${bold}Problem${normal} Loss of OpenCL/GL on all NVIDIA GPUs.\n${bold}Resolution${normal} Use ${bold}purge-nvda.sh${normal} NVIDIA optimizations.";;
2) echo -e "\n${bold}Problem${normal} Black screens on monitors connected to eGPU.\n${bold}Resolution${normal} Use ${bold}purge-nvda.sh${normal} AMD optimizations.";;
3) echo -e "\n${bold}Problem${normal} Black screens/slow performance with eGPU.\n${bold}Resolution${normal} Use \`${bold}pmset -a gpuswitch 0${normal}\` to force iGPU.";;
*) [[ ${is_desktop_mac} == 1 ]] && echo "No resolutions to any anomalies if present. See README." || echo "No anomalies expected.";;
esac
}

### Anomaly detection
detect_anomalies() {
echo -e "${mark}${gap}${bold}System Diagnosis${normal}\n"
echo -e "Diagnosis will check your system to ${bold}find\npotential hiccups${normal} based on the applied system patches."
anomaly_states
print_anomalies
}

Expand Down

0 comments on commit 4490fe6

Please sign in to comment.