Solved Which AMD Kernel Module for Dell Precision M4600

Which AMD kernel module supports the Dell Precision M4600? (Manufactured 2012)

Working towards getting either X or Wayland up and running on a fresh install of FreeBSD, but have not been able to get any graphics yet.

Hardware

This is the AMD GPU that is shown.
Code:
$ lspci | grep -i vga
    01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Whistler [Radeon HD 6730M/6770M/7690M XT]

Reading the AMD GPU Matrix at https://wiki.freebsd.org/Graphics/AMD-GPU-Matrix there is no exact match for "Radeon HD 6730M XT". Is this considered an "old GPU" or a "new GPU"?


Attempts with Kernel Modules

After installing this:
pkg install drm-kmod

And loading this kernel module:

kldload radeonkms

A mouse cursor appears momentarily, then the whole screen fades to grey and becomes nonresponsive. I don't know if this means this is the right kernel module or the wrong one.


After a fresh reboot, trying the other kernel module:

kldload amdgpu

nothing happens. So attempting to start sway:

seatd-launch sway

shows error "Found 0 gpus, cannot create backend"


Another Data Point

Another data point is that I wanted to see which kernel modules GhostBSD uses for comparison, on the same machine. GhostBSD (with working graphics) shows these kernel modules:

Code:
    radeonkms
    radeon_TURKS_pfp_bin
    radeon_TURKS_me_bin
    radeon_TURKS_mc_bin
    radeon_TURKS_smc_bin
    radeon_TURKS_uvd_bin
    radeon_BTC_rlc_bin
Compiling from Source

