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: [mg122850] Re: nVidia Optumus prevents using CUDA?
  • From: "Oleksandr Rasputinov" <oleksandr_rasputinov at hmamail.com>
  • Date: Sat, 12 Nov 2011 07:35:07 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <j8nuj1$ee5$1@smc.vnet.net> <j8r9hu$3jk$1@smc.vnet.net>

On Fri, 11 Nov 2011 09:55:26 -0000, DmitryG <einschlag at gmail.com> wrote:

> On Nov 10, 7:07 am, DmitryG <einsch... at gmail.com> wrote:
>
>>
>> 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
>

I'm glad to hear that you have Visual C++ 2010 working correctly.  
Unfortunately, although it worked for me straight away with Mathematica  
8.0.1, now that I've updated to 8.0.4 I no longer have it installed and so  
could not test this immediately (I only installed it to see how it would  
be done and whether there would be any advantages to it given that I  
already had MinGW-w64 working).

If you're running a 64-bit version of Mathematica ($SystemID ===  
"Windows-x86-64") and Compile[..., CompilationTarget -> "C"] works  
correctly, then the compiler is producing 64-bit executables, since on  
Windows it's not possible to link 32- and 64-bit code in the same process.

As mentioned in my reply to Oliver Ruebenkoenig, the main reason for using  
MinGW-w64 is to be more easily able to link Fortran code into Mathematica.  
However, GCC C still has some advantages over Visual C++, such as support  
for C99/C++0x, as well as the fact that many open source packages are  
intended to be compiled with GCC rather than Visual Studio and may not  
build correctly with the latter unless modifications are made. The GCC  
back-end also has support for all currently available x86 instruction set  
extensions and can produce code optimized for a very wide variety of  
processors, including by using auto-vectorization (which Visual C++  
doesn't support). It's up to you if you want to try other compilers or  
not, but it seems to me that since 32-bit versions of Mathematica already  
support Cygwin and MinGW, proper support for MinGW-w64 is not an  
unreasonable expectation given that the modifications to the existing  
MinGW support needed to achieve this are very minimal.

In regard to the 2-second GPU timeout--you may not be aware that the  
relevant registry keys changed as of Vista SP1. The keys now used to  
control the graphics driver recovery settings are listed at the following  
address:

http://msdn.microsoft.com/en-us/library/ff569918.aspx

Best,

O. R.



  • Prev by Date: Re: Manipulate variables not getting evaluated
  • Next by Date: 2D Plot for a face of a 3D plot box?
  • Previous by thread: Re: nVidia Optumus prevents using CUDA?
  • Next by thread: Re: Footnotes, Endnotes in Mathematica