ingowald / optix7course

Apache License 2.0
452 stars 80 forks source link

Invalid Target Architecture Error #12

Closed ibaris closed 3 years ago

ibaris commented 3 years ago

When I try to run the modules, I get the following error message:

C:\...\optix7course\cmake-build-debug\ex04_firstTriangleMesh.exe
#osc: initializing optix...
#osc: found 1 CUDA devices
?[1;32m#osc: successfully initialized optix... yay!?[0m
#osc: creating optix context ...
#osc: running on device: GeForce GTX 745
[ 4][   DISKCACHE]: Cache miss for key: ptx-4623-keyd3aa410302748a37e754957186aebaf9-sm_50-rtc0-drv461.40
#osc: setting up module ...
[ 2][COMPILE FEEDBACK]: COMPILE ERROR: Malformed PTX input. See compile details for more information.
Error: Invalid target architecture. Maximum feasible for current context: sm_50, found: sm_52

Optix call (optixModuleCreateFromPTX(optixContext, &moduleCompileOptions, &pipelineCompileOptions, ptxCode.c_str(), ptxC
ode.size(), log,&sizeof_log, &module )) failed with code 7200 (line 337)

Process finished with exit code 2

In other tutorials, I was able to work around these errors by setting the CUDA compilation flags in the CMake files to -arch sm_50 and -arch compute_50. Do you have a possible solution?

Thank you for your efforts.

ingowald commented 3 years ago

Hey, Ibaris, I am not 100% certain as to what causes this error, but it looks to me as if either your version of optix, or your version of cuda, don't support the (by now pretty old) 5.0 compute architecture any more (e.g., CUDA 11 explicitly states that 5.0 is being deprecated); it certainly looks like it's not related to this sample project, I couldn't find anything that would restrict which GPU arch is being supported. I would suggest asking on the optix developers forum if that GPU compute version is still supported.