black screen at login after pkg upgrade

If you're on 15.1 then you probably unintentionally installed the display drivers for 15.0. The ones in FreeBSD-ports are newer than the ones in FreeBSD-ports-kmods. But the drivers in FreeBSD-ports are built for 15.0, which won't work on 15.1.
 
The safest bet at the moment is building the drm-XYZ-kmod (61, 66 or 612) port directly from source.
Especially if NVIDIA GPU is in use.
Unfortunately, official builders for FreeBSD-ports-kmods repo doesn't build NVIDIA related kmods other than x11/nvidia-kmod.

If you're OK with X11 (maybe regardless with xorg or xlibre) only and old-school drivers alone is fine (not requiring graphics/nvidia-drm-*-kmod*), possibly x11/nvidia-kmod* ports built for 15.0 (official main pkg repo, FreeBSD-ports) could work, but graphics/nvidia-drm-*-kmod* is quite sensitive to commits to kernel as these require LinuxKPI.
 
I had installed drm-66-kmod from ports, but doesn't work
Okay, then ensure you have an synchronized /usr/src, either from the git repository (ensure you are on the branch that matches your release, i.e.: the releng/15.1 branch) or by installing the FreeBSD-src-sys package (easier), pull the ports repository using one of the methods that T-Aoki mentioned above.
And compile graphics/drm-66-kmod (if you wish to use the same version). If you wish to create a package to install with pkg, it should be something like:

  1. $ cd /usr/ports/graphics/drm-66-kmod
  2. $ make package
  3. # pkg install work/pkg/*.pkg
 
my steps
Code:
git clone https://git.freebsd.org/ports.git /usr/ports/
git clone https://git.freebsd.org/src.git /usr/src/
cd /usr/ports/graphics/drm-66-kmod/
make install clean
Is your source tree (/usr/src, at least /usr/src/sys) 100% matches with your running kernel?
what it mean? I use 15.1
 
my steps
Code:
git clone https://git.freebsd.org/ports.git /usr/ports/
git clone https://git.freebsd.org/src.git /usr/src/
cd /usr/ports/graphics/drm-66-kmod/
make install clean

what it mean? I use 15.1
Ah, you should've pulled main branch of src. Not at all matches for 15.1.
Try:
  1. freebsd-update to update to latest patch release 15.1-RELEASE-p1.
  2. git checkout releng/15.1 at /usr/src to switch to releng/15.1 branch, which is used for building 15.1-RELEASE{-p*}.
  3. git pull at /usr/src
  4. build/install graphics/drm-66-kmod again.
  5. restart your computer.
 
Ah, you should've pulled main branch of src. Not at all matches for 15.1.
Try:
  1. freebsd-update to update to latest patch release 15.1-RELEASE-p1.
  2. git checkout releng/15.1 at /usr/src to switch to releng/15.1 branch, which is used for building 15.1-RELEASE{-p*}.
  3. git pull at /usr/src
  4. build/install graphics/drm-66-kmod again.
  5. restart your computer.
I run git checkout/15.1 && git pull in /usr/src and reinstalled drm-66-kmod, still doesn't work, 612 and 61 the same.
 
I run git checkout/15.1 && git pull in /usr/src and reinstalled drm-66-kmod, still doesn't work, 612 and 61 the same.
git checkout/15.1 should surely fail! Do precisely.
git checkout releng/15.1
"g" "i" "t" space "c" "h" "e" "c" "k" "o" "u" "t" space "r" "e" "l" "e" "n" "g" slash "1" "5" period "1"
 
I'm fairly certain that I have been through a very similar problem, once or twice in the recent past, but in all honesty, my knowledge of how FreeBSD works is rather limited, but with some general help from others, I was able to get my desktop working again. I know where the headlights and the bumpers are on a car, but don't ask me to explain how a mass air-flow sensor works. So, I'm pretty much as the same level when it comes to fixing my own installation of FreeBSD.

In my case, I'm using an Nvidia GT-1030 video card in my system, and on less that two separate occasions I accidentally over wrote the existing video driver for my video card by running the package command. The first time I did this I was able to recover by cloning my working hard drive from another drive which contained a nearly identical installation of FreeBSD. However, the second time I made this mistake, the extra drive I had with backup installation had been reformatted for something else, and I had to come up with another plan to repair my system.

The below steps are from my handwritten notes, so hopefully someone else will point out if I missed something in the process. Also, you will have to do some research and find out which Nvidia driver works best with your card. In my case it happened to be, nvidia-driver-580.119.02_1, but yours may be different.

1. At the black screen (where your login screen should be) press Ctrl+Alt+F2 to open another console. Login as root within this new console
(Hopefully your network connection is still working at this point.)

2. Identify the Nvidia Packages you now have installed on your system with the below command. Make note of these packages so that you don't accidentally reinstall them.
Code:
pkg info -g "*nvidia*"

3. Delete all Nvidia packages curently on your system.
Code:
pkg delete "nvidia-driver*" "nvidia-settings" "nvidia-xconfig"

4. Make a temporary folder within your home folder to store the nvidia drivers you are about to fetch.
Code:
mdkir -p /home/Yourname/Temp_Pkg

5. Next, cd into the new temp directory you just created.
Code:
cd /home/Yourname/Temp_pkg

6. Enter the below command while inside the above temp directory you just created.
Code:
fetch https://nvidia.com

7. Download the tarball containing your drivers by entering the below command while you are still inside the Temp_pkg folder.
Code:
fetch https://nvidia.com NVIDIA-FreeBSD-x86_64-580.119.02.tar.xz
(Again, this may or may not be the right one for your system.)

