Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation, trivial cleanup, change OpenCore prefs #139

Closed
wants to merge 7 commits into from
Closed

Update documentation, trivial cleanup, change OpenCore prefs #139

wants to merge 7 commits into from

Conversation

kwvg
Copy link
Contributor

@kwvg kwvg commented Jul 29, 2020

Things done

  • Have passthrough GPU devices share the same port and bus (fixes HDMI audio detection, courtesy of foxlet)
  • Add gtk initialization failed fix (common on Ubuntu based hosts) for users who are running the QEMU script from SSH
  • Mention ScanPolicy fix to allow detection of ISOs made from createinstallmedia
  • Mention RadeonBoost.kext for AMD GPU users
  • Remove reference to virtualhere (USB passthrough recommended)
  • Add link to post instructing the enabling of rc.local with systemd (for Ubuntu users)
  • Adds tweakable variables that can be changed (ALLOCATED_RAM, CPU_SOCKETS, CPU_CORES, CPU_THREADS) and variables that can be defined so that script can be launched from rc.local (REPO_PATH, OVMF_DIR) without relative references (e.g. ./ and ../)
  • Add instructions for attaching physical disk drives as a raw block device for performance improvement
  • Add quick SSH setup instructions for single-GPU passthrough setup
  • Enable verbose mode and set ScanPolicy to 0 by default in OpenCore configs
  • Add algrey's cpuid_set_cache_info - don't set cpuid_cores_per_package patch from AMD-Vanilla to fix odd topology issues (as suggested by Leoyzen here) This doesn't work, more info in commit ed75a20
  • Stop using Penryn for OpenCore builds (still keeping them for Clover just in case)
  • Make passthrough script use vmxnet3, rearrange arguments to make them neater to read

Additional Credits

@kwvg kwvg changed the title Update NOTES.md and standardize QEMU launch scripts Update NOTES.md, standardize QEMU launch scripts, fix topology freeze Jul 29, 2020
@kholia
Copy link
Owner

kholia commented Jul 30, 2020

Thank you! <3

It might take me a while to go through these changes and merge them.

@kwvg
Copy link
Contributor Author

kwvg commented Jul 30, 2020

Thank you 😊, this is a WIP so there are still a few optimizations I'm working on...

EDIT: This PR as is breaks some stuff, working on it... Fixed! It's all yours @kholia!

kwvg added 5 commits July 30, 2020 19:15
Things changed
- Add adjustable variables in all scripts, make them "any-location launch" ready
- Remove "Penryn", inhert host CPU and it's capabilities instead [still shows up as GenuineIntel]
- Rearrange arguments to make it easier to read
- Add foxlet's passthrough fix for passthrough launch script
- Replace e1000-82545em with vmxnet3 in passthrough launch script
Notes:
- Patches added for all three OpenCore folders but disabled for Big Sur
- The "skip cpuid_cores_per_package test" patches seem to compliment
"don't set cpuid_cores_per_package" and "jmp to calculations and set cpuid_cores_per_package"
but the first complement causes a crash and with the second one, it refuses to boot altogether.

