From 510c3df9adb7b62a3d7196f7b74a23921e321786 Mon Sep 17 00:00:00 2001 From: mszeghdar Date: Sat, 17 Aug 2024 01:27:51 +0100 Subject: [PATCH 1/2] Minor fix for PopOS detection and multiGPU laptops - Updated OS detection logic to properly identify PopOS - Modified GPU detection to account for laptops with switchable graphics --- .../setup/autodesk_fusion_installer_x86-64.sh | 87 ++++++++++++------- files/setup/locale/update-locale.sh | 0 2 files changed, 55 insertions(+), 32 deletions(-) mode change 100644 => 100755 files/setup/autodesk_fusion_installer_x86-64.sh mode change 100644 => 100755 files/setup/locale/update-locale.sh diff --git a/files/setup/autodesk_fusion_installer_x86-64.sh b/files/setup/autodesk_fusion_installer_x86-64.sh old mode 100644 new mode 100755 index 9cfecdf..f3c5ff3 --- a/files/setup/autodesk_fusion_installer_x86-64.sh +++ b/files/setup/autodesk_fusion_installer_x86-64.sh @@ -117,7 +117,7 @@ function install_required_packages { echo -e "$(gettext "${GREEN}All required packages for the installer are installed!")${NOCOLOR}" sleep 2 elif [[ $DISTRO_VERSION == *"debian"* ]] || [[ $DISTRO_VERSION == *"ubuntu"* ]] \ - || [[ $DISTRO_VERSION == *"linux"*"mint"* ]] || [[ $DISTRO_VERSION == *"pop"*"os"* ]]; then + || [[ $DISTRO_VERSION == *"linux"*"mint"* ]] || [[ $DISTRO_VERSION == *"pop"*"os"* ]] || [[ $DISTRO_VERSION == *"pop"* ]]; then echo -e "$(gettext "${YELLOW}All required packages for the installer will be installed!")${NOCOLOR}" sleep 2 sudo apt-get install -y curl lsb-release coreutils mesa-utils policykit-1 awk wget xdg-utils @@ -357,36 +357,59 @@ function check_ram { ############################################################################################################################################################################## function check_gpu_driver { - echo -e "$(gettext "${YELLOW}Checking the GPU driver for the installer ...${NOCOLOR}")" - if glxinfo | grep -q "OpenGL vendor string: NVIDIA"; then - echo -e "$(gettext "${GREEN}The NVIDIA GPU driver is installed!${NOCOLOR}")" - sleep 2 - GET_VRAM_MEGABYTES=$(nvidia-smi --query-gpu=memory.total --format=csv,noheader,nounits) - echo -e "$(gettext "${GREEN}The DXVK GPU driver will be used for the installation!${NOCOLOR}")" - GPU_DRIVER="DXVK" - sleep 2 - elif glxinfo | grep -q "OpenGL vendor string: AMD"; then - echo -e "$(gettext "${GREEN}The AMD GPU driver is installed!${NOCOLOR}")" - sleep 2 - GET_VRAM_MEGABYTES=$(glxinfo | grep -i "Video memory" | grep -Eo '[0-9]+MB' | grep -Eo '[0-9]+') - echo -e "$(gettext "${GREEN}The OpenGL GPU driver will be used for the installation!${NOCOLOR}")" - GPU_DRIVER="OpenGL" - sleep 2 - elif glxinfo | grep -q "OpenGL vendor string: Intel"; then - echo -e "$(gettext "${GREEN}The Intel GPU driver is installed!${NOCOLOR}")" - sleep 2 - GET_VRAM_MEGABYTES=$(glxinfo | grep -i "Video memory" | grep -Eo '[0-9]+MB' | grep -Eo '[0-9]+') - echo -e "$(gettext "${GREEN}The OpenGL GPU driver will be used for the installation!${NOCOLOR}")" - GPU_DRIVER="OpenGL" - sleep 2 - else - echo -e "$(gettext "${red}The GPU driver is not installed or not found on your system!${NOCOLOR}")" - sleep 2 - GET_VRAM_MEGABYTES=$(glxinfo | grep -i "Video memory" | grep -Eo '[0-9]+MB' | grep -Eo '[0-9]+') - echo -e "$(gettext "${GREEN}The OpenGL GPU driver will be used for the installation!${NOCOLOR}")" - GPU_DRIVER="OpenGL" - sleep 2 + echo -e "$(gettext "${YELLOW}Checking the GPU drivers for the installer ...${NOCOLOR}")" + + if nvidia-smi &>/dev/null; then + NVIDIA_PRESENT=true + NVIDIA_VRAM=$(nvidia-smi --query-gpu=memory.total --format=csv,noheader,nounits | head -n1) + echo -e "$(gettext "${GREEN}NVIDIA GPU detected with ${NVIDIA_VRAM}MB VRAM${NOCOLOR}")" fi + + INTEL_AMD_GPU=$(glxinfo | grep "OpenGL vendor string" | cut -d: -f2 | tr -d ' ') + if [[ $INTEL_AMD_GPU == "Intel" || $INTEL_AMD_GPU == "AMD" ]]; then + INTEL_AMD_PRESENT=true + INTEL_AMD_VRAM=$(glxinfo | grep -i "Video memory" | grep -Eo '[0-9]+MB' | grep -Eo '[0-9]+' | head -n1) + echo -e "$(gettext "${GREEN}${INTEL_AMD_GPU} GPU detected with ${INTEL_AMD_VRAM}MB VRAM${NOCOLOR}")" + fi + + if [[ $NVIDIA_PRESENT && $INTEL_AMD_PRESENT ]]; then + echo -e "$(gettext "${YELLOW}Multiple GPUs detected. Please choose which to use:${NOCOLOR}")" + echo "1) NVIDIA" + echo "2) ${INTEL_AMD_GPU}" + read -p "Enter your choice (1 or 2): " gpu_choice + + case $gpu_choice in + 1) + GPU_DRIVER="DXVK" + GET_VRAM_MEGABYTES=$NVIDIA_VRAM + echo -e "$(gettext "${GREEN}NVIDIA GPU selected. The DXVK GPU driver will be used for the installation.${NOCOLOR}")" + ;; + 2) + GPU_DRIVER="OpenGL" + GET_VRAM_MEGABYTES=$INTEL_AMD_VRAM + echo -e "$(gettext "${GREEN}${INTEL_AMD_GPU} GPU selected. The OpenGL GPU driver will be used for the installation.${NOCOLOR}")" + ;; + *) + echo -e "$(gettext "${RED}Invalid choice. Defaulting to ${INTEL_AMD_GPU} GPU.${NOCOLOR}")" + GPU_DRIVER="OpenGL" + GET_VRAM_MEGABYTES=$INTEL_AMD_VRAM + ;; + esac + elif [[ $NVIDIA_PRESENT ]]; then + GPU_DRIVER="DXVK" + GET_VRAM_MEGABYTES=$NVIDIA_VRAM + echo -e "$(gettext "${GREEN}The DXVK GPU driver will be used for the installation.${NOCOLOR}")" + elif [[ $INTEL_AMD_PRESENT ]]; then + GPU_DRIVER="OpenGL" + GET_VRAM_MEGABYTES=$INTEL_AMD_VRAM + echo -e "$(gettext "${GREEN}The OpenGL GPU driver will be used for the installation.${NOCOLOR}")" + else + echo -e "$(gettext "${RED}No GPU driver detected on your system!${NOCOLOR}")" + GPU_DRIVER="OpenGL" + GET_VRAM_MEGABYTES=0 + fi + + sleep 2 } ############################################################################################################################################################################## @@ -601,7 +624,7 @@ function check_and_install_wine() { apt-get autoremove -y apt-get install -y p7zip p7zip-full p7zip-rar winbind cabextract apt-get install -y --install-recommends winehq-staging' - elif [[ $DISTRO_VERSION == *"Ubuntu"*"20.04"* ]] || [[ $DISTRO_VERSION == *"Linux"*"Mint"*"20"* ]] || [[ $DISTRO_VERSION == *"Pop"*"OS"*"20.04"* ]]; then + elif [[ $DISTRO_VERSION == *"Ubuntu"*"20.04"* ]] || [[ $DISTRO_VERSION == *"Linux"*"Mint"*"20"* ]] || [[ $DISTRO_VERSION == *"Pop"*"OS"*"20.04"* ]] || [[ $DISTRO_VERSION == *"pop"*"20.04"* ]]; then echo "Installing Wine for Ubuntu 20.04 ..." pkexec bash -c ' dpkg --add-architecture i386 @@ -615,7 +638,7 @@ function check_and_install_wine() { apt-get autoremove -y apt-get install -y p7zip p7zip-full p7zip-rar winbind cabextract apt-get install -y --install-recommends winehq-staging' - elif [[ $DISTRO_VERSION == *"Ubuntu"*"22.04"* ]] || [[ $DISTRO_VERSION == *"Linux"*"Mint"*"21"* ]] || [[ $DISTRO_VERSION == *"Pop"*"OS"*"22.04"* ]]; then + elif [[ $DISTRO_VERSION == *"Ubuntu"*"22.04"* ]] || [[ $DISTRO_VERSION == *"Linux"*"Mint"*"21"* ]] || [[ $DISTRO_VERSION == *"Pop"*"OS"*"22.04"* ]] || [[ $DISTRO_VERSION == *"pop"*"22.04"* ]]; then echo "Installing Wine for Ubuntu 22.04 ..." pkexec bash -c ' dpkg --add-architecture i386 diff --git a/files/setup/locale/update-locale.sh b/files/setup/locale/update-locale.sh old mode 100644 new mode 100755 From 92a17cedf055774e1ef157ab417dbd3e517c58da Mon Sep 17 00:00:00 2001 From: Steve Zabka Date: Sat, 17 Aug 2024 07:23:57 +0200 Subject: [PATCH 2/2] Update autodesk_fusion_installer_x86-64.sh - Support two graphics cards if installed! - Support Pop!_OS --- files/setup/autodesk_fusion_installer_x86-64.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/files/setup/autodesk_fusion_installer_x86-64.sh b/files/setup/autodesk_fusion_installer_x86-64.sh index f3c5ff3..71dd249 100755 --- a/files/setup/autodesk_fusion_installer_x86-64.sh +++ b/files/setup/autodesk_fusion_installer_x86-64.sh @@ -7,7 +7,7 @@ # Author URI: https://cryinkfly.com # # License: MIT # # Copyright (c) 2020-2024 # -# Time/Date: 19:00/11.08.2024 # +# Time/Date: 07:20/17.08.2024 # # Version: 2.0.0-Alpha # #################################################################################################### @@ -117,7 +117,7 @@ function install_required_packages { echo -e "$(gettext "${GREEN}All required packages for the installer are installed!")${NOCOLOR}" sleep 2 elif [[ $DISTRO_VERSION == *"debian"* ]] || [[ $DISTRO_VERSION == *"ubuntu"* ]] \ - || [[ $DISTRO_VERSION == *"linux"*"mint"* ]] || [[ $DISTRO_VERSION == *"pop"*"os"* ]] || [[ $DISTRO_VERSION == *"pop"* ]]; then + || [[ $DISTRO_VERSION == *"mint"* ]] || [[ $DISTRO_VERSION == *"pop"* ]]; then echo -e "$(gettext "${YELLOW}All required packages for the installer will be installed!")${NOCOLOR}" sleep 2 sudo apt-get install -y curl lsb-release coreutils mesa-utils policykit-1 awk wget xdg-utils @@ -638,7 +638,7 @@ function check_and_install_wine() { apt-get autoremove -y apt-get install -y p7zip p7zip-full p7zip-rar winbind cabextract apt-get install -y --install-recommends winehq-staging' - elif [[ $DISTRO_VERSION == *"Ubuntu"*"22.04"* ]] || [[ $DISTRO_VERSION == *"Linux"*"Mint"*"21"* ]] || [[ $DISTRO_VERSION == *"Pop"*"OS"*"22.04"* ]] || [[ $DISTRO_VERSION == *"pop"*"22.04"* ]]; then + elif [[ $DISTRO_VERSION == *"Ubuntu"*"22.04"* ]] || [[ $DISTRO_VERSION == *"Linux"*"Mint"*"21"* ]] || [[ $DISTRO_VERSION == *"Pop"*"22.04"* ]]; then echo "Installing Wine for Ubuntu 22.04 ..." pkexec bash -c ' dpkg --add-architecture i386 @@ -652,7 +652,7 @@ function check_and_install_wine() { apt-get autoremove -y apt-get install -y p7zip p7zip-full p7zip-rar winbind cabextract apt-get install -y --install-recommends winehq-staging' - elif [[ $DISTRO_VERSION == *"Ubuntu"*"24.04"* ]] || [[ $DISTRO_VERSION == *"Linux"*"Mint"*"22"* ]] || [[ $DISTRO_VERSION == *"Pop"*"OS"*"24.04"* ]]; then + elif [[ $DISTRO_VERSION == *"Ubuntu"*"24.04"* ]] || [[ $DISTRO_VERSION == *"Linux"*"Mint"*"22"* ]] || [[ $DISTRO_VERSION == *"Pop"*"24.04"* ]]; then echo "Installing Wine for Ubuntu 24.04 ..." pkexec bash -c ' dpkg --add-architecture i386