All posts tagged nvidia

This tutorial – especially Step 3 – has changed considerably. Please work through it carefully and report any issues to me immediately so I can help others.

We are rooting the Shield Android TV (2017; 16GB SKU) running Android 8.0 (aka Oreo) on v7.2.2. Note: This uses a special patched bootloader and will not work in future updates. You’ll need to apply FULL OTA upgrades to restore the bootloader, then repeat this tutorial with the proper version bootloader.  Looking for the Shield TV (2015; 16GB SKU) tutorial?  Click here.  Looking for the 500GB SKU tutorial?  Click here.

Step 1: Pre-Requisites and Warnings

Download the following items – Make sure you get the RIGHT patched bootloader for your Shield TV version:

Ensure you have the following items:

  • USB Mouse – optional
  • Shield Controller with USB Cable
  • Male to Male USB 3.0 Cable (Amazon; verified working) or possibly this gender change from Monoprice (if anyone tries it, please let us know success or failure)  Note: Many users have reported a USB 2.0 cable may work.  It probably depends on the cable quality, etc.

There is a chance you may need a USB hub to complete this tutorial. If you do not have one on hand, here is one from Amazon that is one day Prime shipping and should do the trick. Probably should have this on-hand before starting – just in case.  Take a look around your desk; many monitors have USB hubs built in.  Many keyboards act as a USB hub.If for some reason you have to pull the Male to Male Cable during the Fastboot process, you may avoid using a USB hub IF you haven’t used Adoptive Storage.

Data Destruction Notice

Unlocking the bootloader will ERASE EVERYTHING internally (not on your external SD card if present; adopted storage users may want to make a backup of their SD card contents).  Make sure you have everything saved off and backed up.  You’ll have to resign into Google – so if you use two-step authentication, be sure to have your Google Authenticator app ready.

The process of rooting will not destroy any data.You will need to be able to see your PC AND the Shield TV’s HDMI out in order to perform this.  I used one monitor with two inputs and flipped back and forth as needed.TWRP doesn’t currently work on 4k displays!  Use a 1080p display to complete this tutorial.

Step 2: Preparation

  1. Install Minimal ADB and Fastboot (if you do not already have it installed).
  2. Ensure the Shield Family drivers are extracted somewhere on your system and you know where they are.
  3. Make sure you know how to get to Device Manager on your PC.
  4. Extract TWRP Recovery image from the ZIP file (and do yourself a favor and rename it to something easy like twrprecovery.img). Put this in your Minimal ADB and Fastboot folder (usually c:program files(x86)Minimal ADB and Fastboot).
  5. Copy supersu.zip (it may be named differently; you downloaded it above) into your Minimal ADB and Fastboot folder. Do not extract it.
  6. Plug your Shield TV into the PC with a Male to Male USB 3.0 Cable (Amazon; verified working).Note: Not all USB cables are created equally!  The linked cable above we have verified works.  Not all USB ports are the same.  Some on the back of the PC may work better than those on the front.  Use a USB 3.0 port (you can tell if it is blue inside) – that is what we used.  USB 2.0 may work but that is untested.
  7. Plug your Shield Controller into the USB port right next to the HDMI cable.  The other port will NOT work.  Note: If your bootloader is unlocked already, you don’t need to do this.
  8. Confirm drivers for ADB are installed:
    1. On your PC, go to Device Manager.  Find the yellow (!) ADB device (depending on your version of Windows, it may read differently).  If none exist, you probably already have drivers.  Skip to step 9.
    2. Right click the device and select Update Driver.
    3. When offered, browse your computer for the driver and point it to the Shield Family Drivers folder you extracted in Preparation Step 2 above.
    4. When finished with the driver install, the (!) yellow device should be gone.
  9. Enable Developer mode on Shield TV
    1. On the Shield TV, go to Settings->About->Build (click 7 times on BUILD to unlock developer mode)
  10. Enable USB Debugging on Shield TV
    1. Settings -> Developer -> Debugging; set to On
    2. A popup should appear asking for this PC’s authorization.  Check the Don’t ask again for this PC box and select Allow.  If it doesn’t show up now, it will later.
  11. Enable PC connection to Shield TV
    1. Go to Settings -> Storage & reset
    2. Under SHIELD storage access, turn on Using USB

Step 3: Root Procedure

  1. Install Magisk Manager and Sideload Launcher
    1. Make sure you have the Magisk Manager apk (Magisk-Manager700.apk or whatever you named it when you downloaded it above) in your Minimal ADB and Fastboot folder.
    2. Make sure you have the Sideload Launcher apk (sideload-launcher-android-tv.apk or whatever you named it when you downloaded it above) in your Minimal ADB and Fastboot folder.
    3. Launch Minimal ADB and Fastboot from the Start Menu or icon.  This puts you in a black DOS box.
    4. Type “adb devices” and make sure your Shield TV appears.  Note: If you didn’t have a popup on your screen in Step 10.2 above, it probably will appear now.  You’ll have to authorize the PC before it will show up under adb devices.
    5. Type “adb install magisk-manager700.apk” (or whatever you named it) and hit enter. You will get a success message in the DOS box window.
    6. Type “adb install sideload-launcher-android-tv.apk” (or whatever you named it) and hit enter. You will get a success message in the DOS box window. If you already have Sideload Launcher previously installed, this won’t work – nor is this step necessary.
  2. Reboot into Bootloader on Shield TV
    1. Type “adb reboot bootloader” and hit enter.  The Shield TV should reboot into the bootloader screen.   Note: This can take several seconds on a black screen.  Bootloader won’t show on a 4K display.  Use a 1080p display.
    2. If you are sure Fastboot drivers work and you do not need to unlock the bootloader, jump to Step 9.
  3. Verify Fastboot Drivers are installedNote: If Windows complains about the USB port (Driver Descriptor, etc.) under Universal Serial Bus Controllers and your device doesn’t show up with “fastboot devices” – change ports.  I’ve NEVER seen this happen before now.  Switching USB ports solved the issue.
    1. On your PC, go to Device Manager.
    2. See if a yellow (!) exists that mentions FASTBOOT.  If not, continue to Step 4 to unlock bootloader.
    3. Right click the device and select Update Driver.
    4. When offered, browse your computer for the driver and point it to the Shield Family Drivers folder you extracted in Preparation Step 2 above.
    5. When finished with the driver install, the (!) yellow device should be gone.
    6. Type “fastboot devices” and make sure your Shield TV is visible.
  4. Unlock Bootloader (skip if you already unlocked your bootloader)
    1. Type in “fastboot oem unlock” and hit enter.  EVERYTHING ON THE SHIELD TV WILL BE LOST (other than portable storage)
    2. You will see a prompt on the screen.
    3. Confirm to unlock the bootloader by pressing A on the Shield Controller. Do not be impatient!  Let it finish.
  5. Reboot to Shield TV Interface
    1. Once the bootloader is unlocked, reboot the Shield TV (unplug/plug in) and return to the Shield TV main interface (you will have to go through setup again).
  6. Repeat Preparation: Steps 9 and 10 above to re-enable Developer/USB Debugging.  Note: at some point you will have to re-authorize your PC again; if an ADB command fails, be sure to look at your screen for the authorization prompt.
  7. Unplug the Shield Controller and plug your mouse into the same port.From this point forward you will receive a warning screen on boot, saying that the software cannot be checked for corruption.  You can ignore this; it will boot the system in 5-10 seconds.
  8. Reboot to Bootloader
    1. Type “adb reboot bootloader” and hit enter. The Shield TV should reboot into the bootloader screen.
  9. Install the Magisk Patched Bootloader
    1. Type “fastboot devices” and make sure your Shield TV is visible.
    2. If your Shield TV is listed, type “fastboot flash boot patched_boot_722.img” (or whatever you named it) and hit enter.
    3. Type: “fastboot reboot” and hit enter. Your Shield TV will reboot into the operating system.
  10. Run and update Magisk
    1. Navigate to your Apps on the Shield TV and run Sideload Launcher.
    2. Look for the Magisk Manger app (looks like an Anonymous mask of multi-colors) and run it.
    3. If all is well, you should see that Magisk and Magisk Manager are both installed and up to date. If Magisk doesn’t show installed, you may need to repeat this block of instructions.
    4. Update Magisk and the Manager if prompted to do so.
    5. Exit Magisk Manager
  11. You are now rooted!  Test your root apps now.
  12. Optional: If you want to be able to take OTA versions in the future (you’ll lose root), then go to Settings, Developer options, scroll to the very bottom and turn on Provide full system upgrades.

