Skip to content

Commit

Permalink
Add some bugfixes for #1 and fix compatibility-check.sh for systems w…
Browse files Browse the repository at this point in the history
…ith broken Bumblebee
  • Loading branch information
T-vK authored and sealrealize committed Mar 8, 2019
1 parent b2d1d15 commit cffd4ae
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
/vm-files/MAC_ADDRESS.txt
.*.swp
.*.swo
/utils/nvflash_linux
16 changes: 7 additions & 9 deletions compatibility-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,16 @@ LOG_BASE_DIR="${SCRIPT_DIR}/logs"
#LSHW_MOCK="${SCRIPT_DIR}/mock-data/$MOCK_SET-lshw"
#LSIOMMU_MOCK="${SCRIPT_DIR}/mock-data/$MOCK_SET-lsiommu"

if [ -z "$(which optirun)" ]; then
USE_BUMBLEBEE=false
OPTIRUN_PREFIX=""
else
if sudo which optirun &> /dev/null && sudo optirun echo>/dev/null ; then
USE_BUMBLEBEE=true
OPTIRUN_PREFIX="optirun "
else
USE_BUMBLEBEE=false
OPTIRUN_PREFIX=""
fi


if [ -z ${LSIOMMU_MOCK+x} ]; then
IOMMU_GROUPS=$(sudo ${OPTIRUN_PREFIX}${SCRIPT_DIR}/utils/lsiommu)
IOMMU_GROUPS=$(sudo ${OPTIRUN_PREFIX}${UTILS_DIR}/lsiommu)
MOCK_MODE=false
else
IOMMU_GROUPS=$(cat "${LSIOMMU_MOCK}")
Expand Down Expand Up @@ -221,9 +220,8 @@ fi
if [ "${UEFI_VIRTUALIZATION_ENABLED}" = true ] && [ "${UEFI_IOMMU_ENABLED}" = true ] && [ "${KERNEL_IOMMU_ENABLED}" = true ] && [ "${IOMMU_COMPATIBILITY_LVL}" -gt "0" ] ; then
log_green "If you found a notebook that appears to be GPU pass-through compatible, please open an issue on Github and let me know."
if [ "${IOMMU_COMPATIBILITY_LVL}" -gt "1" ] ; then
log_green "You may now proceed and run the start-vm script."
log_green "However, you should adjust how much RAM, CPU cores etc the VM can use at the very top of the script."
log_green "You should also look at the $DISTRO_UTILS_DIR/prepare-vm script and change the size of the VM disk to your liking."
log_green "You may now proceed and run the start-vm.sh script."
log_green "However, you should adjust how much RAM, CPU cores, disk space etc the VM can use at the very top of the script."
fi
fi

Expand Down
3 changes: 1 addition & 2 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ DISTRO_UTILS_DIR="${UTILS_DIR}/${DISTRO}"
source "$DISTRO_UTILS_DIR/kernel-param-utils"

sudo $DISTRO_UTILS_DIR/install-dependencies
sudo $DISTRO_UTILS_DIR/set-kernel-params
sudo $UTILS_DIR/set-kernel-params
sudo $DISTRO_UTILS_DIR/nvidia-setup
prepare-vm

echo "You should probably reboot now!"
echo "But first make sure you didn't get any errors above."
Expand Down
4 changes: 2 additions & 2 deletions utils/Fedora/29/install-dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sudo wget https://fedorapeople.org/groups/virt/virtio-win/virtio-win.repo -O /et
echo "Installing virtio-win..."
sudo dnf install virtio-win -y
echo "Upgrading to latest virtio-win..."
sudo dnf --enablerepo=virtio-win-latest upgrade virtio-win
sudo dnf --enablerepo=virtio-win-latest upgrade virtio-win -y
echo "Installing virt-viewer so you can connect to the VM for the windows installation"
sudo dnf install -y virt-viewer
# /usr/share/virtio-win/virtio-win.iso
# /usr/share/virtio-win/virtio-win.iso
14 changes: 11 additions & 3 deletions utils/Fedora/29/nvidia-setup.sh → utils/Fedora/29/nvidia-setup
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ VM_FILES_DIR="${PROJECT_DIR}/vm-files"

source "$DISTRO_UTILS_DIR/kernel-param-utils"

echo "Disable Nouveau drivers"
addKernelParam "nouveau.modeset=0"
sudo grep -qxsF 'blacklist nouveau' "/etc/modprobe.d/blacklist.conf" || echo "blacklist nouveau" | sudo tee -a "/etc/modprobe.d/blacklist.conf" > /dev/null
sudo grep -qxsF 'exclude=xorg-x11*' "/etc/dnf/dnf.conf" || echo "exclude=xorg-x11*" | sudo tee -a "/etc/dnf/dnf.conf" > /dev/null
sudo dnf remove xorg-x11-drv-nouveau -y

echo "Install third party repositories"
sudo dnf install fedora-workstation-repositories -y

Expand All @@ -25,15 +31,17 @@ echo "Install Bumblebee"
sudo dnf install akmod-bbswitch bumblebee primus -y

echo "Make Bumblebee avialable to the current user"
sudo gpasswd -a $USER bumblebee
sudo gpasswd -a $(who -m | awk '{print $1;}') bumblebee

echo "Enable Bumblebee"
sudo systemctl enable bumblebeed

echo "Block nvidia-fallback service"
sudo systemctl mask nvidia-fallback

echo "Disable Nouveau drivers"
addKernelParam "nouveau.modeset=0"
echo "Allow using external monitor for notebooks that have the port wired to the dGPU directly"
sudo dnf install -y intel-gpu-tools
sudo intel-virtual-output
#example usage: xrandr –output eDP1 –mode 1920×1080 –output HDMI1 –mode 1920×1080 –right-of eDP1

sudo ${UTILS_DIR}/extract-vbios
4 changes: 2 additions & 2 deletions utils/set-kernel-params
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ UTILS_DIR="${PROJECT_DIR}/utils"
DISTRO=$("${UTILS_DIR}/distro-info")
DISTRO_UTILS_DIR="${UTILS_DIR}/${DISTRO}"

source "$(dirname "$0")/$DISTRO_UTILS_DIR/kernel-param-utils"
source "$DISTRO_UTILS_DIR/kernel-param-utils"

echo "Adding kernel parameters..."
# Docs: https://www.kernel.org/doc/Documentation/admin-guide/kernel-parameters.txt
Expand Down Expand Up @@ -36,4 +36,4 @@ echo "(Re)building initramfs for the current kernel..."
sudo dracut -f --kver `uname -r`

echo "Applying the kernel parameter changes..."
applyKernelParamChanges
applyKernelParamChanges

0 comments on commit cffd4ae

Please sign in to comment.