Datasets:
Formats:
imagefolder
Size:
< 1K
Commit
•
c943b52
1
Parent(s):
7b4564b
Upload folder using huggingface_hub
Browse files- BallChase.csproj +1 -1
- BallChase.csproj.old +12 -0
- addons/godot_rl_agents/icon.png +2 -2
- addons/godot_rl_agents/icon.png.import +1 -1
- addons/godot_rl_agents/onnx/csharp/SessionConfigurator.cs +114 -95
- cherry.png +2 -2
- cherry.png.import +1 -1
- icon.png +2 -2
- icon.png.import +1 -1
- light_mask.png +2 -2
- light_mask.png.import +1 -1
- lollipopGreen.png +2 -2
- lollipopGreen.png.import +1 -1
BallChase.csproj
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
<Project Sdk="Godot.NET.Sdk/4.
|
2 |
<PropertyGroup>
|
3 |
<TargetFramework>net6.0</TargetFramework>
|
4 |
<EnableDynamicLoading>true</EnableDynamicLoading>
|
|
|
1 |
+
<Project Sdk="Godot.NET.Sdk/4.1.1">
|
2 |
<PropertyGroup>
|
3 |
<TargetFramework>net6.0</TargetFramework>
|
4 |
<EnableDynamicLoading>true</EnableDynamicLoading>
|
BallChase.csproj.old
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<Project Sdk="Godot.NET.Sdk/4.0.2">
|
2 |
+
<PropertyGroup>
|
3 |
+
<TargetFramework>net6.0</TargetFramework>
|
4 |
+
<EnableDynamicLoading>true</EnableDynamicLoading>
|
5 |
+
</PropertyGroup>
|
6 |
+
<ItemGroup>
|
7 |
+
<PackageReference Include="Microsoft.ML.OnnxRuntime" Version="1.14.1" />
|
8 |
+
<PackageReference Include="Microsoft.ML.OnnxRuntime.DirectML" Version="1.14.1" />
|
9 |
+
<PackageReference Include="Microsoft.ML.OnnxRuntime.Gpu" Version="1.14.1" />
|
10 |
+
<PackageReference Include="System.Numerics.Tensors" Version="0.1.0" />
|
11 |
+
</ItemGroup>
|
12 |
+
</Project>
|
addons/godot_rl_agents/icon.png
CHANGED
Git LFS Details
|
Git LFS Details
|
addons/godot_rl_agents/icon.png.import
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
importer="texture"
|
4 |
type="CompressedTexture2D"
|
5 |
-
uid="uid://
|
6 |
path="res://.godot/imported/icon.png-45a871b53434e556222f5901d598ab34.ctex"
|
7 |
metadata={
|
8 |
"vram_texture": false
|
|
|
2 |
|
3 |
importer="texture"
|
4 |
type="CompressedTexture2D"
|
5 |
+
uid="uid://ca3qj1ucje2ob"
|
6 |
path="res://.godot/imported/icon.png-45a871b53434e556222f5901d598ab34.ctex"
|
7 |
metadata={
|
8 |
"vram_texture": false
|
addons/godot_rl_agents/onnx/csharp/SessionConfigurator.cs
CHANGED
@@ -1,106 +1,125 @@
|
|
1 |
using Godot;
|
2 |
using Microsoft.ML.OnnxRuntime;
|
3 |
|
4 |
-
namespace GodotONNX
|
5 |
-
|
|
|
6 |
|
7 |
-
|
|
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
/// <include file='docs/SessionConfigurator.xml' path='docs/members[@name="SessionConfigurator"]/GetSessionOptions/*'/>
|
12 |
-
public static SessionOptions GetSessionOptions() {
|
13 |
-
options = new SessionOptions();
|
14 |
-
options.LogSeverityLevel = OrtLoggingLevel.ORT_LOGGING_LEVEL_WARNING;
|
15 |
-
// see warnings
|
16 |
-
SystemCheck();
|
17 |
-
return options;
|
18 |
-
}
|
19 |
-
/// <include file='docs/SessionConfigurator.xml' path='docs/members[@name="SessionConfigurator"]/SystemCheck/*'/>
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
|
|
|
|
31 |
|
32 |
-
|
33 |
-
//Windows can use OpenVINO (C#) on x64
|
34 |
-
//TODO: try TensorRT instead of CUDA
|
35 |
-
//TODO: Use OpenVINO for Intel Graphics
|
36 |
-
|
37 |
-
string [] ComputeNames = {"CUDA", "DirectML/ROCm", "DirectML", "CoreML", "CPU"};
|
38 |
-
//match OS and Compute API
|
39 |
-
options.AppendExecutionProvider_CPU(0); // Always use CPU
|
40 |
-
GD.Print("OS: " + OSName, " | Compute API: " + ComputeNames[ComputeAPIID]);
|
41 |
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
if (ComputeAPIID == 0)
|
46 |
-
{
|
47 |
-
//CUDA
|
48 |
-
//options.AppendExecutionProvider_CUDA(0);
|
49 |
-
options.AppendExecutionProvider_DML(0);
|
50 |
-
}
|
51 |
-
else if (ComputeAPIID == 1)
|
52 |
-
{
|
53 |
-
//DirectML
|
54 |
-
options.AppendExecutionProvider_DML(0);
|
55 |
-
}
|
56 |
-
break;
|
57 |
-
case "X11": //Can use CUDA, ROCm
|
58 |
-
if (ComputeAPIID == 0)
|
59 |
-
{
|
60 |
-
//CUDA
|
61 |
-
//options.AppendExecutionProvider_CUDA(0);
|
62 |
-
}
|
63 |
-
if (ComputeAPIID == 1)
|
64 |
-
{
|
65 |
-
//ROCm, only works on x86
|
66 |
-
//Research indicates that this has to be compiled as a GDNative plugin
|
67 |
-
GD.Print("ROCm not supported yet, using CPU.");
|
68 |
-
options.AppendExecutionProvider_CPU(0);
|
69 |
-
}
|
70 |
-
|
71 |
-
break;
|
72 |
-
case "OSX": //Can use CoreML
|
73 |
-
if (ComputeAPIID == 0) { //CoreML
|
74 |
-
//TODO: Needs testing
|
75 |
-
options.AppendExecutionProvider_CoreML(0);
|
76 |
-
//CoreML on ARM64, out of the box, on x64 needs .tar file from GitHub
|
77 |
-
}
|
78 |
-
break;
|
79 |
-
default:
|
80 |
-
GD.Print("OS not Supported.");
|
81 |
-
break;
|
82 |
-
}
|
83 |
-
}
|
84 |
-
/// <include file='docs/SessionConfigurator.xml' path='docs/members[@name="SessionConfigurator"]/ComputeCheck/*'/>
|
85 |
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
using Godot;
|
2 |
using Microsoft.ML.OnnxRuntime;
|
3 |
|
4 |
+
namespace GodotONNX
|
5 |
+
{
|
6 |
+
/// <include file='docs/SessionConfigurator.xml' path='docs/members[@name="SessionConfigurator"]/SessionConfigurator/*'/>
|
7 |
|
8 |
+
public static class SessionConfigurator
|
9 |
+
{
|
10 |
|
11 |
+
private static SessionOptions options = new SessionOptions();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
+
/// <include file='docs/SessionConfigurator.xml' path='docs/members[@name="SessionConfigurator"]/GetSessionOptions/*'/>
|
14 |
+
public static SessionOptions GetSessionOptions()
|
15 |
+
{
|
16 |
+
options = new SessionOptions();
|
17 |
+
options.LogSeverityLevel = OrtLoggingLevel.ORT_LOGGING_LEVEL_WARNING;
|
18 |
+
// see warnings
|
19 |
+
SystemCheck();
|
20 |
+
return options;
|
21 |
+
}
|
22 |
|
23 |
+
public enum ComputeName
|
24 |
+
{
|
25 |
+
CUDA,
|
26 |
+
ROCm,
|
27 |
+
DirectML,
|
28 |
+
CoreML,
|
29 |
+
CPU
|
30 |
+
}
|
31 |
|
32 |
+
/// <include file='docs/SessionConfigurator.xml' path='docs/members[@name="SessionConfigurator"]/SystemCheck/*'/>
|
33 |
+
static public void SystemCheck()
|
34 |
+
{
|
35 |
+
//Most code for this function is verbose only, the only reason it exists is to track
|
36 |
+
//implementation progress of the different compute APIs.
|
37 |
|
38 |
+
//December 2022: CUDA is not working.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
+
string OSName = OS.GetName(); //Get OS Name
|
41 |
+
ComputeName ComputeAPI = ComputeCheck(); //Get Compute API
|
42 |
+
//TODO: Get CPU architecture
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
|
44 |
+
//Linux can use OpenVINO (C#) on x64 and ROCm on x86 (GDNative/C++)
|
45 |
+
//Windows can use OpenVINO (C#) on x64
|
46 |
+
//TODO: try TensorRT instead of CUDA
|
47 |
+
//TODO: Use OpenVINO for Intel Graphics
|
48 |
+
|
49 |
+
//match OS and Compute API
|
50 |
+
options.AppendExecutionProvider_CPU(0); // Always use CPU
|
51 |
+
GD.Print("OS: " + OSName, " | Compute API: " + ComputeAPI);
|
52 |
+
|
53 |
+
switch (OSName)
|
54 |
+
{
|
55 |
+
case "Windows": //Can use CUDA, DirectML
|
56 |
+
if (ComputeAPI is ComputeName.CUDA)
|
57 |
+
{
|
58 |
+
//CUDA
|
59 |
+
//options.AppendExecutionProvider_CUDA(0);
|
60 |
+
options.AppendExecutionProvider_DML(0);
|
61 |
+
}
|
62 |
+
else if (ComputeAPI is ComputeName.DirectML)
|
63 |
+
{
|
64 |
+
//DirectML
|
65 |
+
options.AppendExecutionProvider_DML(0);
|
66 |
+
}
|
67 |
+
break;
|
68 |
+
case "X11": //Can use CUDA, ROCm
|
69 |
+
if (ComputeAPI is ComputeName.CUDA)
|
70 |
+
{
|
71 |
+
//CUDA
|
72 |
+
//options.AppendExecutionProvider_CUDA(0);
|
73 |
+
}
|
74 |
+
if (ComputeAPI is ComputeName.ROCm)
|
75 |
+
{
|
76 |
+
//ROCm, only works on x86
|
77 |
+
//Research indicates that this has to be compiled as a GDNative plugin
|
78 |
+
GD.Print("ROCm not supported yet, using CPU.");
|
79 |
+
options.AppendExecutionProvider_CPU(0);
|
80 |
+
}
|
81 |
+
break;
|
82 |
+
case "OSX": //Can use CoreML
|
83 |
+
if (ComputeAPI is ComputeName.CoreML)
|
84 |
+
{ //CoreML
|
85 |
+
//TODO: Needs testing
|
86 |
+
options.AppendExecutionProvider_CoreML(0);
|
87 |
+
//CoreML on ARM64, out of the box, on x64 needs .tar file from GitHub
|
88 |
+
}
|
89 |
+
break;
|
90 |
+
default:
|
91 |
+
GD.Print("OS not Supported.");
|
92 |
+
break;
|
93 |
+
}
|
94 |
+
}
|
95 |
+
/// <include file='docs/SessionConfigurator.xml' path='docs/members[@name="SessionConfigurator"]/ComputeCheck/*'/>
|
96 |
+
|
97 |
+
public static ComputeName ComputeCheck()
|
98 |
+
{
|
99 |
+
string adapterName = Godot.RenderingServer.GetVideoAdapterName();
|
100 |
+
//string adapterVendor = Godot.RenderingServer.GetVideoAdapterVendor();
|
101 |
+
adapterName = adapterName.ToUpper(new System.Globalization.CultureInfo(""));
|
102 |
+
//TODO: GPU vendors for MacOS, what do they even use these days?
|
103 |
+
|
104 |
+
// Due to issues on RX 570 and RTX 3060 in Windows
|
105 |
+
// temporarily disabling the DirectML option so it will use CPU
|
106 |
+
/*
|
107 |
+
if (adapterName.Contains("INTEL"))
|
108 |
+
{
|
109 |
+
return ComputeName.DirectML;
|
110 |
+
}
|
111 |
+
if (adapterName.Contains("AMD") || adapterName.Contains("RADEON"))
|
112 |
+
{
|
113 |
+
return ComputeName.DirectML;
|
114 |
+
}
|
115 |
+
if (adapterName.Contains("NVIDIA"))
|
116 |
+
{
|
117 |
+
return ComputeName.CUDA;
|
118 |
+
}
|
119 |
+
|
120 |
+
//GD.Print("Graphics Card not recognized."); //Should use CPU
|
121 |
+
*/
|
122 |
+
return ComputeName.CPU;
|
123 |
+
}
|
124 |
+
}
|
125 |
+
}
|
cherry.png
CHANGED
Git LFS Details
|
Git LFS Details
|
cherry.png.import
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
importer="texture"
|
4 |
type="CompressedTexture2D"
|
5 |
-
uid="uid://
|
6 |
path="res://.godot/imported/cherry.png-54f14847dd7a94d627024962d7d6b865.ctex"
|
7 |
metadata={
|
8 |
"vram_texture": false
|
|
|
2 |
|
3 |
importer="texture"
|
4 |
type="CompressedTexture2D"
|
5 |
+
uid="uid://6303w1vjemkx"
|
6 |
path="res://.godot/imported/cherry.png-54f14847dd7a94d627024962d7d6b865.ctex"
|
7 |
metadata={
|
8 |
"vram_texture": false
|
icon.png
CHANGED
Git LFS Details
|
Git LFS Details
|
icon.png.import
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
importer="texture"
|
4 |
type="CompressedTexture2D"
|
5 |
-
uid="uid://
|
6 |
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
|
7 |
metadata={
|
8 |
"vram_texture": false
|
|
|
2 |
|
3 |
importer="texture"
|
4 |
type="CompressedTexture2D"
|
5 |
+
uid="uid://cchveg0stqnxt"
|
6 |
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
|
7 |
metadata={
|
8 |
"vram_texture": false
|
light_mask.png
CHANGED
Git LFS Details
|
Git LFS Details
|
light_mask.png.import
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
importer="texture"
|
4 |
type="CompressedTexture2D"
|
5 |
-
uid="uid://
|
6 |
path="res://.godot/imported/light_mask.png-40da3c93e1795f65c34ad69a6ae38ba3.ctex"
|
7 |
metadata={
|
8 |
"vram_texture": false
|
|
|
2 |
|
3 |
importer="texture"
|
4 |
type="CompressedTexture2D"
|
5 |
+
uid="uid://bmu4l88h02e6h"
|
6 |
path="res://.godot/imported/light_mask.png-40da3c93e1795f65c34ad69a6ae38ba3.ctex"
|
7 |
metadata={
|
8 |
"vram_texture": false
|
lollipopGreen.png
CHANGED
Git LFS Details
|
Git LFS Details
|
lollipopGreen.png.import
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
importer="texture"
|
4 |
type="CompressedTexture2D"
|
5 |
-
uid="uid://
|
6 |
path="res://.godot/imported/lollipopGreen.png-ad04020a819959359f29965dcb47712e.ctex"
|
7 |
metadata={
|
8 |
"vram_texture": false
|
|
|
2 |
|
3 |
importer="texture"
|
4 |
type="CompressedTexture2D"
|
5 |
+
uid="uid://76gmtvtrybol"
|
6 |
path="res://.godot/imported/lollipopGreen.png-ad04020a819959359f29965dcb47712e.ctex"
|
7 |
metadata={
|
8 |
"vram_texture": false
|