Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

threadripper "ugly patch"

Featured Replies

7 hours ago, mchamplain said:

Now my question, what about updates? Would updating Unraid break my VM with passthrough?

 

I asked about this, in another thread. To answer your question, yes updating unRAID will remove this patch; this was done as a courtesy and concept testing for early-TR adopters. As of now you want to just stay put. On another note I've been playing with kernel compiling (I can feel the Linux guru's and unRAID employee's shudder) goal would be to limp along an un-official fork until the user patch is in-place working; or I get a message from the "brass" saying, "for the love of all that is holly, DON'T!"

 

Quote

What if I want to try the latest version with the Java hack, is it possible to "rollback" to my current setup if it doesn't work for me?

 

Somewhere I did see a post or thread on how to "rollback" rc versions, and it was in relation to ThreadRipper, so some searches in the forums should produce the steps you're seeking. 

  • Replies 91
  • Views 16.4k
  • Created
  • Last Reply
6 hours ago, Rhynri said:

If no one else volunteers, I can try my hand at making a C version this week or next.  Unless PHP is preferable? As a side note, I don't use C that often, so there are undoubtably better people on the forum than me.

 

I'd bet general consensus would be, "go for it," if unRAID peps got multiple's they would probably be: pleased, and pick the better working solution.  I don't have the skill-set to do this myself, but I'd be a willing guinea-pig if you need tester(s). I have a co-worker that could probably write a php plug-in, but he graduated College, currently on vacation, and moving away in a few months - so he may not be willing or able to be tapped for favor.

  • Author
1 hour ago, Jcloud said:

On another note I've been playing with kernel compiling (I can feel the Linux guru's and unRAID employee's shudder) goal would be to limp along an un-official fork until the user patch is in-place working; or I get a message from the "brass" saying, "for the love of all that is holly, DON'T!"

 

Maybe you can ask @CHBMB to fill you in on rebuilding unRAID kernels.  He maintains "unRAID DVB Edition" and could probably be bribed, but don't tell him I suggested this!  :ph34r:

 

 

Edit: Here's the ugly patch, haven't verified it works on latest kernel:

--- a/drivers/pci/pci.c 2017-12-19 08:52:34.884337821 -0800
--- b/drivers/pci/pci.c 2017-12-19 08:52:34.884337821 -0800
+++ /usr/src/linux/drivers/pci/pcix.c   2017-12-19 09:57:48.516559218 -0800
@@ -3982,6 +3982,8 @@
 void pci_reset_secondary_bus(struct pci_dev *dev)
 {
        u16 ctrl;
+       int i;
+       u8 mem;

        pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &ctrl);
        ctrl |= PCI_BRIDGE_CTL_BUS_RESET;
@@ -3995,6 +3997,12 @@
        ctrl &= ~PCI_BRIDGE_CTL_BUS_RESET;
        pci_write_config_word(dev, PCI_BRIDGE_CONTROL, ctrl);

