# FreeBSD 11.2 beta2 has broken X11



## kb6rxe (May 22, 2018)

I install 11.2 beta2 in my usual way (which works with FreeBSD 12 snapshots and 11.2 beta 1).
I'm using a nvidia gs8400GS video card. When I startx, I only get a black screen with a cursor and a mouse pointer (which does not move). I use the nvidia-driver-340 driver.


----------



## kb6rxe (May 23, 2018)

I reinstalled 11.2beta1 and X11 does NOT work


----------



## tankist02 (May 23, 2018)

Did you install nvidia driver from packages? Try rebuilding it from ports - it helped me with 11.2 Prerelease.


----------



## kb6rxe (May 23, 2018)

good idea. I'll try it when beta3 comes out. I wiped out my beta2 installation.


----------



## kb6rxe (May 25, 2018)

I just installed beta3, had the same problem. I recompiled the nvidia driver and that fixed the problem.

Thanks


----------



## kb6rxe (Jun 1, 2018)

11.2 RC1 just came out. I had to recompile the nvidia driver again.


----------



## rigoletto@ (Jun 1, 2018)

kb6rxe said:


> 11.2 RC1 just came out. I had to recompile the nvidia driver again.



`echo 'PORTS_MODULES= x11/nvidia-driver' >> /etc/make.conf`


----------



## Jonathan M Davis (Jun 28, 2018)

The release version of 11.2 still has this problem. The package installs the 11.1 driver for 11.2. Building the port fixes it, but that really shouldn't be necessary. :|


----------



## scottro (Jun 28, 2018)

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=228536  (Thanks to DutchDaemon who posted the link to the bug in another thread.)


----------



## SirDice (Jun 28, 2018)

Jonathan M Davis said:


> The package installs the 11.1 driver for 11.2. Building the port fixes it, but that really shouldn't be necessary. :|


The official packages are still built for 11.1 because that's the lowest, supported, version. The switch to 11.2 should happen some time soon.

While browsing the package repositories I did notice a release_2 branch. So you may want to try to point your repository to `pkg.freebsd.org/${ABI}/release_2/`. I haven't tried it myself but I suspect this is a latest branch specific for 11.2.


----------



## Jonathan M Davis (Jun 28, 2018)

SirDice said:


> The official packages are still built for 11.1 because that's the lowest, supported, version. The switch to 11.2 should happen some time soon.



Well, if it's the issue of a kernel ABI difference that affects a package (as seems to be the case here), then there clearly need to be different packages for 11.1 and 11.2 (even if other packages don't have that need), and it seems like a serious screw up on the part of the release process if the packages for 11.2 don't work for 11.2 when it's released.



SirDice said:


> While browsing the package repositories I did notice a release_2 branch. So you may want to try to point your repository to `pkg.freebsd.org/${ABI}/release_2/`. I haven't tried it myself but I suspect this is a latest branch specific for 11.2.



Well, I'd prefer to not just redirect my package repo  based on what might be the right one. IMHO, simply upgrading from 11.1 to 11.2 should have the correct repo - especially since I've never messed with which package repo my system is using, and the upgrade instructions in the handbook don't say anything about changing your package repo. For now, I've gotten around the problem by building the port myself, but I may have to look into what I might need to do with my package repo if the problem comes up again. Right now, it's looking like promptly updating to the next release is a stupid idea if stuff like this is going to happen.


----------



## scottro (Jun 29, 2018)

I never promptly update a main workstation, but I'm a coward. Note that this is a third party program that's broken.  I'm not sure how they work that in testing and other places, whether the core team only tests the base system, or whether they coordinate with port maintainers and so on. (Hrrm, is the package and port maintainer or maintainers usually the same person?)  Anyway the port works which is something, and a bug report has been filed, so this will probably be fixed relatively quickly, as it's a popular package/port.

I had updated a couple of test laptops with no problems, so if it weren't for the people who posted about their NVidia problem my workstation would have been next, and I would have been unhappy.


----------



## Jonathan M Davis (Jun 29, 2018)

Several folks complained about the nvidia package being broken during the pre-release stages, and it's a very common video card to use, so I find it a bit weird that nothing was done about this before the release. Even though FreeBSD is used much more heavily for servers than desktops or laptops, I would have thought that it would have been fixed beforehand - especially since it _was_ reported.

However, it sounds like the core problem is that they currently build packages using an older version of 11.x and assume that it works for newer versions, because 11.x is supposed to be ABI compatible for each release - but either they screwed up and updated an ABI in the kernel that they weren't supposed to until 12, or they need to take into account the fact that any package which contains a kernel module needs to be built for that specific release and not another 11.x release. Even if the packages get rebuilt soon (as should happen with the upcoming quarterly ports release), there's still the problem that 11.1 and 11.2 need different packages for any ports that contain kernel modules. So, assuming that the kernel ABI changes that happened in 11.2 are allowed with the current ABI policies, the implication is that they need to adjust how packages are released and not that they just dropped the ball on this release.

The bigger problem here though is virtualbox. Not only does its kernel module not work without rebuilding it for 11.2, but it actually causes a kernel panic if the 11.1 version of the module is loaded and the 11.2 kernel is used. And since, you don't upgrade the packages until after booting with the new kernel, even if there were an appropriate 11.2 package of virtualbox, you wouldn't get to the point where you'd install it if you tried to upgrade to 11.2 without disabling virtualbox first. I don't know what the correct solution is to that upgrade problem, but having the kernel panic due to a package that hasn't had the chance to be upgraded yet certainly isn't ideal.