Back on FreeBSD, I attempted to compile the kernel modules from source to see if they would work better. (The AMD GPU Matrix at https://wiki.freebsd.org/Graphics/AMD-GPU-Matrix for several GPUs specificially says to "Post 11.2 use "radeonkms" kernel module via drm-kmod port") So maybe pkg install drm-kmod is not good enough??

Code:
    $ cd /usr/ports/graphics/drm-61-kmod
    $ make install clean

got error (running as root): "cannot open /usr/src/sys/conf/kern.opts.mk"
 
got error (running as root): "cannot open /usr/src/sys/conf/kern.opts.mk"
I think that you don't have FreeBSD source tree on /usr/src so that this file can't be found by port.

To get source tree, do this below. change releng/14.2 according to your version of FreeBSD but I assume you have FreeBSD 14.2-RELEASE.
sh:
sudo git -b releng/14.2 https://github.com/freebsd/freebsd-ports.git /usr/src

Then, try building the port again.

For now, FreeBSD packages build for 14.1-RELEASE, if you have installed 14.2-RELEASE, you can't use kernel modules that has been built for 14.1-RELEASE. AFAIK, this is the situation until 14.1 goes End of Life.

I think this GPU needs radeon driver.
 
First things first: What have you installed?
(14.2-RELEASE or something else).

Reading the AMD GPU Matrix at https://wiki.freebsd.org/Graphics/AMD-GPU-Matrix there is no exact match for "Radeon HD 6730M XT". Is this considered an "old GPU" or a "new GPU"?
Based on your "graphics vintage" and on AMD Whistler where your AMD Radeon HD 6730M is listed with "Desktop Variant: Turks" it seems that that is covered in AMD / Radeon Graphics by:
Code:
 AMD FirePro V4900 Northern Islands / Turks Works 9.3, 10.0 Post 11.2 use "radeonkms" kernel module via drm-kmod port
kld_list="radeonkms" in /etc/rc.conf seems the prime candidate.

got error (running as root): "cannot open /usr/src/sys/conf/kern.opts.mk"
Although the "drm-X-kmod"s are in ports and not part of the base-install, they, being kernel modules, require a hook into the source of the base when you build them, matching your kernel version. It doesn't require a full source git install; that has some disadvantages as well. You probably missed installing the source tree when you installed your -RELEASE version on your laptop. See for options How to get sources installed and have these updated by freebsd-update(8) after a base-install

Kernel modules as packages are a bit finicky; you have two options to get packages like drm-X-kmod:
  1. build from ports, i.e. get the source and build/install (as you've tried). This will get the binaries installed as packages
  2. install as packages with pkg-install(8)
For #1, follow the Handbook; building graphics/drm-kmod should suffice. It is a meta port that pulls in the source code for all the dependent ports, including all firmware ports. You most likey do not have to pick a specific "kmod" version, like drm-61-kmod. On 14.2-RELEASE, building the meta port graphics/drm-kmod, builds drm-61-kmod as default.

For #2 things are somewhat complicated. Assuming you are on 14.2-RELEASE, during the three month overlap period until 14.1-RELEASE goes EoL (Supported FreeBSD releases) it used to be, until very recently, that packages of kernel modules were build only for the lowest supported minor version of a major branch/version. Things have changed recently and you should be able to install a specific (i.e. non-meta package like drm-61-kmod) by means of pkg-install(8): Possible solution to the drm-kmod kernel mismatch after upgrade from Bapt. This solution has some limitations: AFAIK using this method does not enable you to use the meta package, as in pkg install drm-kmod, to automatically get the drm-61-kmod specifically build against a 14.2-RELEASE (see the CFT: repository for kernel modules). For the firmware however, you most likely can get by using the meta package pkg install gpu-firmware-kmod; alternatively, tailored to your graphics alone, you most likely need pkg install gpu-firmware-radeon-kmod-turks

Finally, for the Xorg driver, radeon(4):
Code:
TURKS	   Radeon HD 6570/6630/6650/6670/6730/6750/6770
looks to support your graphics card. Follow 5.4.3. Video Cards; the radeon(4) Xorg driver driver is contained in x11-drivers/xf86-video-ati
 
You probably missed installing the source tree when you installed your -RELEASE version on your laptop. See for options How to get sources installed and have these updated by freebsd-update(8) after a base-install
Is there a way to check whether I installed the source tree when I ran bsdinstall? For example, a config file output by bsdinstall that lists all the options used? I remember seeing the option, but I didn't know if I needed it.

When I inspect /etc/freebsd-update.conf, the contents already include src
Code:
$ cat /etc/freebsd-update.conf | grep ^Components
Components src world kernel

I'm going to try re-running bsdinstall and this time make sure I add the source tree
 
I'm not sure if there is a "config file output by bsdinstall", I'm not aware of anything like that; I may be wrong*.
Hmm, your quote suggests you already have the sources installed; with installed sources, you should have a populated source tree starting at /usr/src , and that includes having the specifc file: /usr/src/sys/conf/kern.opts.mk

___
* Edit: bsdinstall(8):
Code:
BSDINSTALL_LOG	    Path to a log file for the installation.  Default:
		        	"/tmp/bsdinstall_log"
 
Last edited:
I'm going to try re-running bsdinstall and this time make sure I add the source tree

After a re-run of bsdinstall with source tree selected, was able to install from ports:

Code:
    cd /usr/ports/graphics/drm-kmod
    time make install clean

Now to load the module: kldload radeonkms

and see which modules are loaded:
Code:
$ kldstat | grep radeon
radionkms.ko
radion_TURKS_pfp_bin.ko
radeon_TURKS_me_bin.ko
radeon_BTC_rlc_bin.ko
radeon_TURKS_mc_bin.ko
radeon_TURKS_smc_bin.ko
radeon_SUMO_uvd_bin.ko

The screen did go partially grey when I loaded the module, and then the grey went away. The font may look different, I'm not sure. I'll install a display server next and see if it will run.
 
The easiest way to have /usr/src sources available is to install src.txz when doing a fresh install of FreeBSD. Just select 'Sources' in the installer, and let the installer handle the rest. That makes a difference when trying to install
graphics/drm-kmod from ports, rather than from packages.
 
After installing
pkg install wayland seatd sway swayidle swaylock-effects alacritty dmenu-wayland dmenu
was able to
seatd-launch sway
and got some graphics and a mouse cursor on the screen. :)


❓Now that' I've installed the radeonkms kernel module from ports, does that mean I should avoid using pkg to install anything? (I could see ports taking a long time to build firefox or librewolf.)

(Referencing this warning): https://docs.freebsd.org/en/books/handbook/ports/#ports-using
 
After installing
pkg install wayland seatd sway swayidle swaylock-effects alacritty dmenu-wayland dmenu
was able to
seatd-launch sway
and got some graphics and a mouse cursor on the screen. :)


❓Now that' I've installed the radeonkms kernel module from ports, does that mean I should avoid using pkg to install anything? (I could see ports taking a long time to build firefox or librewolf.)

(Referencing this warning): https://docs.freebsd.org/en/books/handbook/ports/#ports-using
yeah, the downside of ports is that they do require pretty beefy hardware to compile anything useful. The downside of pkg is that the pre-compiled software is usually built using very conservative build flags that don't enable a lot of useful features.

If something takes forever to compile, I just do an overnight job.

In all honesty, it's not a great idea to mix packages and ports... That advice is really meant to avoid situations where the versions of packages are too far apart from the versions specified in the ports tree for the same packages. It's easier to tell people to not mix ports and packages unless they know what to pay attention to.
 
Back
Top