Problems with drm-kmod on RX560

After an appropriate make deinstall, post ( cat /usr/ports/graphics/drm-61-kmod/out.txt | nc termbin.com 9999 - post the resulting url) the output of:
Code:
# sh
# cd /usr/ports/graphics/drm-61-kmod
# make install
Code:
# sh
# cd /usr/ports/graphics/drm-61-kmod
# make clean
# make install >out.txt 2>&1
nc: getaddrinfo: Name does not resolve

and pkg info drm-61-kmod
pkg: No package(s) matching drm-61-kmod
 
😩 When I install FreeBSD for the first time on a machine, I always make sure to install the sources when the installer gives me that option. That's because if I don't, it can be a convoluted process of finding the correct version of sources to install into /usr/src.

The payoff is that when I compile graphics/drm-kmod from ports, it compiles just fine, and gives me all the available drivers, I just need to pick the correct one (be it for AMD, Intel or NVidia). I have recent AMD hardware, so it's amdgpu.ko for me, and it finds the correct firmware (like Green Sardine or Sienna Cichlid or whatever). I even have a thread about Sienna Cichlid that I made a few years ago - it worked because I installed sources into into /usr/src from get-go.
I had it but removed it and reinstalled it from git just to be sure it's updated and still doesn't work for me so, weird...
 
nc: getaddrinfo: Name does not resolve
Hmm, what does this do?
ping -c 3 termbin.com

P.S. It would be helpful to me, if you posted the command together with its result containing the error output (unless very long), like in a code block:
Code:
# ddate
ddate: Command not found.
 
Hmm, what does this do?
ping -c 3 termbin.com
Sorry, I did a typing mistake 🤦🏻

Here's the url: https://termbin.com/hfvu

P.S. It would be helpful to me, if you posted the command together with its result containing the error output (unless very long), like in a code block:
Code:
# ddate
ddate: Command not found.
Do you still want them now that I fixed my typing mistake? Let me know and I'll give them to you. Tho, the commands are exactly as you gave them to me and the outputs are the ones I gave every quoted part of your reply. But, if you still want them, I can give set them all together for you.
 
Contents of https://termbin.com/hfvu is:
Code:
===>  Installing for drm-61-kmod-6.1.92
===>  Checking if drm-61-kmod is already installed
===>   Registering installation for drm-61-kmod-6.1.92
pkg-static: open(/usr/ports/graphics/drm-61-kmod/work/.metadir.drm-61-kmod): No such file or directory
*** Error code 1

Stop.
make: stopped in /usr/ports/graphics/drm-61-kmod


Edit:
This shows no building, no compiling; when actually building/compiling drm-61-kmod you get a lot more output. There's probably something wrong with the start.
I should have expressed myself more clearly:
This shows no building, no compiling by this invocation of make install. But a previous make install did likely produce a build. I'll defer to astyle's message below as he has more experience in this area.



Please type the following commands as shown:
cd /usr/ports/graphics/drm-61-kmod
make deinstall
make clean
ls -l

Then post all these commands with their output in a code block.



I had it but removed it and reinstalled it from git just to be sure it's updated [...]

Just to be sure, did you get the sources of the base-install from stable/14 or releng/14.1 ?
 
This shows no building, no compiling; when actually building/compiling drm-61-kmod you get a lot more output. There's probably something wrong with the start.
Not true....

Presence of /usr/ports/graphics/drm-61-kmod/work/ directory shows that compilation did take place. However, something got borked in the toolchain, and the .metadir.drm-61-kmod portion failed to materialize.

This tends to happen towards the end of the compilation process. The work/ subdirectory of the port has to contain all the stuff that got compiled - and needs to be installed with the make install command. make install wants to find the .metadir.drm-61-kmod portion, but cannot. That's why OP is getting the error.

I usually resolve that by just running /usr/bin/touch /usr/ports/category/port/work/my_missing_file, and then make install works without complaining.

But for this case, it's gettting amdgpu.ko to work, so it's kind of important to simply compile graphics/drm-kmod straight on the system. Just run make clean in /usr/ports/, this will clean out all the compilations within the ports tree, then get to graphics/drm-kmod and compile that.
 
