Jump to content
  • Advertisement

Search the Community

Showing results for tags 'OpenCL'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Categories

  • Audio
    • Music and Sound FX
  • Business
    • Business and Law
    • Career Development
    • Production and Management
  • Game Design
    • Game Design and Theory
    • Writing for Games
    • UX for Games
  • Industry
    • Interviews
    • Event Coverage
  • Programming
    • Artificial Intelligence
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Engines and Middleware
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
  • Archive

Categories

  • Audio
  • Visual Arts
  • Programming
  • Writing

Categories

  • Game Dev Loadout
  • Game Dev Unchained

Categories

  • Game Developers Conference
    • GDC 2017
    • GDC 2018
  • Power-Up Digital Games Conference
    • PDGC I: Words of Wisdom
    • PDGC II: The Devs Strike Back
    • PDGC III: Syntax Error

Forums

  • Audio
    • Music and Sound FX
  • Business
    • Games Career Development
    • Production and Management
    • Games Business and Law
  • Game Design
    • Game Design and Theory
    • Writing for Games
  • Programming
    • Artificial Intelligence
    • Engines and Middleware
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
    • 2D and 3D Art
    • Critique and Feedback
  • Community
    • GameDev Challenges
    • GDNet+ Member Forum
    • GDNet Lounge
    • GDNet Comments, Suggestions, and Ideas
    • Coding Horrors
    • Your Announcements
    • Hobby Project Classifieds
    • Indie Showcase
    • Article Writing
  • Affiliates
    • NeHe Productions
    • AngelCode
  • Topical
    • Virtual and Augmented Reality
    • News
  • Workshops
    • C# Workshop
    • CPP Workshop
    • Freehand Drawing Workshop
    • Hands-On Interactive Game Development
    • SICP Workshop
    • XNA 4.0 Workshop
  • Archive
    • Topical
    • Affiliates
    • Contests
    • Technical
  • GameDev Challenges's Topics
  • For Beginners's Forum

Calendars

  • Community Calendar
  • Games Industry Events
  • Game Jams
  • GameDev Challenges's Schedule

Blogs

There are no results to display.

There are no results to display.

Product Groups

  • Advertisements
  • GameDev Gear

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Website


Role


Twitter


Github


Twitch


Steam

Found 11 results

  1. Hello ! I have two gpu on my computer, one from my cpu and another one from my graphic card. I am trying to use the opengl/opencl interop capabilities. But I am stuck at the creation of the opencl context, I don't know how to identify which platform / device of the two one is used by opengl. In the above code, which fonction should I use in the test "DEVICE MATCHING OPENGL ONE" to test if the device is the one used by OpenGL, or what should I do to test if the platform_id is the good one ? sf::ContextSettings settings; settings.depthBits = 24; settings.stencilBits = 8; settings.antialiasingLevel = 2; sf::Window window(sf::VideoMode(2048, 1024), "GAME", sf::Style::Fullscreen, settings); glewInit(); cl_platform_id platform_ids[16] = { NULL }; cl_device_id device_id = NULL; cl_uint ret_num_devices; cl_uint ret_num_platforms; cl_platform_id platform_id = 0; cl_int ret = clGetPlatformIDs(_countof(platform_ids), platform_ids, &ret_num_platforms); size_t n = 0; cl_context_properties props[] = { CL_GL_CONTEXT_KHR, (cl_context_properties) wglGetCurrentContext(), CL_WGL_HDC_KHR, (cl_context_properties) wglGetCurrentDC(), CL_CONTEXT_PLATFORM, (cl_context_properties) platform_id, 0 }; for (size_t i = 0; i < ret_num_platforms; ++i) { platform_id = platform_ids[i]; cl_device_id curDevices_id[16]; ret = clGetDeviceIDs(platform_id, CL_DEVICE_TYPE_GPU, _countof(curDevices_id), curDevices_id, &ret_num_devices); for (cl_uint nDevices = 0; nDevices < ret_num_devices; ++nDevices) { cl_device_id curDevice_id = curDevices_id[nDevices]; clGetGLContextInfoKHR_fn clGetGLContextInfo = reinterpret_cast<clGetGLContextInfoKHR_fn> (clGetExtensionFunctionAddressForPlatform( platform_id, "clGetGLContextInfoKHR")); if (clGetGLContextInfo) { cl_device_id clGLDevice = 0; props[5] = reinterpret_cast<cl_context_properties>(platform_id); clGetGLContextInfo(props, CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR, sizeof(clGLDevice), &clGLDevice, &n); if (DEVICE MATCHING OPENGL ONE) { device_id = clGLDevice; } } } if (device_id) { break; } } cl_context context = clCreateContext(props, 1, &device_id, NULL, NULL, &ret); Thanks for your future help!
  2. Hello. I'm tring to implement opencl/opengl interop via clCreateFromGLTexture (texture sharing) glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); With such texture I expected that write_imagei and write_imageui would work but they don't. Only write_imagef works. This behaviour is same for intel and nvidia gpus on my laptop. Why is it and why there is no such information in any documentation and in the entire internet? This pitfall cost me several hours and probably same for many developers.
  3. Hello. Is it possible to have global variables in OpenCL similar to __device__ variables in Cuda which can be assigned via cudaMemcpyToSymbol?
  4. FusionCL.Net is a new wrapper around OpenCL for C#(4.7.2) - The git is online, and it is working. It's not 100% complete but you can create programs, run kernels, create membuffers and read/write them. It works fine for me on a Nvidia 1060. There are two projects on the git repo. FusionCLNative.dll - this is a C++ wrapper around opencl, you do not need to use this. FusionCL.Net - This is a C# set of classes(Namespace:FusionCL) that internally uses the native dll to create and use the OpenCL library. Like i said, not 100% complete, but it is working and usable. Only a small amount of code really, but it works well and I think is very easy to use. - So, yeah just a head's up. Free for anyone, please let me know if you run into any issues or have any requests for future commits. Cheers! https://github.com/AntDevUnity/FusionCL.NET
  5. Hello every one, When I tried to use my vbo with opencl I get a crash when calling clCreateFromGLBuffer Below a small code that reproduce the issue: initialisation of the opengl context sf::ContextSettings settings; settings.depthBits = 24; settings.stencilBits = 8; settings.antialiasingLevel = 2; sf::Window window(sf::VideoMode(2048, 1024), "GAME", sf::Style::Fullscreen, settings); glewInit(); initialisation of the opencl context cl_platform_id platform_id = NULL; cl_device_id device_id = NULL; cl_uint ret_num_devices; cl_uint ret_num_platforms; cl_int ret = clGetPlatformIDs(1, &platform_id, &ret_num_platforms); ret = clGetDeviceIDs(platform_id, CL_DEVICE_TYPE_GPU, 1, &device_id, &ret_num_devices); cl_context_properties props[] = { CL_GL_CONTEXT_KHR, (cl_context_properties) wglGetCurrentContext(), CL_WGL_HDC_KHR, (cl_context_properties) wglGetCurrentDC(), CL_CONTEXT_PLATFORM, (cl_context_properties) platform_id, 0 }; cl_context context = clCreateContext(props, 1, &device_id, NULL, NULL, &ret); GLuint vboID_m = 0; Creation of the vertex buffer object glGenBuffers(1, &vboID_m); glBindBuffer(GL_ARRAY_BUFFER, vboID_m); { std::vector<float> tmp = { 0., 0., 0., 0., 0., 0., 0., 0., 0. }; glBufferData(GL_ARRAY_BUFFER, (tmp.size()) * sizeof(float), 0, GL_STATIC_DRAW); glBufferSubData(GL_ARRAY_BUFFER, 0, tmp.size() * sizeof(float), tmp.data()); } glBindBuffer(GL_ARRAY_BUFFER, 0); glFlush(); Linkage of the opencl buffer with the opengl vertex buffer object cl_int status; clCreateFromGLBuffer(context, CL_MEM_READ_WRITE, vboID_m, &status); return 0; Thanks for your help!
  6. Hello! I'm a simple user, not a developer, but I need help on an issue that requires a developer's level of expertise. Briefly, I'm running a program that is using Direct3D, OpenCL and pixel shaders at the same time. Cooperation of these 3 entities leads to a critical decrease of performance, which begins a couple of minutes after the program startup. Now, the details. I'm running a video player with a frame interpolator and a 3rd party video renderer attached to it. The frame interpolator uses OpenCL for its functioning and the renderer uses Direct3D9. In addition to that, certain image processing algorithms in the renderer are implemented as pixel shaders, so when you activate them, shaders also start running. But when I activate these shaders, a trouble happens. For the first couple of minutes the player runs smoothly, but after that CPU load suddenly rises and the renderer starts dropping frames of video. I know it's the renderer because it shows on screen statistics with the renderer frame queue among them, and the queue gets almost empty at that moment. There's also the decoder queue, which precedes rendering queue, and sometimes it gets empty too. I've been trying to solve the problem by switching different settings, but it's useless, which leads me to the conclusion that source of the problem lies on a lower level than the programs themselves, I guess in the APIs. As the trouble doesn't begin at once, I presume that there is some memory buffer somewhere in this chain, which starts to fill with movie playback beginning and when it overflows, frames start dropping. I need to track the source of this problem. If these symptoms give you an idea of what's going on, tell me. If not, tell me what tools can make a low-level diagnostics to find the source and how to use them for this purpose. I've already tried running CodeXL on the player's process, but somewhy it's not able to capture OpenCL calls, like they are not there. If you need additional information, tell me. If you can't give any good advice, be quiet - I need real help here, not useless chit-chat so common on the internet.
  7. Hello. What would be the best way to handle such error of enqueue_kernel, let's say for sort algorithm? Loop until it returns success? One problem with this approach that parent kernels can grab all resources and hence loops will be infinite.
  8. On stackoverflow, I asked the same question I'm about to ask now. There are commentaries on the question that gives information. What are the differences between OpenMP, OpenACC, OpenCL, SIMD, and MIMD? Also, in which cases each library is more suited for? What I currently know : OpenCL and CUDA are for GPU programming. They take advantage of the fact that GPUs have a lot of cores. CUDA is proprietary to NVIDIA and only works on its GPUs, whilst OpenCL is multiplatform. OpenMP is for CPU wise parallelism. OpenACC also seems to be for CPU task parallelism. SIMD is for executing an operation on multiple cores (CPU only?). MIMD seems to be for executing multiple operations on multiple cores (CPU only?). What I aim to learn here is which libraries are best suited for optimizing an algorithm on the CPU & GPU. Hopefully, I would like to use only one library to do both.
  9. Well i found out Here what's the problem and how to solve it (Something about world coordinates and object coordinates) but i can't understand how ti works. Can you show me some examples in code on how you implement this??? Scaling Matrix: m_Impl->scale = glm::mat4(1.0f); m_Impl->scale = glm::scale(m_Impl->scale, glm::vec3(width, height, 0)); Verticies: //Verticies. float verticies[] = { //Positions. //Texture Coordinates. 1.0f, 1.0f, 0.0f, 0.0f, 2.0f, 1.0f, 1.0f, 0.0f, 2.0f, 2.0f, 1.0f, 1.0f, 1.0f, 2.0f, 0.0f, 1.0f }; Rendering: //Projection Matrix. glm::mat4 proj = glm::ortho(0.0f, (float)window->GetWidth(), 0.0f, (float)window->GetHeight(), -1.0f, 1.0f); //Set the uniform. material->program->setUniformMat4f("u_MVP", proj * model); //model is the scale matrix from the previous code. //Draw. glDrawElements(GL_TRIANGLES, material->ibo->GetCount(), GL_UNSIGNED_INT, NULL); Shader: #shader vertex #version 330 core layout(location = 0) in vec4 aPos; layout(location = 1) in vec2 aTexCoord; out vec2 texCoord; uniform mat4 u_MVP; void main() { gl_Position = u_MVP*aPos; texCoord = aTexCoord; } #shader fragment #version 330 core out vec4 colors; in vec2 texCoord; uniform sampler2D u_Texture; void main() { colors = texture(u_Texture, texCoord); } Before Scaling (It's down there on the bottom left corner as a dot). After Scaling Problem: Why does the position also changes?? If you see my Verticies, the first position starts at 1.0f, 1.0f , so when i'm scaling it should stay at that position
  10. I have strip the code down to barest minimum for clarity With the window up and draw rendering correctly, I set the key press to take the 'x' key, but when I press 'x' and print anywhere (and everywhere) to test, nothing prints to console. I scrutinised to see why, but I can't find what is missing. Can anyone see why its not working? Thanks public class PuzzleG extends JFrame implements GLEventListener, KeyListener { private static final long serialVersionUID = 1L; final private int width = 800; final private int height = 600; int numOfUnits; GLU glu= new GLU(); List<ObjVertices> dataArray; public PuzzleG( int units, List<ObjVertices> vertXYZ ) { super(" Puzzle game "); Globals.camera = new Point3D(0.0f, 1.4f, 0.0f); Globals.view = new Point3D(0.0f, -1.0f, -3.0f); GLProfile profile = GLProfile.get(GLProfile.GL2); GLCapabilities capabilities = new GLCapabilities(profile); GLCanvas canvas = new GLCanvas(capabilities); canvas.addGLEventListener(this); this.setName("Minimal OpenGL"); this.getContentPane().add(canvas); this.setSize(width, height); this.setLocationRelativeTo(null); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setVisible(true); this.setResizable(false); dataArray = vertXYZ; numOfUnits = units; canvas.requestFocusInWindow(); } public void play() { } @Override public void display(GLAutoDrawable drawable) { GL2 gl = drawable.getGL().getGL2(); gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT); gl.glMatrixMode(GL2.GL_MODELVIEW); gl.glLoadIdentity(); glu.gluLookAt( Globals.camera.x, Globals.camera.y, Globals.camera.z, Globals.view.x, Globals.view.y, Globals.view.z, 0.0f, 1.0f, 0.0f); gl.glTranslatef(0.0f, 0.0f, -3.0f); gl.glBegin(GL.GL_LINE_LOOP); /*=========================== START =========================================================== ... draw object vertices ... ============================= end ============================================================ */ gl.glEnd(); gl.glFlush(); } @Override public void dispose(GLAutoDrawable drawable) { if( Globals.c == 'x')System.out.println(" 3333 "); } @Override public void init(GLAutoDrawable drawable) { GL2 gl = drawable.getGL().getGL2(); gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f); gl.glClearDepthf(1.0f); gl.glEnable(GL2.GL_DEPTH_TEST); gl.glDepthFunc(GL2.GL_LEQUAL); gl.glHint(GL2.GL_PERSPECTIVE_CORRECTION_HINT, GL2.GL_NICEST); gl.glShadeModel(GL2.GL_SMOOTH); gl.glEnableClientState(GL2.GL_VERTEX_ARRAY); if( Globals.c == 'x')System.out.println(" 1111 "); } @Override public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { GL2 gl = drawable.getGL().getGL2(); if (height == 0) height = 1; float aspect = (float)width / height; gl.glViewport(0, 0, width, height); gl.glMatrixMode(GL2.GL_PROJECTION); gl.glLoadIdentity(); glu.gluPerspective( 45, aspect, 0.1f, 100.0f); if( Globals.c == 'x')System.out.println(" 2222 "); } @Override public void keyPressed(KeyEvent e) { Globals.c = e.getKeyChar(); if( Globals.c == 'x'){ System.out.println(" 5555 "); } } @Override public void keyReleased(KeyEvent arg0) { // TODO Auto-generated method stub } @Override public void keyTyped(KeyEvent arg0) { // TODO Auto-generated method stub } } Just for the sake of checking I also tried the other key options as in the code below, but still didn't see any prints to console @Override public void keyReleased(KeyEvent e) { Globals.c = e.getKeyChar(); if( Globals.c == 'x'){ System.out.println(" 8888 "); } } @Override public void keyTyped(KeyEvent e) { Globals.c = e.getKeyChar(); if( Globals.c == 'x'){ System.out.println(" 7777 "); } }
  11. Hello, I'm making a graphical application for Mac OS. I've found several examples of how to create a context on Cocoa form, but all of them involve either NSOpenGlView, or custom view. The question is, is it possible to create a context directly on a window? I'm asking this mostly because of speed concerns, NSOpenGlView clearly renders to a buffer and then draws it on screen.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!