Does FreeBSD support DRI PRIME or similar switchable graphics yet?

agregate

New Member

Reaction score: 1
Messages: 5

I understand this question has been asked before on the forums over the years but I would like to request an update for 2021, and given 13.0-RELEASE is right around the corner, perhaps some things have been added that I am not yet aware of.

I'm running a ThinkPad T400 with an Intel Mobile 4 Series Chipset and an AMD ATI Mobility Radeon HD 3450/3470. Intel graphics work just fine on BSD using either one of the drm-kmod or xf86-video-intel driver but running xrandr --listproviders shows me only the Intel sink and AMD is nowhere to be found.

Upon inspection of the Xorg log, both drivers are loaded and then I get

(WW) VGA arbiter: cannot open kernel arbiter, no multi-card support

and the radeon driver is unloaded again, so that X starts with Intel only. I haven't bothered uploading an Xorg log because I have a bad feeling the answer to my question will be a simple 'no'. If not, I'll readily upload whatever information is required.

On Linux I can quite easily prefix the DRI_PRIME=1 variable to any command to run it through the dGPU and in context of games this works flawlessly. I want to switch to BSD very badly but this is the one thing hindering my approval.

Does anybody know of a recent method that allows both Intel and AMD gpu's to work together? I understand they work separately if I disable one or the other through BIOS but I am looking for the ability to use my 'hybrid graphics' as AMD advertised it.

PS: I'm on 12.2-RELEASE.

Cheers.
 

Zirias

Son of Beastie

Reaction score: 1,702
Messages: 2,870

I assume the answer is no, according to this search on the source:

My guess is that this is Linux' kernel config knob for the feature, and it isn't enabled anywhere, which probably has reasons…
 
OP
A

agregate

New Member

Reaction score: 1
Messages: 5

I assume the answer is no, according to this search on the source:

My guess is that this is Linux' kernel config knob for the feature, and it isn't enabled anywhere, which probably has reasons…
And while the encapsulated functions are called they don't do anything either... That's a shame I suppose - though is drm-kmod the only way?
 

Snurg

Daemon

Reaction score: 595
Messages: 1,349

You might want to try without KMS.

Just remove the i915kms.ko and radeonkms.ko kernel modules as well as drm-kmod.
According to tests made by reputable people, the xf86-video-intel driver seems to work fine without KMS.

Personally, I had not yet the opportunity to test on actual hardware, whether the xf86-video-ati driver still works without KMS.
So you might want to give it a try.
 

Zirias

Son of Beastie

Reaction score: 1,702
Messages: 2,870

I think this is rather pointless, as the goal is to actually use accelerated 3d-rendering on the second card for a specific application while normally using the primary card in the X session.

I'm not sure *why* this option isn't active, I assume there *are* reasons, but it might make sense to ask about it on a mailing list (freebsd-desktop and freebsd-x11 would come to mind? Is there a better suited one?) or directly on the drm-kmod github project.

is drm-kmod the only way?
Well, this is about rendering performance, right? So, yes, drm-kmod are the only kernel rendering drivers available on FreeBSD, they are imported from Linux.

For now, if the Radeon is the more powerful GPU and you need that, your only option would be to use it exclusively.
 

Snurg

Daemon

Reaction score: 595
Messages: 1,349

I think this is rather pointless, as the goal is to actually use accelerated 3d-rendering on the second card for a specific application while normally using the primary card in the X session.
Is this possible only with KMS?
 

Snurg

Daemon

Reaction score: 595
Messages: 1,349

You won't get *any* accelerated 3d rendering without a kernel driver.
Are you sure?
As far as I understand, the xf86-video-ati and xf86-video-amdgpu as well as the xf86-video-intel are made by their respective vendors.
So I wonder, don't they have full functionality (incl. 3D)?

TearFree is just an example why many people use these drivers, as the kernel driver apparently lacks a lot of the functionality of the vendors' drivers.

But I don't really know, so I ask.
 

Zirias

Son of Beastie

Reaction score: 1,702
Messages: 2,870

Yes, I'm sure. For 3d acceleration, DRI/DRM is used, which is an interface with the kernel driver. And btw, they aren't "made by vendors" either.
 

Snurg

Daemon

Reaction score: 595
Messages: 1,349

Yes, I'm sure. For 3d acceleration, DRI/DRM is used, which is an interface with the kernel driver.
Thank you, that were the right pointers. https://dri.freedesktop.org/wiki/
And btw, they aren't "made by vendors" either.
To me it seems that the vendors have at least some role in the driver development, as the copyrights suggest.

https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu/-/blob/master/src/amdgpu_drv.h :
Code:
* Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
 *                VA Linux Systems Inc., Fremont, California.
 *
 * All Rights Reserved.
https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/blob/master/src/intel_device.c :
Code:
Copyright 2013 Intel Corporation.  All Rights Reserved.
 

Zirias

Son of Beastie

Reaction score: 1,702
Messages: 2,870

