Skip to content

Instantly share code, notes, and snippets.

@LoadLow
Last active July 30, 2022 22:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LoadLow/9ede70dcb9081ca7697439da1a21b8f2 to your computer and use it in GitHub Desktop.
Save LoadLow/9ede70dcb9081ca7697439da1a21b8f2 to your computer and use it in GitHub Desktop.
Backbox setup for Nvidia CUDA without using Nvidia as default driver (X11) but Intel/Nouveau and fix possible issues.

Setup virtualgl/nvidia/bumblebee

dpkg -i virtualgl*.deb
  • Setup bumblebee for nvidia :
sudo apt-get install linux-headers-$(uname -r) freeglut3-dev libxmu-dev libpcap-dev bumblebee-nvidia primus
  • Setup via additional drivers UI Nvidia latest/tested version (352.69 currently)

  • Configure bumble bee :

    in /etc/bumblebee/bumblebee.conf : Driver=nvidia and replace all lines with nvidia-current with your nvidia version (e.g nvidia-352)

    then

    sudo service bumblebeed restart

  • Setup nvidia-modprobe sudo apt-get install nvidia-modprobe (auto module loader for non-root users) and nvidia-prime sudo apt-get install nvidia-prime

Setup cuda

  • Download cuda 7.5 (.run mode, and answer no to "setup NVIDIA driver 3XX ...") and NEVER use nvidia driver for X11 server (use sudo prime-select intel if you need to disable nvidia)

  • Add to your PATH env variable : /opt/VirtualGL/bin:/usr/local/cuda-7.5/bin

  • Add to /etc/ld.so.conf : /usr/local/cuda-7.5/lib64 then run sudo ldconfig

  • Add lines to file at startup (e.g /etc/rc.local)

NVIDIA_VERSION=352
update-alternatives --set x86_64-linux-gnu_gl_conf /usr/lib/nvidia-$NVIDIA_VERSION-prime/ld.so.conf
update-alternatives --set i386-linux-gnu_gl_conf /usr/lib/nvidia-$NVIDIA_VERSION-prime/alt_ld.so.conf
prime-select intel
  • Now reboot your laptop

Test Cuda

  • Then you can test your CUDA setup :
cd ~/NVIDIA_CUDA-7.5_Samples/1_Utilities/deviceQuery
make
optirun ./deviceQuery
  • How to use with cudaHashCat64 or another runnable compatible with CUDA ?
alias cuda='optirun --no-xorg'

#then:
cuda ./cudaHashCat64 -b

Ignore update of packages (because we don't need upgrades) :

  1. search nvidia installed packages : sudo dpgk --get-selections | grep 'install' | grep 'nvidia'
  2. search libcuda installed packages : sudo dpgk --get-selections | grep 'install' | grep 'cuda'
  3. for each, mark hold in apt : sudo apt-mark hold <package>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment