Nvidia GT 540M is bit old now it was released back in 2012 when I purchased my XPS-L502X this awesome Graphics card was armed with it, Its still very solid to use with it’s 96 CUDA cores, specifications given here.. GT 540M

It was very painfull for me to run a CUDA program on it as its having Fermi Architechture and Compute capability of 2.1. most of the online tutorials says that you need Kepler architecture and more to run CUDA, but I have tried a lot to run them on my GT 540M, It was so painfull to adjust settings and run program on it that i almost screwed my laptop may times and spent plenty of nights fixing it back again, formatted and installed fresh installation 3 times as my trying & screwing went beyond limit.

finally I got the desired settings to do for GT 540M and i can smoothly run program on my XPS :).

here are very few things you have to do (i mean i did, not necessarily will work for you), but yes if you have GT 540M it will work for you as well.

Few things to consider..

  • It works if any only if your GPU is CUDA enabled.
  • There are many versions of CUDA tool kit available, you have to find which works for your Graphics card.
  • Nvidia released many versions of drivers as well, you have to find out which works for you.

Basic thing how CUDA works … (Hardware <- OS <- Driver <- CUDA toolkit <- Your Program) and all this fine tuning is must and in equlibrium.

To run CUDA program on your XPS L502X with Nvidia GT 540M i’m using

  • OS : Linux Mint Rosa - 3.19.0-32-generic #37~14.04.1-Ubuntu SMP Thu Oct 22 09:41:40 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
  • CUDA toolkit - 5.5
  • Nvidia Driver - 340.96

If everything is properly installed and you dont see any problem viewing your screen you most prbably can run cuda programs compiled with nvcc on same machine.

amey@xps ~/work/cuda $ sudo apt-get install nvidia-cuda-toolkit
[sudo] password for amey: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libcublas5.5 libcudart5.5 libcufft5.5 libcufftw5.5 libcuinj64-5.5
  libcurand5.5 libcusparse5.5 libnppc5.5 libnppi5.5 libnpps5.5 libnvtoolsext1
  libnvvm2 libthrust-dev nvidia-340-uvm nvidia-cuda-dev nvidia-libopencl1-331
  nvidia-libopencl1-340 nvidia-opencl-dev nvidia-profiler opencl-headers
Suggested packages:
  libcupti-dev
Recommended packages:
  libgl1-mesa-dev libgl-dev libvdpau-dev nvidia-cuda-doc nvidia-cuda-gdb
  nvidia-visual-profiler
The following packages will be REMOVED:
  ocl-icd-libopencl1
The following NEW packages will be installed:
  libcublas5.5 libcudart5.5 libcufft5.5 libcufftw5.5 libcuinj64-5.5
  libcurand5.5 libcusparse5.5 libnppc5.5 libnppi5.5 libnpps5.5 libnvtoolsext1
  libnvvm2 libthrust-dev nvidia-340-uvm nvidia-cuda-dev nvidia-cuda-toolkit
  nvidia-libopencl1-331 nvidia-libopencl1-340 nvidia-opencl-dev
  nvidia-profiler opencl-headers
