NVIDIA Optimus Bumblebee Mint 19 [論壇 - LinuxMint]


正在瀏覽:   1 名遊客


 到底部   前一個主題   下一個主題  [無發表權] 請登錄或者註冊



NVIDIA Optimus Bumblebee Mint 19
會員二級
註冊日期:
2017/3/23 10:15
所屬群組:
已註冊使用者
等級: 4
HP : 0 / 87
MP : 11 / 337
EXP: 50
離線
首先安裝 nvidia 驅動
參考 https://www.ubuntu-tw.org/modules/newbb/viewtopic.php?topic_id=107584&forum=48

然後再編譯 Bumblebee

##################################
### bbswitch
##################################
# Build Requires:
sudo apt-get install gcc make patch linux-headers-amd64

git clone https://github.com/Bumblebee-Project/bbswitch

sudo mkdir -p /usr/src/bbswitch-0.8
sudo cp bbswitch/bbswitch.c /usr/src/bbswitch-0.8/
sudo cp bbswitch/Makefile /usr/src/bbswitch-0.8/
sudo cp bbswitch/dkms/dkms.conf /usr/src/bbswitch-0.8/

sudo /usr/sbin/dkms remove -m bbswitch -v 0.8 --all
sudo /usr/sbin/dkms build -m bbswitch -v 0.8 -k $(uname -r)
sudo /usr/sbin/dkms install -m bbswitch -v 0.8 -k $(uname -r)

sudo sh -c 'echo "options bbswitch load_state=0 unload_state=1" > /etc/modprobe.d/50-bbswitch.conf'

##################################
### primus
##################################
# Build Requires:
sudo apt-get install gcc-multilib g++-multilib mesa-common-dev libx11-dev libx11-dev:i386

# PKG Depends:
sudo apt-get install socat xserver-xorg-core libgl1-mesa-dri libc6 libgcc1 libgl1-mesa-glx libstdc++6 libx11-6
sudo apt-get install libgl1-mesa-dri:i386 libc6-i386 libgcc1:i386 libgl1-mesa-glx:i386 libstdc++6:i386 libx11-6:i386

git clone https://github.com/amonakov/primus

# Patch for Debian / Ubuntu
sed -i 's/$(dirname.*/'"'\/usr\/\$LIB\/primus'"'}/g' primus/primusrun
sed -i '/LD_LIBRARY_PATH/d' primus/primusrun
sed -i '/exec/d' primus/primusrun
echo 'bblibs=$(echo -ne '"'Q LibraryPath\0'"' | \' >> primus/primusrun
echo ' socat - UNIX-CONNECT:/var/run/bumblebee.socket | sed '"'s/^Value: \\(.*\\)/\1/'"')' >> primus/primusrun
echo 'PRIMUS_libGL=${PRIMUS_libGL}${bblibs:+:$bblibs}' >> primus/primusrun
echo 'export LD_LIBRARY_PATH=${PRIMUS_libGL}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}' >> primus/primusrun
echo 'exec "$@"' >> primus/primusrun
sed -i 's/-lX11/$(LDFLAGS) -lX11/g' primus/Makefile

cd primus

LIBDIR=lib64 make
sudo install -D -m755 "primusrun" "/usr/bin/primusrun"
sudo install -D -m755 "lib64/libGL.so.1" "/usr/lib/x86_64-linux-gnu/primus/libGL.so.1"

# Build 32-bit Library
export CC="gcc -m32"
export CXX="g++ -m32"
LIBDIR=lib32 make

sudo install -D -m755 "lib32/libGL.so.1" "/usr/lib/i386-linux-gnu/primus/libGL.so.1"

##################################
### bumblebee
##################################
# Build Requires:
sudo apt-get install automake libbsd-dev libglib2.0-dev libc6-dev libx11-dev help2man pkg-config libkmod-dev

# PKG Depends:
sudo apt-get install xserver-xorg-core libbsd0 libglib2.0-0 libc6 libx11-6 libkmod2

git clone https://github.com/Bumblebee-Project/Bumblebee

# Patch for Debian / Ubuntu:
wget https://raw.githubusercontent.com/Mint-Fans/linux-package/NVIDIA/bumblebee-debian.patch
patch -p0 -i bumblebee-debian.patch

cd Bumblebee
autoreconf -fi
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--without-pidfile \
--with-udev-rules=/lib/udev/rules.d/ \
CONF_DRIVER_MODULE_NVIDIA=nvidia \
CONF_LDPATH_NVIDIA=/usr/lib/x86_64-linux-gnu/nvidia:/usr/lib/i386-linux-gnu/nvidia:/usr/lib/nvidia \
CONF_MODPATH_NVIDIA=/usr/lib/nvidia/xorg/,/usr/lib/xorg/modules \
CONF_PRIMUS_LD_PATH=/usr/lib/x86_64-linux-gnu/primus:/usr/lib/i386-linux-gnu/primus:/usr/lib/primus:/usr/lib32/primus \
CONF_XORG_BINARY=/usr/lib/xorg/Xorg

make
sudo make install

sudo install -D -m644 "scripts/systemd/bumblebeed.service" "/lib/systemd/system/bumblebeed.service"

sudo groupadd --system bumblebee
sudo gpasswd -a $USER bumblebee
sudo gpasswd -a $USER video

sudo sh -c 'echo "blacklist nouveau" > /etc/modprobe.d/50-blacklist.conf'
sudo sh -c 'echo "blacklist nvidia" >> /etc/modprobe.d/50-blacklist.conf'
sudo sh -c 'echo "blacklist nvidia-drm" >> /etc/modprobe.d/50-blacklist.conf'
sudo sh -c 'echo "blacklist nvidia-modeset" >> /etc/modprobe.d/50-blacklist.conf'
sudo sh -c 'echo "blacklist nvidia-uvm" >> /etc/modprobe.d/50-blacklist.conf'

sudo sed -i 's/Exec=.*/Exec=sudo optirun -b none nvidia-settings -c :8/g' /usr/share/applications/nvidia-settings.desktop

sudo systemctl enable bumblebeed.service

sudo update-initramfs -u

然後重啟


7/2 9:32:17
應用擴展 工具箱


 [無發表權] 請登錄或者註冊


可以查看帖子.
不可發帖.
不可回覆.
不可編輯自己的帖子.
不可刪除自己的帖子.
不可發起投票調查.
不可在投票調查中投票.
不可上傳附件.
不可不經審核直接發帖.