Bumblebee-Project / bbswitch

Disable discrete graphics (currently nvidia only)
GNU General Public License v2.0
487 stars 78 forks source link

bbswitch crashes on ubuntu 18.04 #172

Open nergdron opened 6 years ago

nergdron commented 6 years ago

bbswitch loads at boot on 18.04 and disables my nvidia card, even though I've got an /etc/modules-load.d/bbswitch.conf containing:

options bbswitch load_state=1 unload_state=1

then, when I try to run "tee /proc/acpi/bbswitch <<<ON" to enable the card post-boot, it segfaults on the cli, and dmesg contains the following:

[  273.638475] general protection fault: 0000 [#1] SMP PTI
[  273.638481] Modules linked in: msr thunderbolt nf_conntrack_netlink nfnetlink xfrm_user xfrm_algo xt_addrtype br_netfilter ccm rfcomm ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack xt_CHECKSUM iptable_mangle ipt_REJECT nf_reject_ipv4 xt_tcpudp bridge stp llc ebtable_filter ebtables ip6table_filter ip6_tables devlink iptable_filter pci_stub vboxpci(OE) vboxnetadp(OE) vboxnetflt(OE) ec_sys vboxdrv(OE) cmac bnep bbswitch(OE) binfmt_misc nls_iso8859_1 uvcvideo btusb videobuf2_vmalloc btrtl videobuf2_memops btbcm videobuf2_v4l2 btintel videobuf2_core bluetooth videodev media ecdh_generic arc4 intel_rapl snd_hda_codec_hdmi iwlmvm x86_pkg_temp_thermal intel_powerclamp coretemp mac80211 snd_hda_codec_realtek snd_hda_codec_generic
[  273.638550]  kvm_intel kvm iwlwifi irqbypass snd_hda_intel intel_cstate intel_rapl_perf snd_hda_codec snd_hda_core rtsx_pci_ms snd_seq_midi input_leds snd_hwdep joydev snd_seq_midi_event cfg80211 serio_raw snd_rawmidi mxm_wmi intel_wmi_thunderbolt memstick snd_pcm snd_seq snd_seq_device snd_timer snd intel_pch_thermal soundcore shpchp mac_hid acpi_pad sch_fq_codel parport_pc ppdev lp parport ip_tables x_tables autofs4 zfs(PO) zunicode(PO) zavl(PO) icp(PO) zcommon(PO) znvpair(PO) spl(O) algif_skcipher af_alg dm_crypt raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 multipath linear system76(OE) hid_generic usbhid hid crct10dif_pclmul rtsx_pci_sdmmc crc32_pclmul ghash_clmulni_intel pcbc i915 aesni_intel i2c_algo_bit aes_x86_64 crypto_simd
[  273.638625]  glue_helper drm_kms_helper cryptd syscopyarea sysfillrect sysimgblt fb_sys_fops psmouse r8168(OE) nvme drm ahci nvme_core rtsx_pci libahci wmi video
[  273.638646] CPU: 5 PID: 21287 Comm: tee Tainted: P           OE    4.15.0-23-generic #25-Ubuntu
[  273.638649] Hardware name:  System76  Oryx Pro/ Oryx Pro, BIOS 1.05.02dRSA2 02/20/2017
[  273.638657] RIP: 0010:dis_dev_get+0x15/0x40 [bbswitch]
[  273.638660] RSP: 0018:ffffb13f6c78fe48 EFLAGS: 00010286
[  273.638664] RAX: a700ff8f0b00020f RBX: 0000000000000003 RCX: 0000000000000000
[  273.638667] RDX: 0000000000000003 RSI: 00007fff8435ecf3 RDI: ffffb13f6c78fe53
[  273.638670] RBP: ffffb13f6c78fe78 R08: ffffb13f6c790000 R09: ffff9fe60957812c
[  273.638673] R10: 0000000000000001 R11: 0000000000000000 R12: ffffb13f6c78fe50
[  273.638675] R13: 00007fff8435ecf0 R14: 00007fff8435ecf0 R15: ffff9fe61a22b200
[  273.638679] FS:  00007f7455cec540(0000) GS:ffff9fe642140000(0000) knlGS:0000000000000000
[  273.638682] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  273.638685] CR2: 00007fff8435dff8 CR3: 00000007fe4d0002 CR4: 00000000003606e0
[  273.638688] Call Trace:
[  273.638695]  ? bbswitch_proc_write+0x5a/0xbe [bbswitch]
[  273.638702]  proc_reg_write+0x45/0x70
[  273.638709]  __vfs_write+0x1b/0x40
[  273.638714]  vfs_write+0xb1/0x1a0
[  273.638720]  SyS_write+0x55/0xc0
[  273.638726]  do_syscall_64+0x73/0x130
[  273.638733]  entry_SYSCALL_64_after_hwframe+0x3d/0xa2
[  273.638737] RIP: 0033:0x7f7455809154
[  273.638739] RSP: 002b:00007fff8435ec08 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
[  273.638744] RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f7455809154
[  273.638746] RDX: 0000000000000003 RSI: 00007fff8435ecf0 RDI: 0000000000000003
[  273.638749] RBP: 00007fff8435ecf0 R08: 0000000000000003 R09: 00007f7455cec540
[  273.638752] R10: 00000000000001b6 R11: 0000000000000246 R12: 000056222e47f460
[  273.638755] R13: 0000000000000003 R14: 00007f7455ae0760 R15: 0000000000000003
[  273.638758] Code: d2 48 c7 c6 a0 20 06 c1 48 89 e5 e8 e6 c5 23 ce 5d c3 0f 1f 40 00 0f 1f 44 00 00 48 8b 05 a4 25 00 00 48 8b 40 10 48 85 c0 74 20 <48> 8b 78 38 48 85 ff 74 17 55 48 81 c7 a0 00 00 00 be 04 00 00

this is on kernel version 4.15.0-23-generic, with nvidia driver version 396.24-0ubuntu1.

Lekensteyn commented 6 years ago

Is bumblebeed installed or just bbswitch? The former will usually write OFF to /proc/acpi/bbswitch.

Aside from that, if you have enabled runtime PM (e.g. both /sys/bus/pci/devices/0000:01:00.0/power/control and its parent device show auto instead of on), then it will cause interference with bbswitch. Disable bbswitch in that case.