0 upgraded, 21 newly installed, 1 to remove and 301 not upgraded.
Need to get 104 MB/105 MB of archives.
After this operation, 552 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://archive.ubuntu.com/ubuntu/ trusty-updates/restricted nvidia-340-uvm amd64 340.96-0ubuntu0.14.04.1 [4,756 B]
Get:2 http://archive.ubuntu.com/ubuntu/ trusty-updates/restricted nvidia-libopencl1-340 amd64 340.96-0ubuntu0.14.04.1 [16.5 kB]
Get:3 http://archive.ubuntu.com/ubuntu/ trusty/multiverse libcublas5.5 amd64 5.5.22-3ubuntu1 [10.1 MB]
Get:4 http://archive.ubuntu.com/ubuntu/ trusty/multiverse libcudart5.5 amd64 5.5.22-3ubuntu1 [94.5 kB]
Get:5 http://archive.ubuntu.com/ubuntu/ trusty/multiverse libcufft5.5 amd64 5.5.22-3ubuntu1 [13.8 MB]
Get:6 http://archive.ubuntu.com/ubuntu/ trusty/multiverse libcufftw5.5 amd64 5.5.22-3ubuntu1 [110 kB]
Get:7 http://archive.ubuntu.com/ubuntu/ trusty/multiverse libcuinj64-5.5 amd64 5.5.22-3ubuntu1 [674 kB]
Get:8 http://archive.ubuntu.com/ubuntu/ trusty/multiverse libcurand5.5 amd64 5.5.22-3ubuntu1 [18.2 MB]
Get:9 http://archive.ubuntu.com/ubuntu/ trusty/multiverse libcusparse5.5 amd64 5.5.22-3ubuntu1 [15.3 MB]
Get:10 http://archive.ubuntu.com/ubuntu/ trusty/multiverse libnppc5.5 amd64 5.5.22-3ubuntu1 [104 kB]
Get:11 http://archive.ubuntu.com/ubuntu/ trusty/multiverse libnppi5.5 amd64 5.5.22-3ubuntu1 [16.8 MB]
Get:12 http://archive.ubuntu.com/ubuntu/ trusty/multiverse libnpps5.5 amd64 5.5.22-3ubuntu1 [1,967 kB]
Get:13 http://archive.ubuntu.com/ubuntu/ trusty/multiverse libnvtoolsext1 amd64 5.5.22-3ubuntu1 [33.2 kB]
Get:14 http://archive.ubuntu.com/ubuntu/ trusty/multiverse libnvvm2 amd64 5.5.22-3ubuntu1 [4,010 kB]
Get:15 http://archive.ubuntu.com/ubuntu/ trusty-updates/restricted nvidia-libopencl1-331 amd64 340.96-0ubuntu0.14.04.1 [5,968 B]
Get:16 http://archive.ubuntu.com/ubuntu/ trusty/multiverse libthrust-dev all 1.7.0-1 [410 kB]
Get:17 http://archive.ubuntu.com/ubuntu/ trusty/multiverse nvidia-cuda-dev amd64 5.5.22-3ubuntu1 [6,556 kB]
Get:18 http://archive.ubuntu.com/ubuntu/ trusty/universe opencl-headers all 1.2-2013.10.23-1 [61.2 kB]
Get:19 http://archive.ubuntu.com/ubuntu/ trusty/multiverse nvidia-opencl-dev amd64 5.5.22-3ubuntu1 [20.7 kB]
Get:20 http://archive.ubuntu.com/ubuntu/ trusty/multiverse nvidia-cuda-toolkit amd64 5.5.22-3ubuntu1 [16.1 MB]
Fetched 104 MB in 6min 9s (283 kB/s)                                           
Selecting previously unselected package nvidia-340-uvm.
(Reading database ... 243830 files and directories currently installed.)
Preparing to unpack .../nvidia-340-uvm_340.96-0ubuntu0.14.04.1_amd64.deb ...
Unpacking nvidia-340-uvm (340.96-0ubuntu0.14.04.1) ...
dpkg: ocl-icd-libopencl1:amd64: dependency problems, but removing anyway as you requested:
 nvidia-opencl-icd-340 depends on nvidia-libopencl1-340 | ocl-icd-libopencl1; however:
  Package nvidia-libopencl1-340 is not installed.
  Package ocl-icd-libopencl1:amd64 is to be removed.