If Something Goes Wrong

First, don’t panic.  It is pretty hard to permanently “brick” the Shield Android TV just by trying to root it.

No matter what may go wrong, flashing a stock image should put you back in working order.

Follow our tutorial: Tutorial: Restore to Stock Image (Shield TV)

Obviously if your Shield Android TV is stuck in an infinite boot – you cannot reboot to Fastboot from your PC.  You have to do it the “hardware way”.

  1. Unplug your power cable
  2. Plug in your New Shield game controller with the included USB cable into the USB port closest to the HDMI cable
  3. Hold down buttons A & B.
  4. While holding down the two buttons, plug in your power cable (Keep holding down the buttons)
  5. If all went well, the Fastboot menu will show up.

Changelog and Credits

This process originally comes from this XDA thread.  I take no credit for the act; all I’m doing is documenting an easy way to do it.  This tutorial assumes you are running a Shield TV (2017; 16GB) and you have the OTA installed that upgrades you to Oreo.

  • 2019-03-13: Added a patched 7.2.3 bootloader. Make some changes to reflect turning on FULL OTA updates.
  • 2019-03-09: The root process now uses Magisk instead of SuperSU. Tutorial updated to reflect changes.

How to invoke the Android “Fastboot” Menu on SHIELD TV

Answer ID 4359 Updated 03/23/2018 03:10 PM

HOW TO INVOKE THE ANDROID “FASTBOOT” MENU ON SHIELD TV


The new SHIELD TV (16GB):

If you own a SHIELD Controller

  • Unplug SHIELD TV.
  • Connect SHIELD controller to SHIELD TV with a USB cable (use port closest to HDMI).
  • While holding the A and B buttons at the same time, connect power to SHIELD TV.  

If you do not own a SHIELD controller 

  • Unplug SHIELD TV.
  • Connect a USB keyboard directly to SHIELD TV (use port closest to HDMI)
  • While holding the “A” and “B” keys down at the same time, connect power to SHIELD TV.
  • Once you enter Fast Boot mode, on the keyboard use the “X” and “Y” keys to navigate the menu and “A” to select 
     

SHIELD TV Pro or SHIELD TV (2015)

  • Unplug SHIELD TV.
  • Connect a Micro USB cable from the Micro USB port on SATV to a PC.
  • Connect power back to SHIELD TV.
  • Wait 2 seconds, and then hold the NVIDIA power button on SHIELD TV for 5-6s until you see the fastboot menu on the display.

Well compared to Kali, installing Nvidia drivers here is a breeze. As this distro is based on ubuntu rather than debian we have a fairly simple way to install the driver.

I could not find any backbox specific post anywhere hence this quick tutorial. Also, this applies to Ubuntu distro as well. Just follow these simple steps rather than long elaborative tutorials you find anywhere else.

Installation

To select a different driver, or if the above doesn’t work:

 

Verify the installation

The last thing to do is verify that the nvidia drivers are loaded and working. Run the lspci command again and this time the kernel driver should show nvidia