Contents of https://termbin.com/hfvu is:
Code:
===>  Installing for drm-61-kmod-6.1.92
===>  Checking if drm-61-kmod is already installed
===>   Registering installation for drm-61-kmod-6.1.92
pkg-static: open(/usr/ports/graphics/drm-61-kmod/work/.metadir.drm-61-kmod): No such file or directory
*** Error code 1

Stop.
make: stopped in /usr/ports/graphics/drm-61-kmod


Edit:
This shows no building, no compiling; when actually building/compiling drm-61-kmod you get a lot more output. There's probably something wrong with the start.
I should have expressed myself more clearly:
This shows no building, no compiling by this invocation of make install. But a previous make install did likely produce a build. I'll defer to astyle's message below as he has more experience in this area.

Compilation did happen but, the installation stuck there, giving that error...

Please type the following commands as shown:
Sure!

cd /usr/ports/graphics/drm-61-kmod
No output (obviously but I'm still saying it)

make deinstall
===> Deinstalling for drm-61-kmod
===> drm-61-kmod not installed, skipping


make clean
`clean' is up to date

I used temrbin for this one as it's very long. Url: https://termbin.com/xpoy



Just to be sure, did you get the sources of the base-install from stable/14 or releng/14.1 ?
I didn't knew about "releng/14.1" at first but, I used that as well and it doesn't work. I'm using it currently so, we all refer the same versions.
 
Not true....

Presence of /usr/ports/graphics/drm-61-kmod/work/ directory shows that compilation did take place. However, something got borked in the toolchain, and the .metadir.drm-61-kmod portion failed to materialize.

This tends to happen towards the end of the compilation process. The work/ subdirectory of the port has to contain all the stuff that got compiled - and needs to be installed with the make install command. make install wants to find the .metadir.drm-61-kmod portion, but cannot. That's why OP is getting the error.

I usually resolve that by just running /usr/bin/touch /usr/ports/category/port/work/my_missing_file, and then make install works without complaining.

But for this case, it's gettting amdgpu.ko to work, so it's kind of important to simply compile graphics/drm-kmod straight on the system. Just run make clean in /usr/ports/, this will clean out all the compilations within the ports tree, then get to graphics/drm-kmod and compile that.
How proper is to just create the file? Won't this create problems later?

Im any case, I did it and now I have a bunch of other errors and files that aren't found 🤣🤣🤣
 
I don't think this is normal:
make clean
`clean' is up to date

I did it yesterday and got:
Code:
# make clean
===>  Cleaning for drm-61-kmod-6.1.92
After that, depending if there are some files to delete or not, you may have several others lines, or nothing if it didn't need to be cleaned.

Furthermore, I compiled this port once again yesterday without error, installation went fine.

At this point, I think you can try to delete the ports tree and get a new one. See: https://docs.freebsd.org/en/books/handbook/ports/#ports-using-installation-methods

And if this fails too, people may provide a 14.1-RELEASE compiled package you can install with
pkg-add(8). I have this at home.

Edit: I set a github repo for that: https://github.com/Emrion/FreeBSD-kmod
 
How proper is to just create the file? Won't this create problems later?
I've been doing that for a long time (since 13.0-RELEASE), and haven't had issues doing that. If I did, I would not make such suggestions online.
Just run make clean in /usr/ports/, this will clean out all the compilations within the ports tree
Seems like you were running make clean in the wrong directory... There's a reason I wrote what I did: ^

Just stay away from 61. Compile the plain graphics/drm-kmod, and let it pull in all the dependencies on its own. Once that is done, using amdgpu.ko in /etc/rc.conf will get your GPU going.
 
I don't think this is normal:

`clean' is up to date

I did it yesterday and got:
Code:
# make clean
===>  Cleaning for drm-61-kmod-6.1.92
After that, depending if there are some files to delete or not, you may have several others lines, or nothing if it didn't need to be cleaned.

Furthermore, I compiled this port once again yesterday without error, installation went fine.

At this point, I think you can try to delete the ports tree and get a new one. See: https://docs.freebsd.org/en/books/handbook/ports/#ports-using-installation-methods

And if this fails too, people may provide a 14.1-RELEASE compiled package you can install with
pkg-add(8). I have this at home.

Edit: I set a github repo for that: https://github.com/Emrion/FreeBSD-kmod
At this point, I'll just try with your version and if it doesn't work, I'll try again on FreeBSD 15. The ports collection I am using, was manually downloaded and updated.
 
I've been doing that for a long time (since 13.0-RELEASE), and haven't had issues doing that. If I did, I would not make such suggestions online.
Of course, a problem could happen for someone, and you wouldn't know. It does seem weird to me, tho and in any case, it didn't worked here. Thanks for trying regardless!

Seems like you were running make clean in the wrong directory... There's a reason I wrote what I did: ^
I used all the directories I build ports for before (including "drm-61-kmod"), just to be sure. I also tried to use it in "/usr/ports" like you said, but, it was taking soooooo much, and I wasn't able to let it finish so, I ended it and rebooted to continue my work.

Just stay away from 61. Compile the plain graphics/drm-kmod, and let it pull in all the dependencies on its own. Once that is done, using amdgpu.ko in /etc/rc.conf will get your GPU going.
I did use "graphics/drm-kmod" and it uses "graphics/drm-61-kmod". So, wanted it or not, I have to use that. I can choose "graphics/drm-515-kmod" myself but this one makes the system hang, so...
 
I used all the directories I build ports for before (including "drm-61-kmod"), just to be sure. I also tried to use it in "/usr/ports" like you said, but, it was taking soooooo much, and I wasn't able to let it finish so, I ended it and rebooted to continue my work.
Yeah, on your system that would be an overnight job, but it's one of those things that you kind of gotta finish once you start it. Especially when you need to re-compile something as important as graphics/drm-kmod. That port kind of needs a clean start, no failed compilations to pick up on.


I did use "graphics/drm-kmod"
👍
and it uses "graphics/drm-61-kmod"
That's fine. The important part is to start compiling in /usr/ports/graphics/drm-kmod/. The whole stack needs to be compiled starting there.

so... do it in correct order, as root (assuming you have /usr/src kernel sources installed from src.txz)
Code:
# cd /usr/ports
# make clean
(will run for a LONG time, but needs to be done so that next steps are successful)
# cd graphics/drm-kmod
# make && make install

Then edit /etc/rc.conf to load the amdgpu.ko that is produced by the steps I have outlined in this post. Yeah, some steps do require patience and persistence.
 
It's precisely that. You need these sources in /usr/src and in sync with the current OS (which is automatic if you had them before to upgrade).
Can you elaborate on that? Why would you need the base-source tree?
If you build a kernel module, you need the sources of this kernel. In your example, you didn't do make clean before to make install, so no compilation took place. I guess you previously compiled it and the resulting files remained.

See what happens here:
Code:
# zfs rename zroot/usr/src zroot/usr/no-source
The Makefile of the port can tell if a system source tree is needed. The source tree is defined by USES= kmod and/or SRC_BASE.

ports/graphics/drm-61-kmod/Makefile
Rich (BB code):
20 USES=           kmod uidfix compiler:c++11-lang

ports/emulators/virtualbox-ose-kmod/Makefile
Rich (BB code):
23 USES=        cpe compiler:c++14-lang kmod tar:bzip2

59 KMK_CONFIG=    VBOX_LIBPATH_X11=${LOCALBASE} VBOX_FREEBSD_SRC=${SRC_BASE}/sys

ports/Mk/Uses/kmod.mk
Rich (BB code):
22 .  if !exists(${SRC_BASE}/sys/Makefile) && target(build)
23 IGNORE=    requires kernel source files in SRC_BASE=${SRC_BASE}
24 .  endif

ports/Mk/bsd.port.mk
Rich (BB code):
471 # SRC_BASE        - The root of the src tree.  (Some ports require this to get
472 #                  kernel sources).  Default: /usr/src

SRC_BASE can also be used as a user settable, i.e:
Code:
 # cd /usr/ports/graphics/drm-61-kmod
 # make install clean SRC_BASE=/usr/src-14.1
 
Back
Top