(Reading database ... 243832 files and directories currently installed.)
Removing ocl-icd-libopencl1:amd64 (2.1.3-4) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for doc-base (0.10.5) ...
Processing 1 removed doc-base file...
Registering documents with scrollkeeper...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
Selecting previously unselected package nvidia-libopencl1-340.
(Reading database ... 243819 files and directories currently installed.)
Preparing to unpack .../nvidia-libopencl1-340_340.96-0ubuntu0.14.04.1_amd64.deb ...
Unpacking nvidia-libopencl1-340 (340.96-0ubuntu0.14.04.1) ...
Selecting previously unselected package libcublas5.5:amd64.
Preparing to unpack .../libcublas5.5_5.5.22-3ubuntu1_amd64.deb ...
Unpacking libcublas5.5:amd64 (5.5.22-3ubuntu1) ...
Selecting previously unselected package libcudart5.5:amd64.
Preparing to unpack .../libcudart5.5_5.5.22-3ubuntu1_amd64.deb ...
Unpacking libcudart5.5:amd64 (5.5.22-3ubuntu1) ...
Selecting previously unselected package libcufft5.5:amd64.
Preparing to unpack .../libcufft5.5_5.5.22-3ubuntu1_amd64.deb ...
Unpacking libcufft5.5:amd64 (5.5.22-3ubuntu1) ...
Selecting previously unselected package libcufftw5.5:amd64.
Preparing to unpack .../libcufftw5.5_5.5.22-3ubuntu1_amd64.deb ...
Unpacking libcufftw5.5:amd64 (5.5.22-3ubuntu1) ...
Selecting previously unselected package libcuinj64-5.5:amd64.
Preparing to unpack .../libcuinj64-5.5_5.5.22-3ubuntu1_amd64.deb ...
Unpacking libcuinj64-5.5:amd64 (5.5.22-3ubuntu1) ...
Selecting previously unselected package libcurand5.5:amd64.
Preparing to unpack .../libcurand5.5_5.5.22-3ubuntu1_amd64.deb ...
Unpacking libcurand5.5:amd64 (5.5.22-3ubuntu1) ...
Selecting previously unselected package libcusparse5.5:amd64.
Preparing to unpack .../libcusparse5.5_5.5.22-3ubuntu1_amd64.deb ...
Unpacking libcusparse5.5:amd64 (5.5.22-3ubuntu1) ...
Selecting previously unselected package libnppc5.5:amd64.
Preparing to unpack .../libnppc5.5_5.5.22-3ubuntu1_amd64.deb ...
Unpacking libnppc5.5:amd64 (5.5.22-3ubuntu1) ...
Selecting previously unselected package libnppi5.5:amd64.
Preparing to unpack .../libnppi5.5_5.5.22-3ubuntu1_amd64.deb ...
Unpacking libnppi5.5:amd64 (5.5.22-3ubuntu1) ...
Selecting previously unselected package libnpps5.5:amd64.
Preparing to unpack .../libnpps5.5_5.5.22-3ubuntu1_amd64.deb ...
Unpacking libnpps5.5:amd64 (5.5.22-3ubuntu1) ...
Selecting previously unselected package libnvtoolsext1:amd64.
Preparing to unpack .../libnvtoolsext1_5.5.22-3ubuntu1_amd64.deb ...
Unpacking libnvtoolsext1:amd64 (5.5.22-3ubuntu1) ...
Selecting previously unselected package libnvvm2:amd64.
Preparing to unpack .../libnvvm2_5.5.22-3ubuntu1_amd64.deb ...
Unpacking libnvvm2:amd64 (5.5.22-3ubuntu1) ...
Selecting previously unselected package nvidia-libopencl1-331.
Preparing to unpack .../nvidia-libopencl1-331_340.96-0ubuntu0.14.04.1_amd64.deb ...
Unpacking nvidia-libopencl1-331 (340.96-0ubuntu0.14.04.1) ...
Selecting previously unselected package libthrust-dev.
Preparing to unpack .../libthrust-dev_1.7.0-1_all.deb ...
Unpacking libthrust-dev (1.7.0-1) ...
Selecting previously unselected package nvidia-cuda-dev.
Preparing to unpack .../nvidia-cuda-dev_5.5.22-3ubuntu1_amd64.deb ...
Unpacking nvidia-cuda-dev (5.5.22-3ubuntu1) ...
Selecting previously unselected package nvidia-profiler.
Preparing to unpack .../nvidia-profiler_5.5.22-3ubuntu1_amd64.deb ...
Unpacking nvidia-profiler (5.5.22-3ubuntu1) ...
Selecting previously unselected package opencl-headers.
Preparing to unpack .../opencl-headers_1.2-2013.10.23-1_all.deb ...
Unpacking opencl-headers (1.2-2013.10.23-1) ...
Selecting previously unselected package nvidia-opencl-dev:amd64.
Preparing to unpack .../nvidia-opencl-dev_5.5.22-3ubuntu1_amd64.deb ...
Unpacking nvidia-opencl-dev:amd64 (5.5.22-3ubuntu1) ...
Selecting previously unselected package nvidia-cuda-toolkit.
Preparing to unpack .../nvidia-cuda-toolkit_5.5.22-3ubuntu1_amd64.deb ...
Unpacking nvidia-cuda-toolkit (5.5.22-3ubuntu1) ...
Setting up nvidia-340-uvm (340.96-0ubuntu0.14.04.1) ...
Setting up nvidia-libopencl1-340 (340.96-0ubuntu0.14.04.1) ...
Setting up libcublas5.5:amd64 (5.5.22-3ubuntu1) ...
Setting up libcudart5.5:amd64 (5.5.22-3ubuntu1) ...
Setting up libcufft5.5:amd64 (5.5.22-3ubuntu1) ...
Setting up libcufftw5.5:amd64 (5.5.22-3ubuntu1) ...
Setting up libcuinj64-5.5:amd64 (5.5.22-3ubuntu1) ...
Setting up libcurand5.5:amd64 (5.5.22-3ubuntu1) ...
Setting up libcusparse5.5:amd64 (5.5.22-3ubuntu1) ...
Setting up libnppc5.5:amd64 (5.5.22-3ubuntu1) ...
Setting up libnppi5.5:amd64 (5.5.22-3ubuntu1) ...
Setting up libnpps5.5:amd64 (5.5.22-3ubuntu1) ...
Setting up libnvtoolsext1:amd64 (5.5.22-3ubuntu1) ...
Setting up libnvvm2:amd64 (5.5.22-3ubuntu1) ...
Setting up nvidia-libopencl1-331 (340.96-0ubuntu0.14.04.1) ...
Setting up libthrust-dev (1.7.0-1) ...
Setting up nvidia-cuda-dev (5.5.22-3ubuntu1) ...
Setting up nvidia-profiler (5.5.22-3ubuntu1) ...
Setting up opencl-headers (1.2-2013.10.23-1) ...
Setting up nvidia-opencl-dev:amd64 (5.5.22-3ubuntu1) ...
Setting up nvidia-cuda-toolkit (5.5.22-3ubuntu1) ...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...



Happy Coding …

Comments