For the moment, it appears that probably the safest move when upgrading is to make sure that your /boot/loader.conf and /etc/rc.conf don't load any kernel modules that come from ports during the upgrade, and after the upgrade, any packages which contain kernel modules should be rebuilt from ports rather than using the package from the repo.


----------



## SirDice (Jun 29, 2018)

Jonathan M Davis said:


> Several folks complained about the nvidia package being broken during the pre-release stages, and it's a very common video card to use, so I find it a bit weird that nothing was done about this before the release.


Packages are built for the _lowest_, still supported, version. And at this point in time 11.1 is still supported. If the packages had been built for 11.2, people still running 11.1 wouldn't be able to update their packages. This is generally not a problem. It's only the packages that contain kernel modules that would be affected. So we're talking about a handful of packages out of (almost) 35.000.


----------



## scottro (Jun 29, 2018)

Also, note that it IS in the erata. (I think it was added late, as they say an issue has been reported) but that's the sort of thing that I have always thought FreeBSD was very good at doing--letting you know about the problems.  Granted it's down the page in erata but at least it is listed. 

This is one where even though it probably doesn't belong in UPDATING, as it's not the base system, a note about it might not be amiss.  That's just my idle opinion though.  I also presume, making a pres out of you and me, that vesa would probably work. 

I'm doing a fresh install on a machine with an NVidia card today, and thank the people who posted about this, as their reporting their problems will have saved me a great deal of troubleshooting.


----------



## Jonathan M Davis (Jun 30, 2018)

SirDice said:


> Packages are built for the _lowest_, still supported, version. And at this point in time 11.1 is still supported. If the packages had been built for 11.2, people still running 11.1 wouldn't be able to update their packages. This is generally not a problem. It's only the packages that contain kernel modules that would be affected. So we're talking about a handful of packages out of (almost) 35.000.



Personally, I think that that shows that the release process needs to be changed. It really doesn't seem reasonable for the packages that come with 11.2 to not work with 11.2. And it's not like nvidia and virtualbox are packages that only a few people use either. Why should critical packages like these be broken just because 11.1 is still supported? They should work for both 11.1 and 11.2. Even if most packages work, using 11.1 packages for 11.2 clearly doesn't always work, and it sounds to me like they really should have separate repos for each release - or at least find a way to provide separate packages for those packages where it really does matter. Even not providing the packages for 11.2 if they won't work on 11.2 would be better than providing broken ones, much as it would be far better to provide packages that actually work.


----------



## Spartrekus (Jun 30, 2018)

It happens very often that FreeBSD has something broken. 

I keep saying:

*Stable
Testing 
SID *

is the power of Linux, and these 3 words may save FreeBSD.

I keep saying it.


----------



## scottro (Jun 30, 2018)

That's for Debian.  In most cases, FreeBSD has a similar setup, though the naming can be confusing, RELEASE, STABLE, and CURRENT.  (See Fred Cash's explanation at http://srobb.net/release.html).

I don't have answers for you.  I don't know how strongly it's connected to what is considered a FreeBSD strength, that the base system and userland are separate.  The Linux distributions that don't separate these things might have caught this or fixed it earlier, I have no idea. 

I agree that these are two frequently used ports, (NVidia even more than VirtualBox, as a lot of people are switching to bhyve) and the problem of the modules causing kernel  panics are bad, especially since VirtualBox is often used with Vagrant, a program used more on servers.  In my own, relatively meaningless, personal opinion, for desktop users, these two should have been given more attention in the release announcement, since, though in theory, everyone should read all the erata, I suspect many just skim through it.  A big, UPGRADING TO 11.2 MAY BREAK VIRTUALBOX AND NVIDIA a
in ALL CAPS  might be a good idea.  An announcement on these forums would also be useful, even if they are an unofficial channel, especially as I'm sure it got mentioned on distrowatch and lots of folks with little experience may try it.

And for you naysayers who don't care about that crowd, ya never know. One of them might be the one to get synaptic working out of the box and 802.11ac wireless speeds. And for those of you who don't care about that because you only use servers, I don't care about you either, because I use laptops and am incredibly selfish, especially since some nasty illnesses.    I care about servers and laptops too.  
http://srobb.net/selfish.mp4


----------



## rsronin (Jun 30, 2018)

I just upgraded to 11.2-RELEASE but couldn't start X11 because of an nvidia error:

NVRM: RmInitAdapter failed

I'm using pkg only. Should I downgrade or wait for the update pkg for the nvidia driver?


----------



## scottro (Jun 30, 2018)

I am not quite clear if the package will work before 11.1 goes EOL  which will be a few months from now.  Currently, the known fix is to build the port, which may mess up packages. One can use poudriere to custom build packages.   The issue with NVidia is mentioned towards the end of the erata.  (There are also issues with VirtualBox and the same fix, building from ports, exist).


----------



## shkhln (Jun 30, 2018)

scottro said:


> Currently, the known fix is to build the port, which may mess up packages.



Let's not blow ports vs packages issue out of proportion. Rebuilding this specific port (nvidia-driver) is as safe as it gets, it doesn't have many runtime dependencies or different options. The worst that could happen, nvidia.ko and nvidia-modeset.ko will be overwritten on package update with incompatible versions if the port/package is not locked.


----------



## rsronin (Jun 30, 2018)

I removed the nvidia packages and installed the nv package but no luck (or do not understand how to activate it). For now I am using the vesa driver as a workaround.


----------



## rsronin (Jun 30, 2018)

I tried to rollback.

`freebsd-update rollback`

Rebooted and reinstalled nvidia-driver and copied my backup xorg.conf to /etc/X11/ and we are rolling again ;-)


----------

