Filter löschen
Filter löschen

Create .ptx files from .cu files

22 Ansichten (letzte 30 Tage)
Alexandre
Alexandre am 28 Jul. 2014
Bearbeitet: Herve Hugonnet am 8 Mai 2020
Hi everyone,
I am completely knew to Cuda and wanted to practice with Matlab. Here is the code I wanted to run :
When downloaded the files, there were some .cu files. Therefore I read this :
It looks like .cu files have to be compiled to produce .ptx files that can then be run by Matlab. However, after hours and hours (and hours) of unsuccessful tries, I never made it. I installed Visual Studio 2012, then CUDA toolkit 6.0 and tried to run
nvcc -ptx "my file"
but I never passed the "cl.exe is not in PATH" error... And I tried many many things, like adding the path in ALL my environment variables...
So, it looks like it never manages to find cl.exe automatically, but I have found it (in different folder). Is there a way to manually add it when I type
nvcc -ptx "my file"
? Or maybe someone has a working step by step tutorial that works to compile the .cu files ?
Thanks for your help,
Alex
  1 Kommentar
Edric Ellis
Edric Ellis am 29 Jul. 2014
Have you tried launching a "Visual Studio Command Prompt" from the "Start" menu and then using NVCC from there?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Herve Hugonnet
Herve Hugonnet am 8 Mai 2020
Bearbeitet: Herve Hugonnet am 8 Mai 2020
I had the same issue and solved it by adding the path to the cl.exe filed in the comand line (change the path to match your visual studio installation) :
nvcc -ptx "test_kernel.cu" -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64"
Also make sure you installed cuda

Kategorien

Mehr zu GPU Computing finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by