Giter VIP home page Giter VIP logo

hybridizer-basic-samples's Introduction

Hybridizer Essentials is a compiler targeting CUDA-enabled GPUS from .Net. Using parallelization patterns, such as Parallel.For, or ditributing parallel work by hand, the user can benefit from the compute power of GPUS without entering the learning curve of CUDA, all within Visual Studio.

hybridizer-basic-samples

This repo illustrates a few samples for Hybridizer

These samples may be used with Hybridizer Essentials. However, C# code can run with any version of Hybridizer. They illustrate features of the solution and are a good starting point for experimenting and developing software based on Hybridizer.

WARNING

We dropped support for

  • CUDA < 10.0
  • Visual Studio < 15

Requirements

Before you start, you first need to check if you have the right environment. You need an install of Visual Studio (2015 or later). You need a CUDA-enabled GPU and CUDA (10.0 or later) installed (with the CUDA driver). Obviously, you need to install Hybridizer Essentials.

Run

Checkout repository, and open Visual Studio. Require and validate license from Hybridizer->License Settings Tool window. Open HybridizerBasicSamples solution. Choose CUDA version in "solution items" > Directory.Build.Props & App.config (11.6 by default) Build solution and run example of your choice. After an update, you might need to reload the solution.

Documentation

Samples are explained in the wiki.

You can find API documentation in our DocFX generated documentation

Notes

After building the csproj, you have to build the generated vcxproj manually or put it in your build dependencies using the configuration manager. After installing an update, you may need to unload/reload the solution, or even close and restart visual studio.

hybridizer-basic-samples's People

Contributors

axelanglet avatar fduguet avatar jewave avatar regisp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hybridizer-basic-samples's Issues

Cufft in Hybridizer

using Hybridizer.Runtime.CUDAImports;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;

using Complex = Hybridizer.Runtime.CUDAImports.double2;

namespace Test_2_25
{
class Program
{

    [EntryPoint("mulitiply")]
    public static void mulitiply(Complex[] a, double[] b, int n)
    {
        int numThreads = blockDim.x * gridDim.x;
        int threadID = blockIdx.x * blockDim.x + threadIdx.x;

        for (int i = threadID; i < n; i += numThreads)
        {
            a[i].x *= b[i];
            a[i].y *= b[i];
        }
    }


    static void Main(string[] args)
    {
        int Length = 8;
        Complex[] h_signal = new Complex[Length];
        double[] b = new double[Length];
        for (int i = 0; i < Length; i++)
        {
            h_signal[i].x = 1;
            h_signal[i].y = 0.0d;
            b[i] = 1.05;
        }

        int mem_size = Length *2*sizeof(double);
        GCHandle signalHandle = GCHandle.Alloc(h_signal, GCHandleType.Pinned);

        IntPtr d_signal;
        cuda.ERROR_CHECK(cuda.Malloc(out d_signal, mem_size));

        cuda.ERROR_CHECK(cuda.Memcpy(d_signal, signalHandle.AddrOfPinnedObject(), mem_size, cudaMemcpyKind.cudaMemcpyHostToDevice));

        cufftHandle plan;
        cufft_ERROR_CHECK(cufft.Plan1d(out plan, Length, cufftType.CUFFT_C2C, 1));

        cufft_ERROR_CHECK(cufft.ExecC2C(plan, d_signal, d_signal, -1));

        dynamic wrapped = HybRunner.Cuda().SetDistrib(32, 256).Wrap(new Program());
        wrapped.mulitiply(d_signal, b, Length);

        cuda.ERROR_CHECK(cuda.Memcpy(signalHandle.AddrOfPinnedObject(), d_signal, mem_size, cudaMemcpyKind.cudaMemcpyDeviceToHost));

        cufft_ERROR_CHECK(cufft.Destroy(plan));
        signalHandle.Free();
        cuda.ERROR_CHECK(cuda.Free(d_signal));

        for (int i = 0; i < Length; i++)
        {
            Console.Write("{0}", h_signal[i].x);
        }

        for (int i = 0; i < Length; i++)
        {
            Console.Write("{0}", h_signal[i].y);
        }

        Console.Out.WriteLine(" OK");
    }

    static void cufft_ERROR_CHECK(cufftResult result)
    {
        if (result != cufftResult.CUFFT_SUCCESS)
        {
            Console.Error.WriteLine(Enum.GetName(typeof(cufftResult), result));
            Environment.Exit(6); 
        }
    }

}

}

CUDA 9.1 Not Supported

CUDA 9.1 is currently not supported by Hybridizer.
When running on VS2017, which does not support CUDA 8.0, currently CUDA 9.0 toolkit needs to be installed. With only 9.1 installed, the 'Hybridize Project' Generate action will throw a Nullref exception (since no supported cuda version is available).

Installation/License Issue

