Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for FreeBSD support #240

Open
ekd123 opened this issue Aug 27, 2012 · 5 comments
Open

Request for FreeBSD support #240

ekd123 opened this issue Aug 27, 2012 · 5 comments

Comments

@ekd123
Copy link

ekd123 commented Aug 27, 2012

FreeBSD also has a group who use it. And we DO need this tool. THANKS!

@Lekensteyn
Copy link
Member

This request has been done before on #bumblebee-dev on Freenode IRC. Since I do not have experience with FreeBSD, I cannot help with coding for it. Patches are welcome, but basically you first need to get the following parts working:

  • virtualgl (for actually getting rendered stuff visible on your screen)
  • bbswitch (for disabling/enabling the nvidia card)

I cannot help you with Virtual GL. Neither can I help you with FreeBSD-specific kernel code, but if you have questions on how bbswitch works and cannot understand it from source, feel free to ask.

Bumblebee is a glue around existing tools.

Preparation:

  • Install the nvidia driver in a path such that libGL.so from nvidia does not get used by default.
  1. disable card on startup to save power
  2. on a request to run something with the nvidia card:
    1. enable the nvidia card (if not already)
    2. start an X server on the nvidia card (if not already). For the options, see src/bbsecondary.src. An example Xorg conf file for nvidia is here.
    3. make the target program (e.g. glxspheres) run using virtualgl on the newly started X server. Done in src/optirun.c. Assuming the X server referred in step 2.2 was started on :8, run vglrun -d :8 -ld /path/to/nvidia/ glxspheres
  3. when all programs using the nvidia card are closed:
    1. close the X server
    2. disable the nvidia card.

As for bbswitch (enable/disable the nvidia card in the steps above), you basically have to call some ACPI methods that disable the nvidia card. The methods _PS0 and _PS3 should be called indirectly by the ACPI subsystem of the kernel so it can track the hardware state. See the bbswitch source.

@fdemian
Copy link

fdemian commented Aug 23, 2014

Hi.

Sory for commenting on what seems to be an old thread/feature request, but I ran into this problem (my laptop has optimus and I wanted to run FreeBSD on it).

Is bbswitch capable of disabling the optimus technology? Is it a standalone component? I'm asking because I might attempt to start porting that myself. For the time being it might be an acceptable solution (until a complete bumblebee port emerges).

@Lekensteyn
Copy link
Member

Hi fdemlan,

bbswitch does and cannot disable Optimus. It basically calls an (apparently standarized) device-specific ACPI method to disable the card completely. It can be used without bumblebeed (which is what I am doing right now).

@fdemian
Copy link

fdemian commented Nov 23, 2014

Thank you for your response, Lekensteyn.

I was recently informed that basic Optimus support has been added on FreeBSD https://wiki.freebsd.org/OptimusVideoSupport .

I have no idea if it is based on this project, but It doesn't look like it is. Just letting you know so you can point FreeBSD users to that link.

Regards.

@ArchangeGabriel
Copy link
Member

This is definitively based on what Bumblebee does with it VirtualGL backend, i.e. start a second X server on the NVIDIA card with a particular configuration, and then use VirtualGL to transfer frames from the second to the first server. As Lekensteyn said above, Bumblebee just uses existing tools, here we configure almost everything so that the end user just has to optirun foo.

@ArchangeGabriel ArchangeGabriel modified the milestone: Bumblebee Future Jan 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants