Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 277 278 [279] 280 281 ... 796

Author Topic: if self.isCoder(): post() #Programming Thread  (Read 903138 times)

olemars

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4170 on: March 09, 2013, 01:25:03 pm »

Does Windows automatically link to dlls hidden somewhere in your system files? I ran the program as-is, unzipped into a folder, which worked for me.
I think I have the SDK installed, but that's it. The SDK for AMD, and AMD's catalyst driver.

DLL's are searched for and loaded according to the environment path variable, but it always checks the current directory first (where the executed program is), so if you ship a dll with your application it will always choose that dll.

With linking I meant what libraries you link with when you build the program (linker->input in visual studio project properties). You link with .lib files which have a matching .dll. If you accidentally shpi the program with a dll of another version than the .lib you linked with there will be issues.

In this case the problem is actually with the GPU platform. I have an NVIDIA card that only supports OpenCL 1.0. You'll have to check at startup that the computer/GPU the application is running on supports the OpenCL level you need (there are specific functions for doing that).

Edit: Also, you shouldn't include OpenCL.dll with the program. If the installed driver supports any form of OpenCL it will have its own dll available. When you include it yourself you override the one shipped with the driver, which will cause additional problems (including issues between OS versions).
« Last Edit: March 09, 2013, 01:49:45 pm by olemars »
Logged

Nadaka

  • Bay Watcher
    • View Profile
    • http://www.nadaka.us
Re: if self.isCoder(): post() #Programming Thread
« Reply #4171 on: March 09, 2013, 01:46:19 pm »

Does Windows automatically link to dlls hidden somewhere in your system files? I ran the program as-is, unzipped into a folder, which worked for me.
I think I have the SDK installed, but that's it. The SDK for AMD, and AMD's catalyst driver.
http://msdn.microsoft.com/en-us/library/7d83bc18%28v=vs.80%29.aspx
Logged
Take me out to the black, tell them I ain't comin' back...
I don't care cause I'm still free, you can't take the sky from me...

I turned myself into a monster, to fight against the monsters of the world.

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #4172 on: March 09, 2013, 08:06:09 pm »

I don't see how checking for the openCL version can help o_O It's not like I can have another version of the code ready to go. And it's linked at startup, so the version checking provided with OpenCL doesn't work..
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

olemars

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4173 on: March 09, 2013, 08:30:11 pm »

I don't see how checking for the openCL version can help o_O It's not like I can have another version of the code ready to go. And it's linked at startup, so the version checking provided with OpenCL doesn't work..

Checking for version lets you at least quit gracefully with a meaningful message on unsupported hardware. If you use device subdivision you probably require at least OpenCL 1.1, possibly 1.2.  In many cases it's actually possible to have several code paths available for different hardware, it's quite common to have a number of fallbacks depending on i.e. shader capabilities or specific OpenGL extensions.

The version checking should work as long as you don't distribute your own OpenCL.dll along with your executable (since that'll report the OpenCL on your build machine, not the one you're trying to run it on).
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #4174 on: March 09, 2013, 08:43:46 pm »

Don't plan on using device subdivision, so that should go fine.



Wait, did it work without the OpenCL dll I included? Right now, all the program has is a bunch of clGetDeviceInfo calls.
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

olemars

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4175 on: March 09, 2013, 08:48:55 pm »

I got the same crash with your dll and the one I have from NVidia. According to Depends you call the following functions from the dll:

Code: [Select]
clRetainDevice
clReleaseDevice
clGetDeviceInfo
clGetDeviceIDs
clGetPlatformIDs

It's the first two that are causing problems.
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #4176 on: March 09, 2013, 09:44:30 pm »

Weird. I don't even call those. :S Maybe it's part of the C++ binding I'm using...?
The ones I explicitly call are the latter three.
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

olemars

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4177 on: March 10, 2013, 07:38:12 am »

http://www.khronos.org/registry/cl/api/1.2/cl.hpp

Yep, that seems to be it. The reference helpers are different depending on these defines in cl.h
Code: [Select]
/* OpenCL Version */
#define CL_VERSION_1_0                              1
#define CL_VERSION_1_1                              1
#define CL_VERSION_1_2                              1

Unfortunately that means it's locked to 1.2 at compile time. You'll have to set CL_VERSION_1_2 and possibly CL_VERSION_1_1 to 0 in cl.h and rebuild, depending on what hardware you need to run on.
The hardware conformancy list is available here: http://www.khronos.org/conformance/adopters/conformant-products/

I also just realized I need a new computer :-\ My GT240 only supports 1.0 while most anything else seems to at least support 1.1 by now.
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #4178 on: March 10, 2013, 08:03:59 am »

Yeah, my own Radeon HD Series 6000 supports up to 1.1. Can you see if this works on your PC?

With macro. Might work?
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

olemars

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4179 on: March 10, 2013, 08:11:46 am »

Same crash. Where did you put the macro?
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #4180 on: March 10, 2013, 08:12:58 am »

At the very top of the cl.hpp, after #ifndef CL_HPP_ part. I don't think CL_VERSION_1_0 is defined anywhere else...

Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

olemars

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4181 on: March 10, 2013, 08:15:58 am »

It'll have to be after #include <CL/opencl.h>
Set these two to 0
Code: [Select]
#define CL_VERSION_1_1    0
#define CL_VERSION_1_2    0

edit:
Actually you should probably #undef them instead.
« Last Edit: March 10, 2013, 08:18:40 am by olemars »
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #4182 on: March 10, 2013, 08:18:20 am »

Okay, here it is again. Link

Sorry for cluttering up the thread with this problem, other denizens of self.isCoder() D:
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

olemars

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4183 on: March 10, 2013, 08:31:05 am »

They'll cope :p

See last edit. Either comment out those two from cl.h or #undef them right after opencl.h is included.

The C++ binding uses
Code: [Select]
#if defined(CL_VERSION_1_2)
instead of just
Code: [Select]
#if CL_VERSION_1_2
And I'm really inclined to consider that a bug in OpenCL.
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #4184 on: March 10, 2013, 08:55:24 am »

Am I doing this right?

http://pastebin.com/87ZUe64p

I'm not sure why defined next to #if is blue, but defined next to #define isn't... @_@
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward
Pages: 1 ... 277 278 [279] 280 281 ... 796