0

I have a program that uses the GPU for performing certain computations. I can get the program to run correctly using the command line. But when i try to execute the same statement through PHP, i run into trouble.

I'm using wamp 2.0, and I've tried the exec and proc_open functions to try to get the program to run, but even though the process starts correctly, when it comes to the GPU part, the program itself raises the error, "Shader not supported by your hardware". The program also initially detects the kind of graphics card being used, but this is not happening either.

To be clear, I haven't written the GPU program. And I can run the same statement directly from the command line, but not through php. What is the difference in executing a command from php rather than directly?

I'm using an NVIDIA GT8600 graphics card. Any help at all would be great.

In the program when it checks for graphics card vendor using glGetString(GL_VENDOR) it gets Microsoft Corporation instead of NVIDIA. This is causing all the problems, though i still don't know why its doing so only when i run it from php.

I've also tried running the php script standalone from the command line, and in this case my graphics card gets detected correctly and everything works fine, only when i go through my browser does it not work.

4

1 回答 1

0

经过一番挖掘后,我发现问题是由于 Windows 7 中的会话 0 隔离引起的(我很抱歉没有在问题中提及 Windows 7)

它的要点是,驻留在会话 0 中的 wampapache 服务启动的任何进程都无法访问显示设备(这需要我的服务成为会话 1 的一部分)。所以调用GPU进程时我的代码无法检测到我的显卡。

解决此问题的一种方法是在会话 1 中生成一个服务,然后让它执行该过程。NVIDIA 论坛中有一个很好的帖子以及一些示例代码,展示了如何做到这一点。

http://forums.nvidia.com/index.php?showtopic=93450&pid=1047458&mode=threaded&start=#entry1047458

于 2010-07-19T17:51:05.793 回答