Giter Club home page Giter Club logo

Comments (13)

neutral888 avatar neutral888 commented on August 26, 2024 1

Hi @katef thanks for the reply. Bummer about the dGPU - I haven't been able to get it to shut off either yet. I wonder if using the 4.8.6 kernel will make a difference? Apparently it has more recently added support AMDGPU, Radeon, i915 etc.

from gpu-switch.

katef avatar katef commented on August 26, 2024

Ah, I booted rEFInd's USB flash image, which has an option to run apple_set_os and then continue to run grub from my EFI partition. That worked just fine - the integrated graphics works, and now I see it on the PCI bus:

what# lshw -c video
  *-display UNCLAIMED
       description: VGA compatible controller
       product: Venus XT [Radeon HD 8870M / R9 M270X/M370X]
       vendor: Advanced Micro Devices, Inc. [AMD/ATI]
       physical id: 0
       bus info: pci@0000:01:00.0
       version: 83
       width: 64 bits
       clock: 33MHz
       capabilities: pm pciexpress msi vga_controller bus_master cap_list
       configuration: latency=0
       resources: memory:80000000-8fffffff memory:b0c00000-b0c3ffff ioport:3000(size=256) memory:b0c40000-b0c5ffff
  *-display
       description: VGA compatible controller
       product: Crystal Well Integrated Graphics Controller
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 08
       width: 64 bits
       clock: 33MHz
       capabilities: msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:49 memory:b0000000-b03fffff memory:a0000000-afffffff ioport:4000(size=64) memory:c0000-dffff

I don't want to install rEFInd to my disk's EFI partition, but I think it's using this EFI thing which just sets apple_set_os and then chainloads another EFI bootloader: https://github.com/0xbb/apple_set_os.efi
So I'll try that instead of using rEFInd from a USB device.

Meanwhile I have the same question: why is the ATI card visible on my PCI bus? Is it really that both cards are enabled?

Thanks,

from gpu-switch.

0xbb avatar 0xbb commented on August 26, 2024

Hi,
yes both cars are enabled.
Linux may will support dynamically switching between both cards in the future.

Meanwhile you could use cat /sys/kernel/debug/vgaswitcheroo/switch to see which card is active and echo OFF > /sys/kernel/debug/vgaswitcheroo/switch to switch of the unused dedicated card.

from gpu-switch.

katef avatar katef commented on August 26, 2024

Hi,

Sorry it's taken me a while to get back to you.

I'm currently trying to figure out why /sys/kernel/debug/vgaswitcheroo doesn't exist.

I'm running a kernel with:

CONFIG_VGA_SWITCHEROO=y

and I have grub booting with /etc/default/grub:

GRUB_CMDLINE_LINUX_DEFAULT="quiet nosplash i915.modeset=1 radeon.modeset=1"

which indeed I see in dmesg:

[    0.000000] Linux version 4.6.4 (root@what) (gcc version 6.2.0 20160822 (Debian 6.2.0-1) ) #1 SMP Mon Aug 29 00:10:39 BST 2016
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.6.4 root=UUID=c70a8075-c8f3-4047-a33c-bbbdfcfb22a1 ro libata.force=noncq quiet nosplash i915.modeset=1 radeon.modeset=1

yet nothing here:

# ls /sys/kernel/debug/vgaswitcheroo
ls: cannot access '/sys/kernel/debug/vgaswitcheroo': No such file or directory

Any idea what I might be missing? Thank you!

from gpu-switch.

neutral888 avatar neutral888 commented on August 26, 2024

Hi all, @0xbb THANKS for putting this together!

I had the same problems as you @katef (MBP 11,5) - also got it working via rEFind and apple_set_os. By 'working' I mean the system can use both graphics cards whilst in debian.

@katef have you been able to use just the intel integrated graphics card only (and disable the dedicated GPU) yet?

Also, are proprietary drivers required to be able to just boot into the os using integrated card or can this be done completely open source?
Thanks :-)

from gpu-switch.

katef avatar katef commented on August 26, 2024

Hi @neutral888 - No, I'm not able to disable the discrete GPU, because /sys/kernel/debug/vgaswitcheroo does not exist for me. I haven't been able to find why it's not present.

So currently I'm using the Intel GPU, but the dedicated GPU is not disabled.

from gpu-switch.

neutral888 avatar neutral888 commented on August 26, 2024

Hi everyone and @katef
I have been able to switch off the dGPU and use only the iGPU using the following commands:

sudo mount -t debugfs debugfs /sys/kernel/debug -> this mounts vgaswitcheroo
sudo cat /sys/kernel/debug/vgaswitcheroo/switch -> this shows what is being used
echo OFF > /sys/kernel/debug/vgaswitcheroo/switch -> this turns off the GPU that doesn't have the + sign next to it. (must be done in root, not just via sudo).

Only problem now is that this has lead to no longer being able to adjust brigtness settings.
Any ideas anyone?

from gpu-switch.

ah- avatar ah- commented on August 26, 2024

It probably picks the wrong backlight driver, try finding the gmux one in /sys and setting the brightness by writing to the brightness file.

from gpu-switch.

neutral888 avatar neutral888 commented on August 26, 2024

Thanks for the reply, @ah-
/sys/class/backlight contains gmux-backlight and radeon_bl0
I am able to adjust the brightness with the backlight file in gmux-backlight!
How do I link it to my brightness buttons and refer them to changing the setting in this file?
ps sorry for my newbie question

from gpu-switch.

ah- avatar ah- commented on August 26, 2024

Sorry, I don't know. I just remember having the same issue myself a long time ago.

from gpu-switch.

egorenar avatar egorenar commented on August 26, 2024

Hi all,

I also have a MacBook Pro 11,5 and running Void Linux with Linux 4.11.11.
I have a blackscreen when I disable DIS and enable IDG.
I have macOS 10.12.6 and use apple_set_os.efi.
Any idea what could be the problem ?

Thanks in advance
Regards

from gpu-switch.

dortamiguel avatar dortamiguel commented on August 26, 2024

I have a MacBook Pro 11,5 and it runs perfectly

from gpu-switch.

 avatar commented on August 26, 2024

@neutral888 I know this question is ancient at this point, and I hope by now you've figured it out, but I hope it'll help someone else if it doesn't help you. I made the following script after studying all of the comments on these links:
https://askubuntu.com/questions/812734/macbook-pro-backlight-control-not-working-on-ubuntu-16-04
https://bugzilla.kernel.org/show_bug.cgi?id=105051

I have to run this every now and then after kernel updates, but it's still working as of this post.

cd ~/
mkdir brightness-fix
cd brightness-fix

# grab copy of source
curl -O https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.8.7.tar.xz
tar xf linux-4.8.7.tar.xz
cd linux-4.8.7/drivers/platform/x86

# patch it
curl -o file.patch https://bugzilla.kernel.org/attachment.cgi?id=218051
patch apple-gmux.c < file.patch

# build it
echo '
obj-m += apple-gmux.o
all:
	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
' > Makefile
make

# install
targetDir="/lib/modules/$(uname -r)/kernel/drivers/platform/x86"
sudo cp ${targetDir}/apple-gmux.ko ${targetDir}/apple-gmux.ko.backup
sudo cp apple-gmux.ko ${targetDir}

cd ~/
rm -r ./brightness-fix

reboot

This worked for me on Ubuntu Gnome 16.04 last year, and has since been working on Linux Mint 18.3

from gpu-switch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.