Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: nVidia Optumus prevents using CUDA?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg122804] Re: nVidia Optumus prevents using CUDA?
  • From: DmitryG <einschlag at gmail.com>
  • Date: Fri, 11 Nov 2011 04:53:27 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <j8nuj1$ee5$1@smc.vnet.net> <j8r9hu$3jk$1@smc.vnet.net>

On Nov 10, 7:07 am, DmitryG <einsch... at gmail.com> wrote:
> On Nov 4, 6:00 am, "Oleksandr Rasputinov"
>
>
>
>
>
>
>
>
>
> <oleksandr_rasputi... at hmamail.com> wrote:
> > On Thu, 03 Nov 2011 08:48:48 -0000, DmitryG <einsch... at gmail.com> wrote:
> > > On Nov 2, 4:29 am, "Oleksandr Rasputinov"
> > > <oleksandr_rasputi... at hmamail.com> wrote:
> > >> On Tue, 01 Nov 2011 05:03:29 -0000, DmitryG <einsch... at gmail.com> wrote:
> > >> > Hi All,
>
> > >> > Being interested in GPU computations, I have bought a new powerful
> > >> > laptop Lenovo Y570 ($1080) that has, according to my test today, a
> > >> > 1.05 Mathematica 8.0.4 benchmark, under Windows 7 64 bit.
>
> > >> > The main reason to buy this laptop was that it has nVidia Geforce 555M
> > >> > graphic card that is one of the best in the consumer range and has 96
> > >> > CUDA cores.
>
> > >> > I have got the new Mathematica 8.0.4 activated today and the first
> > >> > thing was to try out CUDA. To my disappointment, it appears that
> > >> > Mathematica does not see the nVidia GPU at all, and all that it sees
> > >> > is the integrated Intel HD graphics. Thus CUDAInformation[] command
> > >> > outputs "CUDAInformation::invdevnm: "CUDA is not supported on device
> > >> \!
> > >> > \(\"Intel(R) HD Graphics Family\"\)."
>
> > >> > I know that there is nVidiaOptimusmanager that tries to redistribute
> > >> > the load between the integrated HD graphics and the nVidia GPU. Also
> > >> > there is a hardware switch in my laptop to activate or deactivate the
> > >> > GPU. Thus I have GPU activated per this switch and also in the "Manage
> > >> > 3D settings -> Global settings" of the nVidia control panel I have
> > >> > checked nVidia as the preferred graphic processor (other options are
> > >> > Automatic and integrated HD graphics). However, this did not bring
> > >> > anything to the way Mathematica works with CUDA.
>
> > >> > I do not know if the above is related to another disappointment. I
> > >> > have installed Microsoft Visual C++ 2010 express, as on my previous
> > >> > Win 7 64 bit laptop (that has a too old nVidia card, though) and it
> > >> > turned out that it does not work with Mathematica. Even the command
> > >> > CCompilers[Full] does not say that Microsoft Visual can be installed
> > >> > on my system, there are only Intel Compiler and a generic C compiler
> > >> > in the list. I don't know why there is such a difference with my
> > >> > previous laptop. I have checked Windows SDK and it is installed. What
> > >> > else?
>
> > >> > It seems that there is some relation between CUDa and C compiler,
> > >> > maybe a C compiler is a prerequisite for CUDA?
>
> > >> > It appears I have serious problems with Mathematica on my new laptop,
> > >> > and any advice will be appreciated.
>
> > >> > Dmitry
>
> > >> I won't comment on the CUDA issue as it's not something that I'm
> > >> familiar
> > >> with. However, I have had Visual C++ 2010 working with Mathematica
> > >> (8.0.1;
> > >> I haven't got 8.0.4 yet) without difficulty. The installation is
> > >> slightly
> > >> convoluted; here are my notes on the matter:
>
> > >> Minimal installation of Microsoft Visual C++ 10.0 (2010) SP1
>
> > >> Note that this installation does not include the Visual Studio IDE,
> > >> help,
> > >> tools, etc. Only the build system, compilers, headers, and libraries
> > >> will
> > >> be installed.
>
> > >> 1. Get the Microsoft Windows SDK 7.1 for Windows 7 and .NET Framework 4:
>
> > >>    http://www.microsoft.com/download/en/details.aspx?id=8442
>
> > >> 2. From the SDK, install at least the headers and libraries, but do not
> > >> install the compilers. The headers and libraries will be installed for
> > >> the
> > >> x86, x64, and IA64 platforms. To keep the installation self-contained,
> > >> and
> > >> for for consistency with Visual Studio, one may install to
> > >> %ProgramFiles(x86)%\Microsoft Visual Studio 10.0\SDK rather than the
> > >> default location.
>
> > >> 3. Get the Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for
> > >> the Windows SDK 7.1:
>
> > >>    http://www.microsoft.com/download/en/details.aspx?id=4422
>
> > >> 4. Install the Compiler Update. This will install x86, x64, and IA64
> > >> compilers.
>
> > >> 5. If support for the IA64 platform is not required, one can remove the
> > >> IA64 compiler via Add/Remove Programs (if present there) and then simply
> > >> delete all of the directories installed by either the SDK or the
> > >> Compiler
> > >> Update that contain IA64-specific files. (Note that the Compiler Update
> > >> will install the x86-hosted IA64 cross-compiler along with the x86
> > >> compiler even if the IA64 compiler itself is not installed.) The
> > >> directories to delete can easily be identified since they all have
> > >> "IA64"
> > >> as part of the name. This saves about 200MB of space. Note that apart
> > >> from
> > >> the main installation directory, some (small) files are also installed
> > >> into %ProgramFiles(x86)%\MSBuild, including some for IA64 in
> > >> MSBuild\Microsoft.Cpp\v4.0\Platforms\IA64.
>
> > >> 5. After installing, it is recommended to run Microsoft Update in case
> > >> any
> > >> patches are required.
>
> > >> As you see, this does not involve Visual Studio Express, which I
> > >> deliberately avoided since it does not include the 64-bit compilers
> > >> necessary for operation with Mathematica. Personally, I use MinGW-w64
> > >> GCC
> > >> 4.6.1 rather than Visual C++; this works perfectly well also but does
> > >> require modifications to Mathematica which I will not discuss here other
> > >> than to say that it would be nice if this compiler could be supported
> > >> without need of modifications in a future release.
>
> > > It is unfortunately Mathematica 8.0.4 that does not accept any
> > > compilers except of the Intel C Compiler, according to
> > > CCompilers[Full]. Checked on Windows 7 and Mac Snow Leopard.
>
> > > Dmitry
>
> > Don't be too discouraged by CCompilers[Full]. On 8.0.1 I get:
>
> > In[2]:= CCompilers[Full]
>
> > Out[2]= {{"Name" -> "MinGW",
> >    "Compiler" -> CCompilerDriver`MinGWCompiler`MinGWCompiler,
> >    "CompilerInstallation" ->
> >     "C:\\MinGW-w64\\bin\\x86_64-w64-mingw32-gcc.exe",
> >    "CompilerName" -> Automatic}, {"Name" -> "Intel Compiler",
> >    "Compiler" -> CCompilerDriver`IntelCompiler`IntelCompiler,
> >    "CompilerInstallation" -> None,
> >    "CompilerName" -> Automatic}, {"Name" -> "Generic C Compiler",
> >    "Compiler" -> CCompilerDriver`GenericCCompiler`GenericCCompiler,
> >    "CompilerInstallation" -> None, "CompilerName" -> Automatic}}
>
> > (where MinGW reflects my own modifications to work with MinGW-w64; this is
> > not standard). As you can see, Visual C++ is missing. But, when I
> > installed Visual C++ per the directions above, it did show up in
> > CCompilers[] and it did work correctly. Not sure why CCompilers[Full]
> > omits it (but you can look at the package source code to find out if
> > you're curious).
>
> > O. R.
>
> Hi Oleksandr,
>
> I had a number of Microsoft Visual Redistributable files installed on
> my computer. Following you above post, I have uninstalled them,
> including Microsoft Visual C++ Express. And installed the update to
> SDK 7.1 that I already had. Indeed, there are C compilers in this
> update and they are now listed among my installed programs. On the HD
> now I have
>
> C:\Program Files (x86)\Microsoft Visual Studio 10.0     (contains
> cl.exe in "Bin" - this must be the C++ compiler)
> C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1     (only
> readme_windows_sdk_v71_update.htm inside)
> C:\Program Files (x86)\Microsoft.NET
> C:\Program Files\Microsoft SDKs\Windows\v7.1
>
> Mathematica 8.0.4 still does not list Microsoft Visual in CCompilers[]
> and CCompilers[Full]. I have filed a support ticket today, let's see
> what will be the answer.
>
> How can I test independently of Mathematica that the installed C
> compilers work on my computer?  I see there is no information about
> the installed compiler and the SDK in the Windows Path statement.
>
> Another thing: Mathematica 8.0.4 on my Mac Pro now recognizes GCC
> compiler. Thus there is a problem only on my new laptop.
>
> Best,
>
> Dmitry

Update: Following Oleksandr's suggestion, I have uninstalled Microsoft
Visual C++ 2010 Express and installed C compilers via the SDK 7.1
update. After that I have Microsoft Visual C++ 2010 on my laptop.

After the installation the system was rebooted but Mathematica still
did not recognized the C compiler.

Yesterday evening I was testing the installed C compiler and I was
able to run "Hello World", although the way how it worked was
confusing to me.

Today I have rebooted the system again and, Oh, miracle, Mathematica
does see the installed C compiler:

In[2]:= CCompilers[]

Out[2]= {{"Name" -> "Visual Studio",  "Compiler" ->
CCompilerDriver`VisualStudioCompiler`VisualStudioCompiler,
  "CompilerInstallation" -> "c:\\Program Files (x86)\\Microsoft Visual
Studio 10.0", "CompilerName" -> Automatic}}

and

In[3]:= CCompilers[Full]

Out[3]= {{"Name" -> "Visual Studio",
  "Compiler" ->
   CCompilerDriver`VisualStudioCompiler`VisualStudioCompiler,
  "CompilerInstallation" ->
   "c:\\Program Files (x86)\\Microsoft Visual Studio 10.0",
  "CompilerName" -> Automatic}, {"Name" -> "Intel Compiler",
  "Compiler" -> CCompilerDriver`IntelCompiler`IntelCompiler,
  "CompilerInstallation" -> None,
  "CompilerName" -> Automatic}, {"Name" -> "Generic C Compiler",
  "Compiler" -> CCompilerDriver`GenericCCompiler`GenericCCompiler,
  "CompilerInstallation" -> None, "CompilerName" -> Automatic}}

Thank you, Oleksandr!  A couple of questions now: 1) Is there a way to
check that my compiler creates 64 bit executables?  If they are indeed
64 bit, why do you need MinGW64 compiler? Is it faster than Visual
Studio? Does it make sense for me to install other C compilers under
Windows, if the only use will be compiling into C from Mathematica? (I
am going to run and modify C programs given to me by my colleagues but
this will be done under Linux or Mac)

Also I am sorry that the discussion went off-topic and there is no
positive feedback regarding CUDA. This was my big hope but now I am
disappointed. CUDA functions are slower than regular CPU functions and
there is a 2 sec time limit on GPU calculations that is ridiculous and
that I cannot eliminate, although I tried to do it via the Windows
registry keys.

Best,

Dmitry



  • Prev by Date: Re: Converting a list of strings to a single space-delimited string
  • Next by Date: Re: Converting a list of strings to a single space-delimited string
  • Previous by thread: Re: nVidia Optumus prevents using CUDA?
  • Next by thread: Re: nVidia Optumus prevents using CUDA?