The patches added alone don't seem to fix the odd cores crash issue but I figured it might
help so I've added it anyways
- Verbose has been enabled by default just to make debugging easier
I've added the expected value, 18809603 as a comment in the plist file
just for convenience sake
Changes done:
- Added passthrough instructions for AMD
- Ensure that VFIO driver loads first (courtesy of https://github.com/intel/nemu/wiki/Testing-VFIO-with-GPU)
- Add both initramfs and GRUB bootloader VFIO instructions
- Remove VirtualHere and virio-net-osx references
- Add 'gtk initialization failed' fix, ScanPolicy fix
- Add instructions for attaching a physical block drive
- Add basic Ubuntu SSH instructions
- Add link to RadeonBoost.kext (improved scores on my system, seems good)

Note: Because of changes in previous commits, explicitly specifiying AVX2 is not necessary
but specifiying AES-NI for some reason is still necessary, still kept because of inconsistent
behaviour
I forgot that they don't have the patches from OpenCore, oops!
@kwvg kwvg changed the title Update NOTES.md, standardize QEMU launch scripts, fix topology freeze Update documentation, trivial cleanup, change OpenCore prefs Jul 30, 2020
@kholia kholia self-requested a review August 1, 2020 09:00
@kwvg kwvg marked this pull request as draft August 20, 2020 13:12
@kwvg
Copy link
Contributor Author

kwvg commented Aug 21, 2020

Pinging @kholia

@kholia kholia force-pushed the master branch 6 times, most recently from b417e6f to 5e2fff2 Compare August 23, 2020 06:41
@kholia
Copy link
Owner

kholia commented Aug 23, 2020

I have started testing and merging selective changes from this PR into master branch.

@@ -1,32 +1,38 @@
#!/usr/bin/env bash

# See https://www.mail-archive.com/qemu-devel@nongnu.org/msg471657.html thread.
# Special thanks to...
Copy link
Owner

@kholia kholia Aug 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave the old files unchanged.

Same goes for other scripts meant for older macOS versions.

@@ -14,41 +14,40 @@ echo "\n== Loaded Modules ==" >&2
lsmod | grep kvm
lsmod | grep amd_iommu
lsmod | grep intel_iommu
v=`cat /sys/module/kvm/parameters/ignore_msrs`
v=$(cat /sys/module/kvm/parameters/ignore_msrs)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorporated. Thanks.

@kholia
Copy link
Owner

kholia commented Aug 23, 2020

Please rebase on latest master (squash if required). This should help in reviewing this PR.

@@ -340,16 +340,40 @@
<key>Emulate</key>
<dict>
<key>Cpuid1Data</key>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were these changes tested with Big Sur?

fail

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Every change needs to be tested end-to-end.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They weren't. I couldn't get Big Sur to work due to problems on my end, sorry about that. I figured changes from Catalina should translate over

@@ -516,7 +582,8 @@
<key>HaltLevel</key>
<integer>2147483648</integer>
<key>ScanPolicy</key>
<integer>18809603</integer>
<integer>0</integer>
<!-- <integer>18809603</integer> -->
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This (commented stuff) is not valid for OpenCore 0.6.0.

Copy link
Contributor Author

@kwvg kwvg Aug 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenCore doesn't like the comment or doesn't like 18809603?
Just checked with the commit, it doesn't like the comment.

Are there any problems with the additional algrey patches? The leaf7 patch was really useful to get AVX working on my AMD system w/o manually specifying it.

-netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \
-monitor stdio \
-vga vmware
ALLOCATED_RAM="3072" # MiB
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorporated. Thanks.

@kholia kholia force-pushed the master branch 2 times, most recently from d079513 to 9bc8ca9 Compare August 23, 2020 07:28
@@ -233,7 +233,7 @@ Add `-vga vmware` to QEMU parameters in the booot script (e.g. boot-macOS.sh), i

*Warning: The OpenCore distribution that comes with OSX-KVM already has AppleALC, do not mix VoodooHDA with AppleALC. You may want to consider HDA passthrough if it is practical or use HDMI audio instead*

No support is provided for this. You are on your own. The sound output is known to be choppy and distorted.
No support is provided for this. You are on your own. The sound output is known to be choppy and distorted. *(Though this can be mitigated using [spheenik's version of qemu](https://github.com/spheenik/qemu/tree/3.1.0-patched) but it has not been thoroughly tested)*
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot recommend unmaintained and very likely non-working versions of QEMU.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a branch with QEMU 4.0 (https://github.com/spheenik/qemu/tree/4.0-glorious) but it should probably be omitted because we don't know how it'll behave

@kwvg
Copy link
Contributor Author

kwvg commented Aug 24, 2020

Replaced by #142, closed

@kwvg kwvg closed this Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants