edbeeching HF staff commited on
Commit
c943b52
1 Parent(s): 7b4564b

Upload folder using huggingface_hub

Browse files
BallChase.csproj CHANGED
@@ -1,4 +1,4 @@
1
- <Project Sdk="Godot.NET.Sdk/4.0.2">
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

  • SHA256: e3a8bc372d3313ce1ede4e7554472e37b322178b9488bfb709e296585abd3c44
  • Pointer size: 128 Bytes
  • Size of remote file: 198 Bytes

Git LFS Details

  • SHA256: 2d6c72fe33411b6b66cf5fc671d56ac1c68e406c75fe4f9c12d71e09abad8b87
  • Pointer size: 127 Bytes
  • Size of remote file: 10 Bytes
addons/godot_rl_agents/icon.png.import CHANGED
@@ -2,7 +2,7 @@
2
 
3
  importer="texture"
4
  type="CompressedTexture2D"
5
- uid="uid://dn7mfntm1bfv4"
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
- /// <include file='docs/SessionConfigurator.xml' path='docs/members[@name="SessionConfigurator"]/SessionConfigurator/*'/>
 
6
 
7
- public static class SessionConfigurator {
 
8
 
9
- private static SessionOptions options = new SessionOptions();
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
- static public void SystemCheck()
22
- {
23
- //Most code for this function is verbose only, the only reason it exists is to track
24
- //implementation progress of the different compute APIs.
 
 
 
 
 
25
 
26
- //December 2022: CUDA is not working.
 
 
 
 
 
 
 
27
 
28
- string OSName = OS.GetName(); //Get OS Name
29
- int ComputeAPIID = ComputeCheck(); //Get Compute API
30
- //TODO: Get CPU architecture
 
 
31
 
32
- //Linux can use OpenVINO (C#) on x64 and ROCm on x86 (GDNative/C++)
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
- switch (OSName)
43
- {
44
- case "Windows": //Can use CUDA, DirectML
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
- public static int ComputeCheck()
87
- {
88
- string adapterName = Godot.RenderingServer.GetVideoAdapterName();
89
- //string adapterVendor = Godot.RenderingServer.GetVideoAdapterVendor();
90
- adapterName = adapterName.ToUpper(new System.Globalization.CultureInfo(""));
91
- //TODO: GPU vendors for MacOS, what do they even use these days?
92
- if (adapterName.Contains("INTEL")) {
93
- //Return 2, should use DirectML only
94
- return 2;}
95
- if (adapterName.Contains("AMD")) {
96
- //Return 1, should use DirectML, check later for ROCm
97
- return 1;}
98
- if (adapterName.Contains("NVIDIA")){
99
- //Return 0, should use CUDA
100
- return 0;}
101
-
102
- GD.Print("Graphics Card not recognized."); //Return -1, should use CPU
103
- return -1;
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

  • SHA256: 3f741d90fd626edf9dec870bcaa695ba023f82c34843535e7f06afde56ee6eae
  • Pointer size: 129 Bytes
  • Size of remote file: 2.8 kB

Git LFS Details

  • SHA256: 2d6c72fe33411b6b66cf5fc671d56ac1c68e406c75fe4f9c12d71e09abad8b87
  • Pointer size: 127 Bytes
  • Size of remote file: 10 Bytes
cherry.png.import CHANGED
@@ -2,7 +2,7 @@
2
 
3
  importer="texture"
4
  type="CompressedTexture2D"
5
- uid="uid://c77mj86i50gub"
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

  • SHA256: 2c160bfdb8d0423b958083202dc7b58d499cbef22f28d2a58626884378ce9b7f
  • Pointer size: 129 Bytes
  • Size of remote file: 3.31 kB

Git LFS Details

  • SHA256: 2d6c72fe33411b6b66cf5fc671d56ac1c68e406c75fe4f9c12d71e09abad8b87
  • Pointer size: 127 Bytes
  • Size of remote file: 10 Bytes
icon.png.import CHANGED
@@ -2,7 +2,7 @@
2
 
3
  importer="texture"
4
  type="CompressedTexture2D"
5
- uid="uid://do4v0552sgtv3"
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

  • SHA256: 89d281cb04f641254a0a1b7fad16a2a021e777efd8e48df037a2740fcc289e4f
  • Pointer size: 129 Bytes
  • Size of remote file: 8.98 kB

Git LFS Details

  • SHA256: 2d6c72fe33411b6b66cf5fc671d56ac1c68e406c75fe4f9c12d71e09abad8b87
  • Pointer size: 127 Bytes
  • Size of remote file: 10 Bytes
light_mask.png.import CHANGED
@@ -2,7 +2,7 @@
2
 
3
  importer="texture"
4
  type="CompressedTexture2D"
5
- uid="uid://dlyw6fyas1sr8"
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

  • SHA256: f25f361df86baefd7477484763453ff7e6e1e5d311e9e47e7414c92f193104c9
  • Pointer size: 129 Bytes
  • Size of remote file: 3.59 kB

Git LFS Details

  • SHA256: 2d6c72fe33411b6b66cf5fc671d56ac1c68e406c75fe4f9c12d71e09abad8b87
  • Pointer size: 127 Bytes
  • Size of remote file: 10 Bytes
lollipopGreen.png.import CHANGED
@@ -2,7 +2,7 @@
2
 
3
  importer="texture"
4
  type="CompressedTexture2D"
5
- uid="uid://cy4acafft8vjv"
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