8. Extract the tarball you just downloaded by entering the below command while still inside the above temp folder.
Code:
tar xJf NVIDIA-FreeBSD-x86_64-580.119.02.tar.xz

9. The above extraction process will create a new directory within your Temp_pkg folder. Next, cd into this new folder.
Code:
cd NVIDIA-FreeBSD-x86_64-580.119.02

10. While still inside the above directory which you just cd'd into, enter the below command at the command line to compile the install.
Code:
make install

11. Enter poweroff at the command prompt, and then restart your computer. Hopefully your desktop should be back.

Also, this is assuming that none of your configuration files such as rc.conf, or loader.conf got modified during your troubleshooting. If they are still the same, then I think that it should work.
 
 
I'm fairly certain that I have been through a very similar problem, once or twice in the recent past, but in all honesty, my knowledge of how FreeBSD works is rather limited, but with some general help from others, I was able to get my desktop working again. I know where the headlights and the bumpers are on a car, but don't ask me to explain how a mass air-flow sensor works. So, I'm pretty much as the same level when it comes to fixing my own installation of FreeBSD.

In my case, I'm using an Nvidia GT-1030 video card in my system, and on less that two separate occasions I accidentally over wrote the existing video driver for my video card by running the package command. The first time I did this I was able to recover by cloning my working hard drive from another drive which contained a nearly identical installation of FreeBSD. However, the second time I made this mistake, the extra drive I had with backup installation had been reformatted for something else, and I had to come up with another plan to repair my system.

The below steps are from my handwritten notes, so hopefully someone else will point out if I missed something in the process. Also, you will have to do some research and find out which Nvidia driver works best with your card. In my case it happened to be, nvidia-driver-580.119.02_1, but yours may be different.

1. At the black screen (where your login screen should be) press Ctrl+Alt+F2 to open another console. Login as root within this new console
(Hopefully your network connection is still working at this point.)

2. Identify the Nvidia Packages you now have installed on your system with the below command. Make note of these packages so that you don't accidentally reinstall them.
Code:
pkg info -g "*nvidia*"

3. Delete all Nvidia packages curently on your system.
Code:
pkg delete "nvidia-driver*" "nvidia-settings" "nvidia-xconfig"

4. Make a temporary folder within your home folder to store the nvidia drivers you are about to fetch.
Code:
mdkir -p /home/Yourname/Temp_Pkg

5. Next, cd into the new temp directory you just created.
Code:
cd /home/Yourname/Temp_pkg

6. Enter the below command while inside the above temp directory you just created.
Code:
fetch https://nvidia.com

7. Download the tarball containing your drivers by entering the below command while you are still inside the Temp_pkg folder.
Code:
fetch https://nvidia.com NVIDIA-FreeBSD-x86_64-580.119.02.tar.xz
(Again, this may or may not be the right one for your system.)

8. Extract the tarball you just downloaded by entering the below command while still inside the above temp folder.
Code:
tar xJf NVIDIA-FreeBSD-x86_64-580.119.02.tar.xz

9. The above extraction process will create a new directory within your Temp_pkg folder. Next, cd into this new folder.
Code:
cd NVIDIA-FreeBSD-x86_64-580.119.02

10. While still inside the above directory which you just cd'd into, enter the below command at the command line to compile the install.
Code:
make install

11. Enter poweroff at the command prompt, and then restart your computer. Hopefully your desktop should be back.

Also, this is assuming that none of your configuration files such as rc.conf, or loader.conf got modified during your troubleshooting. If they are still the same, then I think that it should work.
Using upstream tarball as-is to build is NOT recommended with some reason.
  • On FreeBSD side, there are several changes affecting upstream tarball to fail builds or causing runtime issues. Ports does needed adaptations with regard to FreeBSD version and/or NVIDIA driver version.
  • NVIDIA doesn't support main branch of FreeBSD (aka *-CURRENT), thus, has guard to disallow building on main, regardless it actually fails (on building/running) or not. Ports has patch (REINPLACE) to disable the version guard and needed fixes for main, if any. This also affects for *.0-RELEASE for a while, until NVIDIA unlocks for the version and take our fixes, but this process would take months as of their QA process to finish among other updates.
We (NVIDIA driver maintainers) unlock for main not only to allow users of main to use NVIDIA drivers but also to prepare for upcoming next stable branch and *.0-RELEASE.
 
git checkout/15.1 should surely fail! Do precisely.
git checkout releng/15.1
"g" "i" "t" space "c" "h" "e" "c" "k" "o" "u" "t" space "r" "e" "l" "e" "n" "g" slash "1" "5" period "1"
I reply in a hurry, actually I 'm in releng/15.1. I reinstalled 66 but still no luck, and my gpu is amd
 
I reply in a hurry, actually I 'm in releng/15.1. I reinstalled 66 but still no luck, and my gpu is amd
Ok, then also build and install /usr/ports/graphics/gpu-firmware-amd-kmod.
Take care to delete any existing amd modules on /boot/modules by first removing all gpu-firmware packages (check with pkg info gpu-firmware*).

See if that helps.

If not, showing the boot log would be helpful.
 
Ok, then also build and install /usr/ports/graphics/gpu-firmware-amd-kmod.
Take care to delete any existing amd modules on /boot/modules by first removing all gpu-firmware packages (check with pkg info gpu-firmware*).

See if that helps.

If not, showing the boot log would be helpful.
done, but doesn't work either
dmesg | grep drm outputs nothing
How can I run some commands in terminal and save dmesg to a website? Is there such a website?
 
Back
Top