Return to Level1Techs.com

Custom Ubuntu Distro For Ryzen Installations

linux
#24

You should try the up to date live respin. It has the most up to date kernel.

https://dl.fedoraproject.org/pub/alt/live-respins/

0 Likes

#25

Im going to make another thread, fedora has a error log that pops up most of the time in ubuntu as well.

0 Likes

#26

Try to reset your BIOS to default settings and go from there. Sounds like you messed with bios defaults

On Ryzen 1700 myself and everything works flawlessly on a Biostar X370GT5 motherboard, except networking which i installed with the drivers from the manufacturer's homepage, in my case Realtek RTL1885AS

Otherwise, look for Linux optimized bios settings. As they can interfere with installing distrobutions

0 Likes

#27

For anyone in doubt about getting Ubuntu running on Ryzen 7, I just want to re-iterate that I successfully got Ubuntu 16.10 desktop (haven't tried 17.04) running on my machine with an ASUS prime b350 plus and an Nvidia GPU. I had issues with the seating of my graphics card, the seating of my memory, as well as overclocking memory didn't work (had to physicall reset BIOS to get POST screen back). I also found that my motherboards BIOS was 2 or 3 versions out of date at the time so be sure to update.

For anyone having difficulties, I strongly recommend you:

  • ensure your speaker is plugged in and lookup the various beep codes.
  • update your BIOS
  • Check and re-check the seating of your memory and GPU.
0 Likes

#28

Na bios and mobo were fine, Had issues with my ram. I poped it into mem test and it had over 26000 errors so no wonder it had issues.

0 Likes

#29

Depending on the version of memtest (prior to V6) it is not able to test DDR4 correctly. Some perfectly fine ram may generate errors according to memtest.

Aside from that what voltage was your DRAM running at? 1.2V, I've seen some DIMMS which with a small voltage bump to 1.3/1.35 ran perfectly fine with Ryzen for some reason after failing at 1.2V. Mind you these where the cheaper variant /low Binned DIMMS.

0 Likes

#30

Another ram issue.
How does memtest find over 26000 errors and the memory goes past boot without errors? Makes no sense, it should stop and warn you at post

0 Likes

#31

Mem test just crashes after that, potentially the ram had more errors, but the system never reached that point. I never tried changing voltage, but changing core clock just resulted in a "Overclocking failed from bios"

I installed the latest version of mem test? Is it still not working correctly with ddr4 ram?

Also the system crashes at seemingly random intervals when used, the only consistent way of getting it to crash was editing a partition whether creating deleting or changing the size.

0 Likes

#32

Could you forget about memtest, for a while? It's not importnant.

Rather run a check on your hdd for bad sectors and or check s.m.a.r.t / life status. Also try changing ram slots, with only 1 ram stick inserted at a time to check, stick and socket stability. If you can't check it for some reason, rma the ram, which usually has a higher error rate than hdd's/ssd's

0 Likes

#33

The hdd's are fine, I checked their smart before and have installed os's correctly with a different motherboard. I don't have a second ddr4 cpu, motherboard or ram stick so I have already sent it for rma. They are better equipped for finding out if its broken.

edit1 They have sent me a new ram stick, just waiting until it arrives.

edit2 It was faulty ram, pc works now and only the ram was swapped, thanks for the help guys

0 Likes

#34

Sorry to raise an almost dead thread, but on this point, I’m guessing now that you can get Ubuntu 16.04.3 LTS which should ship with the 4.10 kernel, installing 16.04 on Ryzen should be fine now… Anybody tried?

0 Likes

#35

Just tested, installing 16.04.3 server by making to select “boot and install with HWE” at the first menu was a breeze with no issues.

1 Like

#36

Not sure about 16.10, but I have had no issues installing it with 17.04.

0 Likes

#37

My AMD build is a r5 1600 with a rx580 on a gigabyte ab350 gaming 3 motherboard. I have had a lot of trouble getting linux to run. Some distros don’t like the motherboard, others don’t like the CPU, one didn’t like the GPU. I’ve had the most luck running fedora 26 but even here I have some kernel issues resulting in CPU soft lockups.

I’ve considered trying another mobo or something but from what I can find on the internet no mobo is guaranteed to work at this time.

0 Likes

#38

I’m literally in the middle of creating a new tutorial that should hopefully fix this on Ubuntu 16.04.3.

0 Likes

#39

Unfortunately I didn’t manage to finish that tutorial this weekend. I am having all kinds of hell trying to compile kernel 4.10 from Ubuntu on Ubuntu itself. All I want to do is recompile it with the CONFIG_RCU_NOCB_CPU and CONFIG_RCU_NOCB_CPU_ALL flags as specified here in comment 22.

If anyone can post a video of compiling the kernel on Ubuntu 16.04 I would be grateful. The last error I got before stopping is this:

cc1: fatal error: ./ubuntu/vbox/vboxguest/include/VBox/VBoxGuestMangling.h: No such file or directory
compilation terminated.

Unfortunately, I have to compile the kernel on a single thread rather than using -j [thread number] in order to see the error messages, so each attempt takes roughly 30-40 minutes.

In case anyone else can take my work and fix it, I am posting it below.


Unfinished Work to try and recompile kernel with flags for Ryzen

Update Grub Timeout

Update grub configuration file so that we have enough time to select our own kernel. The commands below will set it to a 10 second timeout.

SEARCH="set timeout=.*"
REPLACE="set timeout=10"
FILEPATH="/boot/grub/grub.cfg"
sudo sed -i "s;$SEARCH;$REPLACE;g" $FILEPATH

Ensure Running 4.10

Next, ensure you are running the 16.04.3 with the 4.10 kernel. To check, you can just run uname -r and you should get the following output:

4.10.x-xx-generic

If you are not running 4.10, then update it.

We are only doing this because we are focusing on Ryzen stability, we want to be building for the 4.10 kernel and using it’s config as part of the process.

Install Packages

There are some packages we will need in order to compile the kernel later.

sudo apt-get install build-essential libssl-dev bc -y

Create A Workdir

Lets create an area to work in so that when we are finished with building the kernel we can just delete everything in our workdir to clean up.

WORKDIR="$HOME/workdir"
mkdir $WORKDIR
cd $WORKDIR

Check/Update Sources

In preparation for the next step, we need to ensure we have sources in our /etc/apt/sources.list file. If the lines below aren’t in there, you need to add them.

deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb-src http://gb.archive.ubuntu.com/ubuntu/ xenial restricted main universe multiverse #Added by software-properties
deb-src http://gb.archive.ubuntu.com/ubuntu/ xenial-updates restricted main universe multiverse #Added by software-properties
deb-src http://gb.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb-src http://security.ubuntu.com/ubuntu xenial-security restricted main universe multiverse #Added by software-properties
deb-src http://gb.archive.ubuntu.com/ubuntu/ xenial-proposed restricted main universe multiverse #Added by software-properties

Then you need to update your package indexes.

sudo apt update

If you don’t do this, you may get an error in the next step like:

You must put some 'source' URIs in your sources.list

Fetch Ubuntu Specific Kernel

Because we want the Ubuntu specific kernel with any changes they have made we will do the following to fetch the kernel source to build from:

sudo apt-get install dpkg-dev -y
sudo apt-get source linux-image-$(uname -r) -y
sudo apt-get build-dep linux-image-$(uname -r) -y

This is a fairly large download (144MB for me) and may take a while to complete.

If you get an error message like below, just ignore it.

W: Can't drop privileges for downloading as file 'linux-hwe_4.10.0-34.38~16.04.1.dsc' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)

In the end you should have the following output from ls -l

drwxr-xr-x 30 root   root   4.0K Aug 25 13:34 linux-hwe-4.10.0
-rw-r--r--  1 root   root   9.0M Aug 16 09:29 linux-hwe_4.10.0-33.37~16.04.1.diff.gz
-rw-r--r--  1 root   root   5.7K Aug 16 09:29 linux-hwe_4.10.0-33.37~16.04.1.dsc
-rw-r--r--  1 root   root   138M Jun 30 07:08 linux-hwe_4.10.0.orig.tar.gz

Give ourselves ownership.

sudo chown -R $USER:$USER *

Copy the Config

Navigate to the kernel folder and copy our distribution’s config here.

cd linux-hwe-4.10.0
cp /boot/config-$(uname -r) .config

Edit The Config

Now we are going to edit the config to add CONFIG_RCU_NOCB_CPU and CONFIG_RCU_NOCB_CPU_ALL, which is the whole point of this tutorial. We are going to alter the configuration based on this comment, in order to improve the stability on Ryzen.

I decided to ADD them under the commented out CONFIG_RCU_EXPERT so my config looks like:

...
CONFIG_TREE_RCU=y
# CONFIG_RCU_EXPERT is not set
CONFIG_RCU_NOCB_CPU
CONFIG_RCU_NOCB_CPU_ALL
CONFIG_SRCU=y
...

Change Kernel Version Number

In order to make your kernel “newer” than the stock Ubuntu kernel from which you are based you should add a local version modifier.
Add something like “+test1” to the end of the first version number in the debian.master/changelog file, before building. This will help identify your kernel when running as it also appears in uname -a.
When a new Ubuntu kernel is released, it will be newer than your kernel, so you will have to regenerate it and be careful when upgrading.

editor debian.master/changelog

Compile!

Below is the command to compile the kernel using 8 threads. You probably do want to take SMT into account, so use an 8 if you are on Ryzen 5 with 4 cores/8 threads, or 16 for a 1700 or higher. If you are debugging, just use make on its own so that you will see any error messages.

make -j8

This will take a while, so set a timer for 20-30 minutes and come back.

Install and Reboot

Install the kernel with:

sudo make modules_install install

Reboot and prey for no black screen of death. Because we updated our grub configuration to set a longer timeout, it should be easy enough to select an older kernel if something went wrong.

Optional - Reduce Grub Timeout

If everything worked, you may want to reduce your Grub timeout for faster reboots.

SEARCH="set timeout=.*"
REPLACE="set timeout=1"
FILEPATH="/boot/grub/grub.cfg"
sudo sed -i "s;$SEARCH;$REPLACE;g" $FILEPATH

References

0 Likes

#40

Nice. I can’t get 16.04 to work with my mobo but I’ll see if I can make it work with fedora next time I’m in the mood to tinker.

0 Likes

#41

Did you make sure to perform a HWE installation with the 4.10 kernel. You have to go through the initial menus and select it. If not it will default to the 4.4 kernel which I’m pretty sure won’t work. Failing that you will probably have much better experience with 17.04 and 17.10 is just around the corner.

0 Likes

#42

Managed to figure it out and post my tutorial. I haven’t had any crashes since compiling and installing a custom kernel.

0 Likes

#43

Hi Guys,

I had this ACPI error and this is how i managed to get the installation of MATE going:

I turned off secure boot (which i needed anyway to emulate networking devices but idk if it helped with the issue) with the instructions on this link:

https://forums.linuxmint.com/viewtopic.php?t=245987

Then i was getting this ACPI issue after choosing “install ubuntu mate” from the live usb, I followed this other tutorial to get the installation to continue:

While installing i got an error at the end of the installation, i will replicate it tomorrow and will provide more details

0 Likes