Check the last line which says “kernel driver in use: nvidia”. This shows that nvidia drivers are now in action. Also check hardware acceleration with the glxinfo command

The OpenGL renderer string should be anything other than “MESA”. Then it indicates that the hardware drivers are being used for hardware acceleration.

You can just also run the following command on the terminal to see if its working:

 

I hope this works out for you too!

 

Well, last week we covered how to install nvidia drivers on Kali 2.0 i.e. sana. This time I’m here to update it to the latest of the latest version. The tutorial is pretty easy to follow. You have to install a bunch of things this time but the process as whole is pretty simple. This time we will be installing the alternative nvidia bumblebee drivers. So here it goes.

Now the steps here are pretty simple. If you need a detailed guide. Hit me up!

Analyze the system

First step is to know the system thoroughly, first check nvidia card

lspci -v | egrep -i 'vga|3d|nvidia' | grep -i 'nvidia'

this should return something like bellow, which will give you a brief information about your nvidia GPU, some recent GPU shows them as 3D controllers.

01:00.0 VGA compatible controller: NVIDIA Corporation GF108M [GeForce GT 540M] (rev ff) (prog-if ff)

Now check the currently loaded nouveau (free nvidia driver) module and vga_switcheroo module,

lsmod | grep -i 'nouveau'
lsmod | grep -i 'vga_switcheroo'

Unload nouveau modules and install bbswitch

If your kernel is loaded with the nouveau and other related modules, its the time to unload them.

sudo modprobe -r nouveau
sudo modprobe -r vga_switcheroo

Lets install bbswitch and related components to compile it. Installing bbswitch with dkms will automatically compile proper kernel module after any future kernel update.

apt-get update
apt-get upgrade 
apt-get dist-upgrade
apt-get update
apt-get upgrade 
modprobe -r nouveau 
modprobe -r vga_switcheroo
apt-get install gcc make linux-headers-$(uname -r)
apt-get install dksm bbswitch-dkms 
apt-get install dkms bbswitch-dkms 
modprobe bbswitch load_state=0

Created /etc/modprobe.d/nouveau-blacklist.conf and added “blacklist nouveau” with out quotes

nano /etc/modprobe.d/nouveau-blacklist.conf

nano /etc/modules
Install/Run these commands in sequential order:
apt-get install nvidia-kernel-dkms nvidia-xconfig nvidia-settings
apt-get install nvidia-vdpau-driver vdpau-va-driver mesa-utils
apt-get install bumblebee-nvidia 
sudo dpkg -i /root/Downloads/virtualgl_2.5_amd64.deb 
usermod -aG bumblebee $USER
service bumblebeed restart 
apt-get install devscripts
apt-get build-dep bumblebee
apt-get source bumblebee
sed -i 's/"Xorg"/"\/usr\/lib\/xorg\/Xorg"/' bumblebee-3.2.1/src/bbsecondary.h
bumblebee-3.2.1/
dpkg-buildpackage -us -uc -nc
dpkg -i ../bumblebee_3.2.1-10_amd64.deb 
service bumblebeed restart 
reboot

Uncommented BusID “PCI:01:00:0” and replace the 1 with the number you get from lspci

nano /etc/bumblebee/xorg.conf.nvidia
service bumblebeed restart
optirun -v -b virtualgl -c jpeg glxgears
apt-get install freeglut3-dev libxmu-dev libpcap-dev

nano ~/.bashrc
export PATH=$PATH:/opt/VirtualGL/bin:/usr/local/cuda-7.5/bin
optirun -v -b virtualgl -c jpeg glxgears
optirun -vv glxgears
chmod +x Downloads/cuda_7.5.18_linux.run 
./Downloads/cuda_7.5.18_linux.run --override compiler

 

nano /etc/ld.so.conf
ldconfig
apt-get install libcuda1
cd /root/NVIDIA_CUDA-7.5_Samples/1_Utilities/deviceQuery/
make
optirun ./deviceQuery