Please make sure items below are checked before creating a new issue:

  • [✔] You run Visual Studio 2012, 2013, 2015 or 2017 with a valid license
  • [✔] You installed C++ support in Visual Studio
  • [❌] You queried and validated a license for Hybridizer Essentials and your license is still valid (Tools->Hybridizer Configuration)
  • [✔] You have CUDA 8 or 9.x installed and Visual Studio Integration enabled
  • [✔] If you run cuda 9.x with visual 2017, you have installed v140 toolset and compile native project with this toolset.

Hello
I am having a problem installing Hybridizer

Running Windows 10 Pro 64-Bit Build 17134
Intel Core i5 3750K @ 4.2GHz
16GB RAM @ 1600MHz
Nvidia GeForce 1080 GTX
Nvidia GeForce 670 GTX

Images:
cuda
installer error
licerror
vs17tools

LOG:
VSIXInstaller_104b67ff-ebdc-474a-8191-9b8bfc502ed9.log

In the log, it says The current OS Version '10.0.17134.0' is not in the supported version range '[6.2,6.3)'.

Edit: 6.2 -> 6.3 seems to be Windows 8 Builds not Windows 10!
Do I need to downgrade my OS Version for real?!

EDIT2: I updated Visual Studio 2017 to match my Windows build. It updated to Windows 10 SDK 17134
and the same error.
LOG:
VSIXInstaller_a74eb5bf-ee74-48a2-a2a2-d78e428c7fa9.log

Thanks

CUFFT

Hello,will the hybridizer can support the "double" type in cufftType -"ExecR2c " in the future? sometimes the float type can not fit well.
Thanks.

Can't get any license

I got trial a license key and it does not validate. It just sits on "Loading" and does nothing.
Tried multiple times.
Is the licensing working?

A problem in hybridizng project

After I try to hybridize my project I try to run it but it shows an error saying:
'Dll load error when loading ConsoleApp2_CUDA.vs2015.dll: 126'.
I then try to click on the cpp file and it says the file has been deleted or removed (even when i try after hybridizing).
screenshot_2

Could it be a problem in the hybridizing of the project?

im using VS 2017 community with CUDA 9.2.

Installation issue

Hello,
I've got an error when installing new version 9833, it show as below
Error 1001
image

It causes the CudaImports library is not available for use. Then, project can not be compiled.
I'm using latest visual studio 2017 with update 8 and cuda 10.0.
Could you check and tell me how to fix it.

Altimesh Hybridizer C# Usage

_20190225164705

Hello,I want to use cuda in my former application writen by C#. I found that "Aitimesh Hybridizer C# Usage" is a .cs which provide a method to use hybridizer in .net.
I want to ask that if there be a sample to show how to use "Aitimesh Hybridizer C# Usage"in a normal C# programme without build a "Aitimesh Hybridizer sample project".

Thanks!

Compiling Hybridizer project results in various errors

Here are the results from VS 2017 Output, and a screenshot of the errors:

1>------ Rebuild All started: Project: HelloWorld.vs2017, Configuration: Debug x64 ------
1> HelloWorld.vs2017 -> C:\xxxx\GitHub\hybridizer-basic-samples\HybridizerBasicSamples_CUDA91\1.Simple\HelloWorld\HelloWorld\bin\x64\Debug\HelloWorld.exe
2>------ Rebuild All started: Project: HelloWorld_CUDA.vs2017, Configuration: Debug x64 ------
2>
2>C:\xxxx\GitHub\hybridizer-basic-samples\HybridizerBasicSamples_CUDA91\1.Simple\HelloWorld\HelloWorld_CUDA>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\bin\nvcc.exe" -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64" -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -g -DWIN32 -DWIN64 -D_DEBUG -D_CONSOLE -D_WINDLL -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /FS /Zi /RTC1 /MDd " -o x64\Debug\hybridizer.wrappers.cu.obj "C:\xxxx\GitHub\hybridizer-basic-samples\HybridizerBasicSamples_CUDA91\1.Simple\HelloWorld\HelloWorld_CUDA\hybridizer-generated-sources\hybridizer.wrappers.cu" -clean
2>hybridizer.wrappers.cu
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(368,5): warning MSB8004: Output Directory does not end with a trailing slash. This build instance will add the slash as it is required to allow proper evaluation of the Output Directory.
2>HYBRIDIZER -- Build status file missing, generating
2>Build satellite full path: C:\Users\xxxx.xxxx\AppData\Local\Microsoft\VisualStudio\15.0_775c7353\Extensions\rcr1wcx4.bjz\bin\Hybridizer.VSIntegration.BuildSatellite.exe
2>Hybridizer binary full path: C:\Users\xxxx.xxxx\AppData\Local\Microsoft\VisualStudio\15.0_775c7353\Extensions\rcr1wcx4.bjz\bin\Hybridizer.exe
2>Satellite working directory: C:\xxxx\GitHub\hybridizer-basic-samples\HybridizerBasicSamples_CUDA91\1.Simple\HelloWorld\HelloWorld_CUDA\hybridizer-generated-sources
2>Builtins: C:\Users\xxxx.xxxx\AppData\Local\Microsoft\VisualStudio\15.0_775c7353\Extensions\rcr1wcx4.bjz\include\hybridizer.cuda.builtins
2>Hybridizer out: [INFO] : entering BuildSatellite program
2>Hybridizer out: [INFO] : Loaded assembly from C:\xxxx\GitHub\hybridizer-basic-samples\HybridizerBasicSamples_CUDA91\1.Simple\HelloWorld\HelloWorld\bin\x64\Debug\HelloWorld.exe
2>Hybridizer out: [INFO] : Found type <HelloWorld.Program> with <1> methods
2>Hybridizer out: [INFO] : Done searching assembly for hybridizer directives
2>Hybridizer out: Hybridizer full path: C:\Users\xxxx.xxxx\AppData\Local\Microsoft\VisualStudio\15.0_775c7353\Extensions\rcr1wcx4.bjz\bin\Hybridizer.exe
2>Hybridizer out: [INFO] : found type Altimesh.Hybridizer.Application.Program
2>Hybridizer out: [INFO] : found method Void Main(System.String[])
2>Hybridizer out: 2018/02/04 16:50:47:516 [INFO] Hybridizer-BASIC (c) Altimesh 2011-2016 - 1.0.0.0
2>Hybridizer out: 2018/02/04 16:50:48:032 [INFO] Hybridizer license: Trial version - for evaluation purpose only
2>Hybridizer out: 2018/02/04 16:50:48:329 [INFO] Processing assembly C:\xxxx\GitHub\hybridizer-basic-samples\HybridizerBasicSamples_CUDA91\1.Simple\HelloWorld\HelloWorld\bin\x64\Debug\HelloWorld.exe
2>Hybridizer out: 2018/02/04 16:50:48:344 [WARN] WARNING : using default builtins
2>Hybridizer out: 2018/02/04 16:50:48:376 [INFO] Loaded built-in configuration from C:\Users\xxxx.xxxx\AppData\Local\Microsoft\VisualStudio\15.0_775c7353\Extensions\rcr1wcx4.bjz\include\hybridizer.cuda.builtins
2>Hybridizer out: 2018/02/04 16:50:48:376 [INFO] Processing type HelloWorld.Program
2>Hybridizer out: 2018/02/04 16:50:48:423 [INFO] Reading for method Void Run(Int32, Double[], Double[]) from assembly HelloWorld, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
2>Hybridizer out: 2018/02/04 16:50:48:516 [INFO] Registering methods
2>Hybridizer out: 2018/02/04 16:50:48:516 [INFO] Reading for method Void Run(Int32, Double[], Double[]) from assembly HelloWorld, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
2>Hybridizer out: 2018/02/04 16:50:48:532 [INFO] Reading for method Void Run(Int32, Double[], Double[]) from assembly HelloWorld, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
2>Hybridizer out: 2018/02/04 16:50:48:563 [INFO] Reading for method Void Run(Int32, Double[], Double[]) from assembly HelloWorld, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
2>Hybridizer out: 2018/02/04 16:50:48:673 [INFO] Reading for method Void .ctor() from assembly HelloWorld, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
2>Hybridizer out: 2018/02/04 16:50:48:673 [INFO] No symbols found for Void .ctor()
2>Hybridizer out: 2018/02/04 16:50:48:673 [INFO] Reading for method Void .ctor() from assembly HelloWorld, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
2>Hybridizer out: 2018/02/04 16:50:48:673 [INFO] No symbols found for Void .ctor()
2>Hybridizer out: 2018/02/04 16:50:48:719 [INFO] Reading for method Void b__0(Int32) from assembly HelloWorld, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
2>Hybridizer out: 2018/02/04 16:50:48:719 [INFO] Reading for method Void b__0(Int32) from assembly HelloWorld, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
2>Hybridizer out: 2018/02/04 16:50:48:766 [INFO] Reading for method System.Threading.Tasks.ParallelLoopResult For(Int32, Int32, System.Action1[System.Int32]) from assembly mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 2>Hybridizer out: 2018/02/04 16:50:48:923 [INFO] No symbols found for System.Threading.Tasks.ParallelLoopResult For(Int32, Int32, System.Action1[System.Int32])
2>Hybridizer out: 2018/02/04 16:50:48:938 [INFO] Flavor CUDA has 4 methods
2>Hybridizer out: 2018/02/04 16:50:48:969 [INFO] Flavor CUDA has 4 methods
2>Hybridizer out: 2018/02/04 16:50:48:985 [INFO] Listing types found for flavor
2>Hybridizer out: 2018/02/04 16:50:48:985 [INFO] found type <System.Object> used by :
2>Hybridizer out: 2018/02/04 16:50:48:985 [INFO] <HelloWorld.Program>
2>Hybridizer out: 2018/02/04 16:50:48:985 [INFO] <HelloWorld.Program+<>c__DisplayClass0_0>
2>Hybridizer out: 2018/02/04 16:50:48:985 [INFO] <System.Threading.Tasks.Parallel>
2>Hybridizer out: 2018/02/04 16:50:48:985 [INFO] <System.ValueType>
2>Hybridizer out: 2018/02/04 16:50:48:985 [INFO] found type <HelloWorld.Program> used by :
2>Hybridizer out: 2018/02/04 16:50:48:985 [INFO] <HelloWorld.Program+<>c__DisplayClass0_0>
2>Hybridizer out: 2018/02/04 16:50:48:985 [INFO] found type <System.Double[]> used by :
2>Hybridizer out: 2018/02/04 16:50:48:985 [INFO] <HelloWorld.Program+<>c__DisplayClass0_0>
2>Hybridizer out: 2018/02/04 16:50:48:985 [INFO] found type <System.ValueType> used by :
2>Hybridizer out: 2018/02/04 16:50:48:985 [INFO] <System.Threading.Tasks.ParallelLoopResult>
2>Hybridizer out: 2018/02/04 16:50:48:985 [INFO] found type <System.Boolean> used by :
2>Hybridizer out: 2018/02/04 16:50:48:985 [INFO] <System.Threading.Tasks.ParallelLoopResult>
2>Hybridizer out: 2018/02/04 16:50:48:985 [INFO] found type <System.Byte> used by :
2>Hybridizer out: 2018/02/04 16:50:48:985 [INFO] <System.Threading.Tasks.ParallelLoopResult>
2>Hybridizer out: 2018/02/04 16:50:48:985 [INFO] found type <System.Nullable`1[[System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]> used by :
2>Hybridizer out: 2018/02/04 16:50:48:985 [INFO] <System.Threading.Tasks.ParallelLoopResult>
2>Hybridizer out: 2018/02/04 16:50:48:985 [INFO] Done listing types found for flavor
2>Hybridizer out: Not Found Altimesh.Hybridizer.Application.resources, Version=1.0.0.0, Culture=en-US, PublicKeyToken=null
2>Hybridizer out: Not Found Altimesh.Hybridizer.Application.resources, Version=1.0.0.0, Culture=en-US, PublicKeyToken=null
2>Hybridizer out: Not Found Altimesh.Hybridizer.Application.resources, Version=1.0.0.0, Culture=en, PublicKeyToken=null
2>Hybridizer out: Not Found Altimesh.Hybridizer.Application.resources, Version=1.0.0.0, Culture=en, PublicKeyToken=null
2>Hybridizer out: Not Found mscorlib.XmlSerializers, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
2>Hybridizer out: 2018/02/04 16:50:49:376 [WARN] [WARNING] Non blittable value type HelloWorld.Program+<>c__DisplayClass0_0 may have poor marshalling performance
2>Hybridizer out: 2018/02/04 16:50:49:376 [WARN] [WARNING] Non blittable value type System.Threading.Tasks.ParallelLoopResult may have poor marshalling performance
2>Hybridizer out: Not Found Altimesh.Hybridizer.Application.resources, Version=1.0.0.0, Culture=en-US, PublicKeyToken=null
2>Hybridizer out: Not Found Altimesh.Hybridizer.Application.resources, Version=1.0.0.0, Culture=en-US, PublicKeyToken=null
2>Hybridizer out: Not Found Altimesh.Hybridizer.Application.resources, Version=1.0.0.0, Culture=en, PublicKeyToken=null
2>Hybridizer out: Not Found Altimesh.Hybridizer.Application.resources, Version=1.0.0.0, Culture=en, PublicKeyToken=null
2>Hybridizer out: [INFO] : PTXJitter called <"C:\Users\xxxx.xxxx\AppData\Local\Microsoft\VisualStudio\15.0_775c7353\Extensions\rcr1wcx4.bjz\bin\Hybridizer.PTXJitterService.9.1.exe" 00000000000004A8 0000000000000568>
2>C:\Users\xxxx.xxxx\AppData\Local\Microsoft\VisualStudio\15.0_775c7353\Extensions\rcr1wcx4.bjz\vsintegration\Hybridizer.targets(80,13): error : Hybridizer error: ======================= ERROR in Hybridizer JIT ==========================
2>C:\Users\xxxx.xxxx\AppData\Local\Microsoft\VisualStudio\15.0_775c7353\Extensions\rcr1wcx4.bjz\vsintegration\Hybridizer.targets(80,13): error : Hybridizer error: [ERROR] : System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Transcoder.Disassembly.UserReportedException: HYBRIDIZER - INTERNAL ERROR
2>C:\Users\xxxx.xxxx\AppData\Local\Microsoft\VisualStudio\15.0_775c7353\Extensions\rcr1wcx4.bjz\vsintegration\Hybridizer.targets(80,13): error : Hybridizer error: at Altimesh.Hybridizer.Application.Toolkit.Run(String[] args)
2>C:\Users\xxxx.xxxx\AppData\Local\Microsoft\VisualStudio\15.0_775c7353\Extensions\rcr1wcx4.bjz\vsintegration\Hybridizer.targets(80,13): error : Hybridizer error: at Altimesh.Hybridizer.Application.Program.Main(String[] args)
2>C:\Users\xxxx.xxxx\AppData\Local\Microsoft\VisualStudio\15.0_775c7353\Extensions\rcr1wcx4.bjz\vsintegration\Hybridizer.targets(80,13): error : Hybridizer error: --- End of inner exception stack trace ---
2>C:\Users\xxxx.xxxx\AppData\Local\Microsoft\VisualStudio\15.0_775c7353\Extensions\rcr1wcx4.bjz\vsintegration\Hybridizer.targets(80,13): error : Hybridizer error: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
2>C:\Users\xxxx.xxxx\AppData\Local\Microsoft\VisualStudio\15.0_775c7353\Extensions\rcr1wcx4.bjz\vsintegration\Hybridizer.targets(80,13): error : Hybridizer error: at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
2>C:\Users\xxxx.xxxx\AppData\Local\Microsoft\VisualStudio\15.0_775c7353\Extensions\rcr1wcx4.bjz\vsintegration\Hybridizer.targets(80,13): error : Hybridizer error: at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
2>C:\Users\xxxx.xxxx\AppData\Local\Microsoft\VisualStudio\15.0_775c7353\Extensions\rcr1wcx4.bjz\vsintegration\Hybridizer.targets(80,13): error : Hybridizer error: at Transcoder.CudaDotNet.CLRHostStarter.AppDomainStarter.RunContent(String args)
2>C:\Users\xxxx.xxxx\AppData\Local\Microsoft\VisualStudio\15.0_775c7353\Extensions\rcr1wcx4.bjz\vsintegration\Hybridizer.targets(80,13): error : Hybridizer error: [FATAL] : Internal Error !
2>Hybridizer out: [DONE]
2>Done building project "HelloWorld_CUDA.vs2017.vcxproj" -- FAILED.
========== Rebuild All: 1 succeeded, 1 failed, 0 skipped ==========

image

Nsight Cuda debugging don't work in unsafe code

When I starting cuda debugging in Sobel_Lock project, system terminate all. This doing only with unsafe code. How can I debugging and profiling unsafe code in Nsight?

Thank you in advance!

DLL not being generated

I'm a little rusty with writing bug reports so I will probably edit this frequently within the first few hours of posting. That said, I made sure to hit all of the items on the checklist:

  • [YES] I have installed C++ support in Visual Studio.
  • [YES] I have queried and validated a license for Hybridizer Essentials and your license is still valid (Tools->Hybridizer Configuration) (I have just recently started the free trial period).
  • [YES] I have CUDA 8 or 9.x installed and Visual Studio Integration enabled (Specifically 9.2).
  • [YES] I run CUDA 9.x with visual 2017, and I have installed v140 toolset and compiled the native project with this toolset.

So, in essence, I keep trying to hybridize my project, and no matter how many times I've done it, there is no DLL for me to use with HybRunner. On top of that, the CUDA satellite project just fails to build (see attached log for details). I suspect that hybridizer.wrappers.cu is not being generated properly and hybridizer.generated.cpp just doesn't even exist (more details are attached below).

I know I'm doing something right, because the hybridizer has run just fine when I've tried to implement the Hello World example, so that's a positive sign. I haven't tried implementing the Mandelbrot example, but that's essentially what my project is (just with more bells and whistles).

Please message me if you need more information about my project or the issue I'm experiencing. Otherwise, see below for more information.

Some additional information that I will update as I think of it:

  • Here's the log file from the failed build: Mandelbrottyzeug_CUDA.log

  • Here is the file in question where I am attempting to implement the hybridizer: MandelbrotDouble.txt

  • Here is the generated hybridizer.wrappers.cu: hybridizer.wrappers.cu.txt

  • Note that the hybridizer.wrappers.cu file generated looks really weird between lines 54 and 104. In fact, that's where the IComparable error is getting thrown. So I think I'm doing something wrong somehow, but I'm not sure what. I've tried this a few times with this project and it doesn't seem to want to work. (The error is being thrown on line 73, by the way)

  • FYI I am running on a GeForce GTX 1080 using Windows 10, Visual Studio 2017 (Community version), CUDA 9.2, and the latest version of Hybridizer.

  • I just attempted the same procedure using CUDA 10.0 and got the same error. Here is the updated crash log: Mandelbrottyzeug_CUDA.log

UPDATE:

I'm having some preliminary success with pasting my project files into a new project that I created to use Hybridizer from the beginning.

Converting IntPtr to float* pointer in kernel function

To efficiently use the GPU I want to make use of the Managed Memory accessable via cuda.MallocManaged. As it returns a pointer to a shared memory address it's not really working together with the HybRunner because pointers cannot be added as an argument when calling a function via a dynamic. Is there any other way to somehow make use of the Managed Memory avoiding having to pass over pointers to the kernel function?
Thanks for the help!

Academic subscription

Hello,I have send a email by my university email to"[email protected]"to apply for an academic subscription,but it replys me that"We do not address technical issues on this email address." Please tell me how to apply for an academic subscriptions,thanks!

Synchronization

I searched information about synchronization, but haven't found it yet. I'm reading info from array and then storing results there, also incrementing values in another array. I assume that I need synchronize it manually. If yes then how better should I do it? Is somewhere an example of calling cuda functions from C#?

Unknown error in MonteCarloHeatEquation

When running MonteCarloHeatEquation project I recieve "Display driver stopped responding and has recovered" error in Windows 7and error message in project:

System.ApplicationException is not processed
  HResult = -2146232832
  Message = CUDA error occured before deserialization (most probably during kernel call): unknown error
  Source = Hybridizer.Runtime.CUDAImports
  StackTrace:
       in Hybridizer.Runtime.CUDAImports.CudaSerializationState.CUDADeserializer.InitialVisit (Object param)
       in Hybridizer.Runtime.CUDAImports.NativeSerializerState.UpdateManagedData (Object param)
       in MonteCarloHeatEquation.MonteCarloHeatSolver_wrapped_CUDA.Solve ()
       in CallSite.Target (Closure, CallSite, Object)
       in System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid1 [T0] (CallSite site, T0 arg0)
       in MonteCarloHeatEquation.Program.Main (String [] args) in D: \ Work \ hybridizer-basic-samples-master \ sampleNew \ HybridizerBasicSamples_CUDA91 \ 3.Maths \ MonteCarloHeatEquation \ MonteCarloHeatEquation \ Program.cs: line 26
       in System.AppDomain._nExecuteAssembly (RuntimeAssembly assembly, String [] args)
       in System.AppDomain.ExecuteAssembly (String assemblyFile, Evidence assemblySecurity, String [] args)
       in Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly ()
       in System.Threading.ExecutionContext.RunInternal (ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       in System.Threading.ExecutionContext.Run (ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       in System.Threading.ExecutionContext.Run (ExecutionContext executionContext, ContextCallback callback, Object state)
       in System.Threading.ThreadHelper.ThreadStart ()
  InnerException:

I use

  • Visual Studio 2015 (version 14.0.25431.01)
  • CUDA 9.1
  • GeForce GTX 1060 6GB with driver version 388.19

Thank you in advance.

Error in .vcxproj

Hi,

After hybridizing my C# project, and building it, I get an error when attempting to build the .vcxproj.

The error is as follows (from the end of the build output):

1>C:\Program Files\Altimesh\Hybridizer Essentials\vsintegration\Hybridizer.targets(80,13): error : [ERROR] : 0X605D : cannot create an instance of a gc type within hybridized code
1>C:\Program Files\Altimesh\Hybridizer Essentials\vsintegration\Hybridizer.targets(80,13): error : [ERROR] : Exception in Hybridizer Main: INTERNAL ERROR


I get many conflicting assembly warnings prior to the error, so perhaps that is the main cause of the issue. Any help would be greatly appreciated.

Thank you!

Exception = Out of range Address

I have following function beginning:
[EntryPoint]
public static void ComputeKohonen(float[] plainNetwork, float[] learningExamples, int[] winRates, int xDim, int yDim, int examplesCount, int minWinRate, float error, float fairnessRatio, float learningVelocity)
{
System.Threading.Tasks.Parallel.For(0, examplesCount, (i) =>
{
float[] output = new float[xDim];

            for (int j = 0; j < xDim; j +=1)
            {  ....

And at j = 64 I get Exception = Out of range Address.
is it a bug or I do not understand something?

Summing Elements of Array

Hello,

When I've programmed CUDA via c++, there existed an AtomicAdd function. Is there a working implementation of this in Hybridizer? Suppose I have an array[] = {5,4,3} and I want to sum each value to get a single value (i.e., 5+4+3 = 12). Here is what I have thus far, but does not return the correct value:

[EntryPoint]
private static void SumAll(double[] a, double b, int N)
{
for (int k = threadIdx.x + blockDim.x * blockIdx.x; k < N; k += blockDim.x * gridDim.x)
{
b += a[k];
}
}

As you can see, "b" should stores the sum. However, this does not work. Under normal circumstances, I would use AtomicAdd and could successfully Sum all elements of an array. How would you go about solving this problem?

Hybridize Project Error

When I try to Hybridize the Project like it is explained in the getting_started.pdf I received the following error:

An error ocurred when Hybridizing project ConsoleApplication5 : Could not create and use satellite project from template

I am using Visual Studio 2015 in a windows 10 computer and CUDA Toolkit 8.
Thank you in advance.

minus in hybridizer

using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
using System.Diagnostics;
using Hybridizer.Runtime;
using Complex = Hybridizer.Runtime.CUDAImports.double2;

namespace Hype3_16
{
class Program
{

static void Main(string[] args)
{

    int Length = 16;
    Complex[] h_signal = new Complex[Length];
    Complex[] b = new Complex[Length];
    double[] a = new double[Length];

    for (int i = 0; i < Length-1; i++)
    {
        a[i] = 1.1d;
    }
    a[Length - 1] = 1.2d;
    IntPtr signal_R = CudaMarshaler.Instance.MarshalManagedToNative(a);
    IntPtr signal_C = CudaMarshaler.Instance.MarshalManagedToNative(h_signal);

    cufftHandle handle;

    cufft.Plan1d(out handle, Length, cufftType.CUFFT_D2Z, 1);
    cufft.ExecD2Z(handle, signal_R, signal_C);

    cuda.DeviceSynchronize();
    CudaMarshaler.Instance.CleanUpNativeData(signal_R);
    CudaMarshaler.Instance.CleanUpNativeData(signal_C);

    for (int i = 0; i < Length; i++)
    {
        Console.Out.WriteLine("{0} ", h_signal[i].y);
    }





}

static void cufft_ERROR_CHECK(cufftResult result)
{
    if (result != cufftResult.CUFFT_SUCCESS)
    {
        Console.Error.WriteLine(Enum.GetName(typeof(cufftResult), result));
        Environment.Exit(6);
    }
}

}
}

missing constructor for float2

It's currently impossible to create float2 variables using code as simple as

float2 a = new float2(x, y);

-> error : no suitable constructor exists to convert from "float" to "float2"

License Invalid Message

I have:

  • Visual Studio 2017 Professional, 15.4.4
  • CUDA 9.1 installed and Visual Studio Integration enabled. I am able to compile the CUDA samples

I receive a license for Hybridizer, but it tells me that the license is invalid when I try to validate in the Hybridizer License Settings dialog. It shows a License Type of ERROR.

image

Is there anything that I'm missing?

Thanks,

-Ryan

Error 0X609F: Cannot link generated binary.

  • [✓] You run Visual Studio 2012, 2013, 2015 or 2017 with a valid license
  • [✓] You installed C++ support in Visual Studio
  • [✓] You queried and validated a license for Hybridizer Essentials and your license is still valid (Tools->Hybridizer Configuration)
  • [✓] You have CUDA 8 or 9.x installed and Visual Studio Integration enabled
  • [✓] If you run cuda 9.x with visual 2017, you have installed v140 toolset and compile native project with this toolset.

image

__shared__memory

I have a confusion that how can I use sharedmemory(which is "shared" in C++) in hybridizer? I want to use my Hybridizer program to get the maximum value or minimum value from a matrix or a picture. I think some strategies by using sharedmemory can make the Gpu work faster.

Commercial license terms

Hi team,

I can't seem to find the details of the commercial license terms on http://www.altimesh.com/.

What I assume/expect is that the commercial term gives me 1 year of updates and support. After that, I assume the released binaries released to customers and my local development environment will continue to work, but I will not get any future updates, for example, for new CUDA versions, I need to renew the subscription. Is that correct?

Also, for a single license, is there multi seat activation, or do I need to purchase one license per seat i.e. it is machine locked?

Thanks

ERROR IN RUNTIME INIT -- ABORTING EXECUTION

Hi,

The Hello world example gets the error "ERROR IN RUNTIME INIT -- ABORTING EXECUTION"

image

image

Visual Studio 2017 version: 15.4.5.
Cuda 9.1 (newest toolkit)

What could cause the error?

FFT Calculation

How can I use hybridizer to make a fft calculation for a one-dimensional array?
I hope altimesh can release a sample to teach us how to use fft .
Thank you.

2D Array does not compile

Attached is a simple project to show that there seems to be a problem with 2D Array support.
The code is correct syntaxwise but does not compile in the hybridizer.

Error no operator "=" matches these operands operand types are: hybridizer::hybarray<int64_t, 2> = hybridizer::hybarray<int64_t, 2> * IEMA-1_CUDA C:\spikes\hybridizer-spikes\bug-case\IEMA-1\Program.cs 13

bug-case.zip

HybridizerBasicSamples_CUDA100

I have installed cuda 10.0 in my computer. But when I open the project "HybridizerBasicSamples_CUDA100" , only the sample "simple cufft" can work in cuda 10.0,other samples can not work.

The error visual studio show me is that ---> System.ApplicationException: Dll load error when loading C:\Program Files\Altimesh\Hybridizer Essentials\bin\Hybridizer.PTXJitterService.9.2.exe: 126

why it shows Hybridizer.PTXJitterService.9.2.exe but not Hybridizer.PTXJitterService.10.0.exe?

Missing .dll When Running HelloWorld Example

I haven't been able to run the CUDA100 examples due to many build errors, the main one being:

Severity Code Description Project File Line Suppression State
Error Could not copy the file "C:\Users\dcorrell\Desktop\hybridizer-basic-samples-master\hybridizer-basic-samples-master\HybridizerBasicSamples_CUDA100\x64\Debug\hybridizer_cuda_reduction.dll" because it was not found. ConjugateGradient (3.Maths\ConjugateGradient\ConjugateGradient)


Furthermore, when attempting to run the HelloWorld example individually, I'm getting: System.ApplicationException: 'Dll load error when loading HelloWorld_CUDA.dll: 126'. After attempting to run the HelloWorld application individually I get the message that the HelloWorld_CUDA.dll does not exist.

Here's the full error:

System.ApplicationException
HResult=0x80131600
Message=Dll load error when loading HelloWorld_CUDA.dll: 126
Source=Hybridizer.Runtime.CUDAImports
StackTrace:
at Hybridizer.Runtime.CUDAImports.Win32KernelInteropTools.LoadLibrary(String libName)
at Hybridizer.Runtime.CUDAImports.HybRunner..ctor(String dllName, HybridizerFlavor flavor, AbstractNativeMarshaler marshaller)
at Hybridizer.Runtime.CUDAImports.HybRunner.Cuda(String dllName)
at HelloWorld.Program.Main(String[] args) in C:\Users\dcorrell\Desktop\hybridizer-basic-samples-master\hybridizer-basic-samples-master\HybridizerBasicSamples_CUDA100\1.Simple\HelloWorld\HelloWorld\Program.cs:line 37


I believe that these errors are related, and I'm not sure how to fix them. Are there missing .dll files from the download, or maybe this is a path issue?

Thank you!

Unable to query for a license

Visual Studio Community 2015, with C++ support, could not query a license from the configuration tool. There's a brief moment where it says "Unable to query for a license, contact support", and I'm not getting any license emails.

UI reports 1.2.9833

Hi there,

After upgrading to the latest version, the UI reports version 1.2.9833, in Hybridizer > About.

Shouldn't it be 1.1.9833?

Thanks

EntryPointNotFoundException with stream using

When I tyrying to use streams like cuda C, program have success build, but get a runtime exception: System.EntryPointNotFoundException "Can not find entry point "run_ExternCWrapperStream_CUDA" in DLL". In hybridizer.wrappers.cu was created only function "extern "C" DLL_PUBLIC int run_ExternCWrapper_CUDA". My code:

cudaStream_t stream0, stream1;
cuda.StreamCreate(out stream0);
cuda.StreamCreate(out stream1);

IntPtr dev_a0, dev_c0, dev_a1, dev_c1;
IntPtr host_a, host_c;

cuda.Malloc(out dev_a0, N * sizeof(int));
cuda.Malloc(out dev_c0, N * sizeof(int));
cuda.Malloc(out dev_a1, N * sizeof(int));
cuda.Malloc(out dev_c1, N * sizeof(int));

cuda.HostAlloc(out host_a, fullDataSize * sizeof(int), cudaHostAllocFlags.cudaHostAllocDefault);
cuda.HostAlloc(out host_c, fullDataSize * sizeof(int), cudaHostAllocFlags.cudaHostAllocDefault);

HybRunner runner0 = HybRunner.Cuda("SimplePrintf_CUDA.dll", stream0, CudaMarshaler.Instance).SetDistrib(N/4, 4);
HybRunner runner1 = HybRunner.Cuda("SimplePrintf_CUDA.dll", stream1, CudaMarshaler.Instance).SetDistrib(N / 4, 4);

for (int i = 0; i < fullDataSize; i+=2*N)
{
     cuda.MemcpyAsync(dev_a0, host_a + i * sizeof(int), N * sizeof(int), cudaMemcpyKind.cudaMemcpyHostToDevice, stream0);
     cuda.MemcpyAsync(dev_a1, host_a + (N+i) * sizeof(int), N * sizeof(int), cudaMemcpyKind.cudaMemcpyHostToDevice, stream1);

     runner0.Wrap(new Program()).Run(dev_a0, dev_c0);
     runner1.Wrap(new Program()).Run(dev_a1, dev_c1);

     cuda.MemcpyAsync(host_c + i * sizeof(int), dev_c0, N * sizeof(int), cudaMemcpyKind.cudaMemcpyDeviceToHost, stream0);
     cuda.MemcpyAsync(host_c + (N+i) * sizeof(int), dev_c1, N * sizeof(int), cudaMemcpyKind.cudaMemcpyDeviceToHost, stream1);
}
cuda.StreamSynchronize(stream0);
cuda.StreamSynchronize(stream1);

cuda.FreeHost(host_a);
cuda.FreeHost(host_c);
cuda.Free(dev_a0);
cuda.Free(dev_c0);
cuda.Free(dev_a1);
cuda.Free(dev_c1);
cuda.StreamDestroy(stream0);
cuda.StreamDestroy(stream1);

with EntryPoint:
[EntryPoint("run")] public static unsafe void Run(int* a, int* b) { //something }
Thanks in advance!

Validating an invalid license closes the license window and shouldn't

Repro-steps :
Install Hybridizer Essentials latest version (8943).
Open the License window (tools->Hybridizer Configuration)
Reset your license and type "invalid license" in the text box.
Click Validate

Expected :

  • UI displays "Invalid License"

Actual

  • window closes without any displayed error

Invalid license

Hello,my first free license has been expired,I have applied a new free license,but when I program in my vs2013,it shows errors:[FATAL] : [ERROR] LicenseException: Invalid license
Please help me for it,thank you very much!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.