+       // The ugly patch
+       for (i = 0; i < 4096; i++){
+               pci_read_config_byte(dev, i, &mem);
+               pci_write_config_byte(dev, i, mem);
+       }
+
        /*
         * Trhfa for conventional PCI is 2^25 clock cycles.
         * Assuming a minimum 33MHz clock this results in a 1s

 

7 hours ago, limetech said:

Maybe you can ask @CHBMB to fill you in on rebuilding unRAID kernels.  He maintains "unRAID DVB Edition" and could probably be bribed, but don't tell him I suggested this!  :ph34r:

 

I have "borrowed" his script, that he posted on another thread. I thought I had managed to compile the kernel, but turns out I successfully ran CHBMB's script, but I made several errors/assumptions. Learning a lot, making plenty of errors. Managed to compile it but got seg fault with emhttp, so I did something wrong.  Tinkering some more, so when I do go to bother CHBMB with my ignorance, I can hopefully keep the newb questions to a minimum -- otherwise I'd hate to see bribe be more than an arm and a leg. :)

 

Unrelated to response, but related to thread, my coworker passed on coding a user driver, so I'm no help there. However, I am willing to make myself a guinea-pig tester.

Edited by Jcloud
Reality of my first attempt versus fan-fiction of my first post.

I'm running 6.4.0 stable with a 1950X on an Asus ROG Zenith Extreme. I get an "internal error: Unknown PCI header type '127'" message when trying to boot my Windows 10 VM with a Titan X (Pascal) passed through. It booted the first time and was accessible via RDC but there was no video output and subsequent attempts to boot give that error so I'm guessing the first boot borked it until I reboot again.

 

I assume that the kernel with the dirty patch is now older than what comes with 6.4.0. Willing to be a Guinea pig if someone has a current fix.

 

FWIW, this video card and this VM did previously work when I had an Intel chip.

I would love to see an 6.40 bzImage! Would be awesome if @limetech could build a new one :x

Edited by Xstasy

9 hours ago, Xstasy said:

I would love to see an 6.40 bzImage! Would be awesome if @limetech could build a new one :x

 

Not Limetech, but working on it. This is in the hobby and I'm no Linux expert categories, so it happens when/if it happens (on my end ;) ). 

58 minutes ago, Jcloud said:

 

Not Limetech, but working on it. This is in the hobby and I'm no Linux expert categories, so it happens when/if it happens (on my end ;) ). 

If I'm reading the OP correctly then he built the first bzImage for rc17b, which means he could make it happen a bit faster. Would have compiled it myself if I knew the way on unRaid. Also, the build script you're talking about, may I have a peek?

Edited by Xstasy

1 hour ago, Xstasy said:

If I'm reading the OP correctly then he built the first bzImage for rc17b, which means he could make it happen a bit faster. 

 

 

More than likely some truth, but I think Limetech crew would rather work on their product. Especially since the patch is more of a proof of concept hack, rather than a tested and clean fix.  A conundrum in all forms of support and customer service, "can't please 100% of customer base a 100% of the time." ;) 

 

1 hour ago, Xstasy said:

Also, the build script you're talking about, may I have a peek?

Sure, the script I'm borrowing came from here: https://lime-technology.com/messenger/39030/?tab=comments#comment-603927

His  CHBMB's script, in the form above doesn't cover patch files, but I imagine if you have some experience with kernel compiles on other systems then everything in there should familiar. As a side note in the script you'll see a reference for 3rd-party scsi drivers, yes you do need these.

 

I got my set of first questions answered, but didn't have time to tinker with it yesterday. Probably put in a hour or two after work tonight. If I make something I think is worth the communities time I'll post it.

Edited by Jcloud
foo

  • Author

If you look at the ugly patch reddit thread:

https://www.reddit.com/r/Amd/comments/7gp1z7/threadripper_kvm_gpu_passthru_testers_needed/

 

The latest update provides a user-space tool that others report works (scroll all the way to bottom for latest comments).  This tool is written in Java of all things, but it might be easier for someone to examine what it's really doing and re-write the critical stuff in php or bash or even C.  I just don't have time to dive into this atm.  Of course whole thing would be moot of AMD just fixed their damn microcode.

12 minutes ago, limetech said:

Of course whole thing would be moot of AMD just fixed their damn microcode.

LOL :D

 

Who could blame some AMD engineers for something they built on their own time versus being paid to do it in R&D labs? :)  (Well that's me at least.)

But you're not wrong either. 

 

Edited by Jcloud
the last sentence.

Got the java version running on my unraid box right now!

 

root@raid:/boot/custom # /usr/lib64/java/bin/java ZenBridgeBaconRecovery
-------------------------------------------
Zen PCIe-Bridge BAR/Config Recovery Tool, rev 1, 2018, HyenaCheeseHeads
-------------------------------------------
Tue Jan 16 06:41:14 CET 2018: Detecting VFIO-PCI devices
Tue Jan 16 06:41:14 CET 2018:   Device: /sys/devices/pci0000:00/0000:00:03.1/0000:09:00.1
Tue Jan 16 06:41:14 CET 2018:           Bridge: /sys/devices/pci0000:00/0000:00:03.1
Tue Jan 16 06:41:14 CET 2018:   Device: /sys/devices/pci0000:00/0000:00:03.1/0000:09:00.0
Tue Jan 16 06:41:14 CET 2018:           Bridge: /sys/devices/pci0000:00/0000:00:03.1
Tue Jan 16 06:41:14 CET 2018: Monitoring 2 device(s)...
Tue Jan 16 06:41:14 CET 2018: Lost contact with /sys/devices/pci0000:00/0000:00:03.1/0000:09:00.1
Tue Jan 16 06:41:14 CET 2018:   Recovering 512 bytes
Tue Jan 16 06:41:14 CET 2018:   Bridge config write complete
Tue Jan 16 06:41:14 CET 2018:   Recovered bridge secondary bus
Tue Jan 16 06:41:14 CET 2018: Re-acquired contact with /sys/devices/pci0000:00/0000:00:03.1/0000:09:00.1

 

  • Author
2 minutes ago, Xstasy said:

Got the java version running on my unraid box right now!

Nice!  Does it work?

9 minutes ago, limetech said:

Nice!  Does it work?

Working like a charm!

cane someone point me in a direction to get java installed on unraid to start with to get the patch to work. i had fount one way but the supporting files for it ar no longer on the net

HAHA I knew the community would beat me! Bah. Good learning experience though.

I just successfully compiled and booted 6.4.0 with Ugly patch. VM's are up and running. Currently in my testing-paranoia mode ;)  

 

Capture.JPG

Edited by Jcloud

31 minutes ago, Jcloud said:

HAHA I knew the community would beat me! Bah. Good learning experience though.

I just successfully compiled and booted 6.4.0 with Ugly patch. VM's are up and running. Currently in my testing-paranoia mode ;)  

 

Capture.JPG

 

78f7jXI.png

 

Mine is running fine, but I wouldn't mind a copy of your bz* files to test. This user-land java patch is annoying and needs to be started after the VM.

1 hour ago, Xstasy said:

Mine is running fine, but I wouldn't mind a copy of your bz* files to test.

Sure thing. It's getting late for me so give me about a day on that. one second, that's trivial doing that now. I'll also try and clean up my fugly compile algorithm of the ugly patch in case you  anyone wants to just compile on your hardware for best results.  

 

Use this file at your own risk! If you read through this entire thread you'll realize I can read instructions, but I really don't know what I'm doing on fundamentals. 

 

0201de31a1f125e240397b48c2978a58  bzImage

Limetech overloards is this bad mojo with the files here my bad. Feel free to do what needs to be done.

 

I took down the other two bz files per Limetech's suggestion, but if there's a 100% failure rate I'll put them back up.

 

 

 

bzimage-tr6_4_0

Edited by Jcloud
Danger! Danger Will Robinson!

  • Author
27 minutes ago, Jcloud said:

Sure thing. It's getting late for me so give me about a day on that. one second, that's trivial doing that now. I'll also try and clean up my fugly compile algorithm of the ugly patch in case you  anyone wants to just compile on your hardware for best results.  

 


0201de31a1f125e240397b48c2978a58  bzImage
853423d0da99ecf5b9e86fae2026737e  bzfirmware
da0d28000c9b19d91bc192fd62ecbbd3  bzmodules

Limetech overloards is this bad mojo with the files here my bad. Feel free to do what needs to be done.

bzfirmware

bzImage

bzmodules

 

You only need to post 'bzimage', with lower case 'i'.  Maybe call it 'bzimage-tr'.

 

Probably you've looked at what the patch does right?  It's dirt-simple and I guarantee, if the right engineer at AMD saw a description of the problem and the code of the solution, they could tell you in 10 minutes the exact address range that must be read/written, and in such a way as at least be compatible with other bridges.

 

Edit: might be good to add something like, "use at your own risk".  ;-)

1 minute ago, limetech said:

Probably you've looked at what the patch does right?  It's dirt-simple and I guarantee, if the right engineer at AMD saw a description of the problem and the code of the solution, they could tell you in 10 minutes the exact address range that must be read/written, and in such a way as at least be compatible with other bridges.

Oh yes. I couldn't get it to work as a patch file, compiler rejected it, so I changed the file by hand, a few times... when I was figuring out how to do it, or at least make it compile ha! Lots of "firsts" for me on this one. :)

 

I'll remember the file bit if there's a next time.

Thanks @Jcloud! Works well :)

Upgraded to 6.4 stable, added jcloud's compile and so far so good. 3 vm's running, 2 with pass through, all fine. Smooth transition. Thanks, @Jcloud !

 

Asrock Tai Chi x399

TR 1950

2 x MSI GTX 970 4G Gaming

Just a quick mention to all of you using this patch, it's probably reasonable to let you all know that @Jcloud contacted me to discuss compiling this for the community and to ask for a little advice and made a very generous donation from his own pocket to linuxserver.io which is very much appreciated and will go towards our server and hosting costs.

 

So a big thanks to him from everyone is well deserved (although I would like to point out I would have provided any help for free! :) )

Edited by CHBMB

7 hours ago, CHBMB said:

So a big thanks to him from everyone is well deserved (although I would like to point out I would have provided any help for free! :) )

I do Techsupport, customer service, and I'm a sarcastic SOB; I can appreciate the concept of being compensated for a newb's barrage of questions. Past and future ;) 

Edited by Jcloud
"phrasing" -- Archer

On 5/1/2018 at 10:16 AM, Jcloud said:

 

Is yours the Prime or Strix board? I'm running the Prime, and patch been working for me. Latest bios perhaps? Caught my curiosity is all.

Prime, Latest bios.

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.