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.How to fix this then?
Especially if NVIDIA GPU is in use.The safest bet at the moment is building the drm-XYZ-kmod (61, 66 or 612) port directly from source.
I got an error when run portsnap fetchThe safest bet at the moment is building the drm-XYZ-kmod (61, 66 or 612) port directly from source.
portsnap: Directory does not exist or is not writable: /var/db/portsnap
portsnap is now unusable.I got an error when run portsnap fetch
Code:portsnap: Directory does not exist or is not writable: /var/db/portsnap
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.I had installed drm-66-kmod from ports, but doesn't work
$ cd /usr/ports/graphics/drm-66-kmod$ make package# pkg install work/pkg/*.pkgIs your source tree (/usr/src, at least /usr/src/sys) 100% matches with your running kernel?I had installed drm-66-kmod from ports, but doesn't work
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.1Is your source tree (/usr/src, at least /usr/src/sys) 100% matches with your running kernel?
Ah, you should've pulled main branch of src. Not at all matches for 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
freebsd-update to update to latest patch release 15.1-RELEASE-p1. git checkout releng/15.1 at /usr/src to switch to releng/15.1 branch, which is used for building 15.1-RELEASE{-p*}. git pull at /usr/srcI run git checkout/15.1 && git pull in /usr/src and reinstalled drm-66-kmod, still doesn't work, 612 and 61 the same.Ah, you should've pulled main branch of src. Not at all matches for 15.1.
Try:
freebsd-updateto update to latest patch release 15.1-RELEASE-p1.git checkout releng/15.1at /usr/src to switch to releng/15.1 branch, which is used for building 15.1-RELEASE{-p*}.git pullat /usr/src- build/install graphics/drm-66-kmod again.
- 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.
git checkout/15.1 should surely fail! Do precisely. git checkout releng/15.1pkg info -g "*nvidia*"
pkg delete "nvidia-driver*" "nvidia-settings" "nvidia-xconfig"
mdkir -p /home/Yourname/Temp_Pkg
cd /home/Yourname/Temp_pkg
fetch https://nvidia.com
fetch https://nvidia.com NVIDIA-FreeBSD-x86_64-580.119.02.tar.xz
tar xJf NVIDIA-FreeBSD-x86_64-580.119.02.tar.xz
cd NVIDIA-FreeBSD-x86_64-580.119.02
make install
Using upstream tarball as-is to build is NOT recommended with some reason.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.
(Again, this may or may not be the right one for your system.)Code:fetch https://nvidia.com NVIDIA-FreeBSD-x86_64-580.119.02.tar.xz
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 reply in a hurry, actually I 'm in releng/15.1. I reinstalled 66 but still no luck, and my gpu is amdgit checkout/15.1should 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"
Ok, then also build and install /usr/ports/graphics/gpu-firmware-amd-kmod.I reply in a hurry, actually I 'm in releng/15.1. I reinstalled 66 but still no luck, and my gpu is amd
pkg info gpu-firmware*).done, but doesn't work eitherOk, 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 withpkg info gpu-firmware*).
See if that helps.
If not, showing the boot log would be helpful.