Usage

To run your application with the discrete NVIDIA card run in the terminal:

optirun [options] <application> [application-parameters]
For example:

optirun firefox
For a list of options for optirun execute:

optirun --help

Normally you do not use optirun for your window manager, installations, or other non-graphic, resource intensive programs. The optirun command is mainly used for graphic demanding programs (ex. games).

Testing the difference between Intel and the new Nvidia graphics?

After rebooting the system, test the sample glxgears program.

optirun -vv glxgears

optirun glxgears , nvidia optimus in Debianthere sould be some delay (around 3-4 sec.) before starting glxgears, if it returns around or over 1000 FPS performance, that means NVIDIA optimus is working properly. For more information about optirun command, see the man page, man optirun , and run optirun with different arguments, like

optirun -v -b virtualgl -c jpeg glxgears

A more detailed testing and benchmarking the NVIDIA GPU could be done with furmark , which returns more accurate result than this simple glxgears test.

http://fixmynix.com/install-and-configure-nvidia-optimus-with-bumblebee-in-debian/

 

Following the official documentation for installing Nvidia driver on Kali 2.0 didn’t work for me. I installed nvidia-kernel-dkms, disabled nouveau driver, and rebooted. Then I had an error saying Something went wrong.. and presented with only a logout button. I was unable to login to the graphical interface. So I dug every bit of information in the internet and finally installed NVIDIA driver (361.28) on Kali (kernel 4.0.0).

Preparation

First, download the driver for your GPU. To know which driver to download, run lspci | grep -E "VGA|3D" command. It will show the GPU you currently have. Mine is GeForce GT 740M. Then look for the appropriate driver for your GPU at Nvidia website. Here are the archives for 64 bit and 32 bit system. After downloading the driver, place it somewhere in your home folder – we will be needing it later. Make it executable chmod +x ~/Downloads/NVIDIAxxxx.run.

Next, install the linux headers:

  • apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y
  • aptitude -r install linux-headers-$(uname -r) Where -r means install all recommended packages as well.

 

If you have installed nvidia-kernel-dkms earlier, remove it and all nvidia packages by apt-get remove nvidia* --purge.

Disable nouveau driver

Create a file /etc/modprobe.d/nvidia-installer-disable-nouveau.conf and paste the following lines:

 Stop X server

We need to stop the X server so we can run the Nvidia installer. Kali2.0 uses gdm by default. You can stop the X server by stopping gdm systemctl stop gdm. Another way is to hit Ctrl+Alt+Backspace. You can also try the methods suggestedhere in case previous methods don’t work.

If nothing works then just restart. As you have already disabled nouveau, your kernel won;t be able to load X server or the nouveau driver.

Backup your xorg.conf file (optional)

cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup

Chances are, there won’t be any file to backup.

Install Nvidia Driver

Now, cd into the directory where the installer is located. Then run the installer ./NVIDIAxxxx.run -a. Just accept whatever the installer asks. For 64 bit systems, you might encounter a question about 32bit libs, just ignore it.

After the installation completes, we need to disable the nouveau driver and configure the X server.

Configure X server

(From the Arch wiki )

Then, configure xorg.conf. You will need to know the PCI address of the NVIDIA card, which you can find by issuing lspci | grep -E "VGA|3D". The PCI address is the first 7 characters of the line that mentions NVIDIA. It will look something like01:00.0. In the xorg.conf, you will need to format it as #:#:#; e.g. 01:00.0 would be formatted as 1:0:0.

In my case, the bus id for my GPU was 04:00.0.

Now, you can take the backup of the conf file created while installing Nvidia driver but it is 100% useless and will not work.

Edit/create the file /etc/X11/xorg.conf and add the following lines after removing any other text that is there in that file.

Then create a file /usr/share/gdm/greeter/autostart/display_setup.desktop and paste the following lines:

Reboot and you should be good to go.

Sources