0

I am now learning to use tensorflow and keras with my laptop (Lenono T440s).

Because my laptop is having a nvidia 730m display card, I want to use my GPU to do the deep learning.

Unfortunately, I faced to lots of problem when I tried to install the nvidia driver and cuda.

To begin with, it will be better to provide much more how I install my ubuntu. I am using a dual os (windows and ubuntu). As Windows 10 is originally installed in my laptop, I therefore disable Secure Boot. After it, I installed ubuntu on it.

Then, I run:

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update

Then I install nvidia driver 375 (or other vision) in additional driver page. Unlucky, in nvidia configure, it shows nothing after I reboot it. But, it does have a tick the box of driver 375 in additional driver page.

It seems that nvidia cannot be detected in my system.

Secondly, I tried to install cuda 8.0. But it is failed to install cuda to install cuda toolkit.
I can only find that a directory, /usr/local/cuda8.0/, is created. But no /usr/local/cuda/.

I have tried lots of ways to install the driver and cuda. But it keeps fails.

I have really no ideas how to install it. I sincerely hope that there will be someone can help me.

Here is some information of my laptop:

Lenovo thinkpad t440s cpu i-7 4006U 8 GM RAM nvidia geforce 730m

0

How to know if my laptop is TensorFlow-with-GPU eligible?

Your laptop must have a NVIDIA CUDA compatible graphic card. GeForce GT 730M is OK.

You could visit NVIDIA website if you want to check by yourself.

NVIDIA proprietary drivers installation

Modern laptop with NVIDIA graphic cards are often provided with Optimus Technology. What is Optimus Technology? It means that your laptop has actually 2 graphic chips: The first one is located on the mother board, close to the CPU. We will call it “Intel chip”. The second one is on your NVIDIA card. By default, on Ubuntu 16.04, the NVIDIA card is not used. You have to install specific driver to use it.

We could choose between two types of drivers: free drivers and proprietary drivers. I did not manage to work with free drivers, so we will use proprietary drivers.

To install them, it is quite simple:

  • Go to your System Setting
  • Go to Software & Updates
  • Click on the tab Additional Drivers
  • Wait a little bit

On my laptop, I have that: nvidia driver

We could see that the NVIDIA binary driver is not used. To fix it:

  • Click on Using NVIDIA binary driver, and on Apply Changes, then enter your password.
  • Wait a little bit
  • Click on Restart…

You could now use your NVIDIA video card.

One important thing: On Windows, the Optimus System switches automatically from the Intel graphic chip to the NVIDIA graphic chip when needed. The Intel graphic chip offers low performances, but also low consumption. The NVIDIA one offers high performances but also high consumption.

On Ubuntu, you have to switch from one chip to the other by yourself, using a the tool called PRIME.

In order to do that:

  • Open the software NVIDIA XServer Settings
  • Go to PRIME Profile
  • Choose NVIDIA (Performance Mode) or Intel (Power Saving Mode)
  • Enter your password then log out and log in. (Note you don’t need to reboot!)

Note: There is a system, called Bumblebee, which support properly NVIDIA Optimus technology by switching automatically between the Intel and the NVIDIA chip without manual configuration, as on Windows. We won’t talk about it in this answer.

Now, let’s check that we could use our NVIDIA GPU.

NVIDIA GPU test

To be sure that we are using the NVIDIA GPU, we will use the tool glxgear.

In a terminal, enter:

$ glxgear

You should see rotating gears.

  • Open the software NVIDIA XServer Settings
  • Click on the line GPU , – , where and depends on your system (On mine, it is GPU 0 – (GeForce 940MX)).
  • Check the line GPU Utilization. It should be close to 100%. If you close glxgear, the GPU Utilization should significantly decrease.

cuDNN installation

Go to NVIDIA cuDNN website, and click on the Download button. You may need to register (it’s free).

Download the last cuDNN Library for Linux, and extract the downloaded archive.

Copy the content of the include directory in /usr/local/cuda/include. Copy the content of the lib64 directory in /usr/local/cuda/lib64.

And add at the end of your .bashrc file (in your Home folder) the following lines:

export LIBRARY_PATH=/usr/local/cuda/lib64:$LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
  • For further information: A complete answer of How to do GPU deep learning using Theano with a laptop on Ubuntu 16.04? is available here:manunalepa.wordpress.com/2017/06/07/…. Theano is an other framework to do deep learning. It is in some points quite similar to Tensor Flow. So, if you had still some issues in using your GPU with Tensor flow, maybe it will help you to try first with Theano with this tutorial. – Manu NALEPA Jun 19 '17 at 11:58

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.