Well sure, they probably contribute (a lot of?) code, but the drivers are managed in the XOrg project, at least as far as I know.
 
OP
A

agregate

New Member

Reaction score: 1
Messages: 5

I think this is rather pointless, as the goal is to actually use accelerated 3d-rendering on the second card for a specific application while normally using the primary card in the X session.
You're right. X is run on the Intel iGPU and rendering is deferred upon request to the dGPU which is then passed back to X.

Well, this is about rendering performance, right? So, yes, drm-kmod are the only kernel rendering drivers available on FreeBSD, they are imported from Linux.
As far as I know the only drivers on Linux I have come from the xf86 set but regardless, I'm going to have to wait for drm-kmod to hopefully provide support one day...
 

Zirias

Son of Beastie

Reaction score: 1,702
Messages: 2,870

As far as I know the only drivers on Linux I have come from the xf86 set but regardless, I'm going to have to wait for drm-kmod to hopefully provide support one day...
The drivers in drm-kmod are taken from Linux. On Linux, they are part of the official kernel. So, you didn't have to install anything, they were just auto-loaded.
 

Hakaba

Active Member

Reaction score: 126
Messages: 242

PRIME is not only for performance.
I have a laptop (MSI P65) where HDMI and Displayport are wired in the NVidia card and the internal screen is wired in the Intel card.
I am not able to use external screen and the internal screen at the same time.
As I know, there is no solution in FreeBSD.
 

Zirias

Son of Beastie

Reaction score: 1,702
Messages: 2,870

Hakaba I *assume* this should work if you sacrifice direct rendering for one of the displays. But I don't own such a machine, so can't test.
 

Trihexagonal

Son of Beastie

Reaction score: 2,356
Messages: 2,977

Every picture tells a story Here's the rest of the Story :

Thinkpad T400
Intel Core2 Duo P8600 @ 2.4GHz
8GB PC3-8500 RAM
250GB Scorpio Black HDD @ 7200RPM
Switchable Graphics with Intel GMA 4500MHD and ATI Mobility Radeon HD 3470
14.1" 1280x800 (WXGA) with LED backlight
Intel HD Audio
CD-RW/DVD
Intel Gigabit Ethernet (10/100/1000) PCI-Express
This has "Switchable Graphics" and needs to be put into "Discreet" graphics mode in the BIOS. It then defaults to the Radeon chip and runs fine without any tweaking. I installed both drivers when building X.

https://forums.freebsd.org/threads/notebook-laptop-compatibility-list.17308/page-5
 
OP
A

agregate

New Member

Reaction score: 1
Messages: 5

This has "Switchable Graphics" and needs to be put into "Discreet" graphics mode in the BIOS. It then defaults to the Radeon chip and runs fine without any tweaking. I installed both drivers when building X.
By forcing it into a single-GPU mode you are by the very definition of the word not using switchable graphics.
It's nice to see other people using T400's too but unfortunately I cannot afford to change to BSD unless I can have both cards active at once.
 

Trihexagonal

Son of Beastie

Reaction score: 2,356
Messages: 2,977

By forcing it into a single-GPU mode you are by the very definition of the word not using switchable graphics.
It's nice to see other people using T400's too but unfortunately I cannot afford to change to BSD unless I can have both cards active at once.

You ask if it can be done. I show you it has been done. Then you tell me I'm doing it wrong?

I've used the Intel and Radeon on different builds and Radeon is the one I want running all the time, Same goes with Optimus, I want the nvidia driver all the time. Too bad for you but I'll keep running mine as mine.

We'll have you over for supper on night, no doubt.
 
OP
A

agregate

New Member

Reaction score: 1
Messages: 5

You ask if it can be done. I show you it has been done. Then you tell me I'm doing it wrong?
I don't think you know what you're talking about. Switchable graphics means switching between graphics cards while the system is running and setting a specific card in the BIOS is NOT what I am asking, nor is it the same thing.
This has "Switchable Graphics" and needs to be put into "Discreet" graphics mode in the BIOS. It then defaults to the Radeon chip and runs fine without any tweaking. I installed both drivers when building X.
You are disabling the ability to switch graphics by putting it into discrete mode.... It doesn't 'default' to the card at all. You are selecting the card by manually setting it to discrete. The Radeon in these computers is the dGPU and the Intel the iGPU. Your computer doesn't get to choose which is which.
We'll have you over for supper on night, no doubt.
I beg your pardon?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,744
Messages: 39,332

Settle down ladies, don't get your knickers in a twist over a simple misunderstanding.

AMD's "Dynamic Switchable Graphics" is similar to NVidia's Optimus. Graphics normally run through the low-power Intel graphics until you access things like OpenGL, then the AMD or NVidia GPU is kicked into gear and provides the rendering. This is done to save power during normal operation, which is rather important for laptops for example. It has nothing to do with being able to switch between IGD (Internal Graphics Device) or PEG (PCIe Graphics), although that function is often available in the BIOS/UEFI too.
 
Top