Open GCLemon opened 3 years ago
Hi @GCLemon ,
It could be that your GPU is too old and therefore not supported in this framework?
According to this website, the Quadro 2000 is built on the Fermi architecture, which only supports sm_20
.
Thanks for your advice. I have just changed my GPU to GeForce GTX 980, which is newer than Quadro 2000, but it caused another runtime error:
2021-05-29 15:08:36 INFO main [optix_api.cpp:56] Dynamic loading of the Optix library ..
2021-05-29 15:08:36 INFO main [PluginManager] Loading plugin "plugins\path.dll" ..
2021-05-29 15:08:36 INFO main [PluginManager] Loading plugin "plugins\perspective.dll" ..
2021-05-29 15:08:36 INFO main [PluginManager] Loading plugin "plugins\ldsampler.dll" ..
2021-05-29 15:08:36 WARN main [LowDiscrepancySampler] Sample count should be square and power of two, rounding to 1024
2021-05-29 15:08:36 INFO main [PluginManager] Loading plugin "plugins\hdrfilm.dll" ..
2021-05-29 15:08:36 INFO main [PluginManager] Loading plugin "plugins\gaussian.dll" ..
2021-05-29 15:08:36 INFO main [PluginManager] Loading plugin "plugins\envmap.dll" ..
2021-05-29 15:08:37 INFO main [srgb.cpp:22] Loading spectral upsampling model "data/srgb.coeff" ..
2021-05-29 15:08:38 INFO main [PluginManager] Loading plugin "plugins\d65.dll" ..
2021-05-29 15:08:38 INFO main [PluginManager] Loading plugin "plugins\regular.dll" ..
2021-05-29 15:08:38 INFO main [PluginManager] Loading plugin "plugins\obj.dll" ..
2021-05-29 15:08:38 INFO main [PluginManager] Loading plugin "plugins\roughplastic.dll" ..
2021-05-29 15:08:38 INFO main [PluginManager] Loading plugin "plugins\uniform.dll" ..
2021-05-29 15:08:38 INFO main [Scene] Building scene in OptiX ..
rt_check(): OptiX API error = 7200 (Invalid PTX input) in C:\[path_to_mitsuba]\src\librender\scene_optix.inl:109.
Log:
Is this really the whole log? The bottom part seems to be missing.
Actually, I didn't get anything else but that......
Could you please compile in debug mode and try again? You should get a more verbose log that will be very helpful for debugging this.
This is a whole log in DEBUG mode. Since mitsuba2 supports CUDA10.x and OptiX 7, my GPU might be still old or something else?
2021-05-31 17:40:30 INFO main [optix_api.cpp:56] Dynamic loading of the Optix library ..
2021-05-31 17:40:30 INFO main [PluginManager] Loading plugin "plugins\path.dll" ..
2021-05-31 17:40:30 INFO main [PluginManager] Loading plugin "plugins\perspective.dll" ..
2021-05-31 17:40:30 INFO main [PluginManager] Loading plugin "plugins\ldsampler.dll" ..
2021-05-31 17:40:30 WARN main [LowDiscrepancySampler] Sample count should be square and power of two, rounding to 1024
2021-05-31 17:40:30 INFO main [PluginManager] Loading plugin "plugins\hdrfilm.dll" ..
2021-05-31 17:40:30 INFO main [PluginManager] Loading plugin "plugins\gaussian.dll" ..
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
cuda_eval(): launching kernel (n=1, in=0, out=1, ops=11)
2021-05-31 17:40:30 INFO main [PluginManager] Loading plugin "plugins\envmap.dll" ..
2021-05-31 17:40:30 DEBUG main [Bitmap] Loading OpenEXR file "C:\............\ilum001.exr" (3200x1600, rgb, float16) ..
2021-05-31 17:40:31 INFO main [srgb.cpp:22] Loading spectral upsampling model "data/srgb.coeff" ..
2021-05-31 17:40:36 INFO main [PluginManager] Loading plugin "plugins\d65.dll" ..
2021-05-31 17:40:36 INFO main [PluginManager] Loading plugin "plugins\regular.dll" ..
2021-05-31 17:40:36 INFO main [PluginManager] Loading plugin "plugins\obj.dll" ..
2021-05-31 17:40:36 INFO main [PluginManager] Loading plugin "plugins\roughplastic.dll" ..
2021-05-31 17:40:36 INFO main [PluginManager] Loading plugin "plugins\uniform.dll" ..
cuda_eval(): launching kernel (n=1, in=0, out=3, ops=4)
cuda_eval(): launching kernel (n=1, in=1, out=1, ops=2)
2021-05-31 17:40:46 DEBUG main [OBJMesh] Loading mesh from "sphere002.obj" ..
2021-05-31 17:40:46 DEBUG main [OBJMesh] "sphere002.obj": read 45000 faces, 22801 vertices (1.21 MiB in 462ms)
2021-05-31 17:40:46 INFO main [Scene] Building scene in OptiX ..
[ 2][COMPILE FEEDBACK]: COMPILE ERROR: Malformed PTX input. See compile details for more information.
Error: Invalid target architecture. Maximum feasible for current context: sm_52, found: sm_61
rt_check(): OptiX API error = 7200 (Invalid PTX input) in C:\............\mitsuba\src\librender\scene_optix.inl:109.
Log: cuda_shutdown()
cuda_shutdown(): variable 399 is still live.
cuda_shutdown(): variable 393 is still live.
cuda_shutdown(): variable 388 is still live.
cuda_shutdown(): variable 387 is still live.
cuda_shutdown(): variable 382 is still live.
cuda_shutdown(): variable 397 is still live.
cuda_shutdown(): variable 407 is still live.
cuda_shutdown(): variable 386 is still live.
cuda_shutdown(): variable 383 is still live.
cuda_shutdown(): variable 384 is still live.
(skipping remainder)
cuda_shutdown(): 25 variables were still live at shutdown.
TBB Warning: Leaked 1 observer_proxy objects
One thing you could try is to replace compute_61
by compute_51
in resources/ptx/MakeFile
and run make
in that folder to re-generate the mitsuba main PTX kernels. After this you will need to re-compile Mitsuba 2.
Let me know if this fixes your issue.
I have installed make command for Windows and modified Makefile as following to make it works on Windows:
mts_include_folder = ..\..\include
mts_shape_folder = ..\..\src\shapes\optix
mts_optix_main = ..\..\src\librender\optix\optix_rt.cu
all: optix_rt.ptx
optix_rt.ptx: $(mts_optix_main)
nvcc $(mts_optix_main) \
-I $(mts_include_folder) -I $(mts_shape_folder) -I \opt\optix-7.0.0\include\ \
-O3 -gencode arch=compute_51,code=compute_51 --ptx
clean:
rm -f optix_rt.ptx
Then I ran make
command in the folder which contains Makefile, to find my CUDA compiler seemed not to support compute_51
.
nvcc ..\..\src\librender\optix\optix_rt.cu \
-I ..\..\include -I ..\..\src\shapes\optix -I \opt\optix-7.0.0\include\ \
-O3 -gencode arch=compute_51,code=compute_51 --ptx
nvcc fatal : Unsupported gpu architecture 'compute_51'
make: *** [optix_rt.ptx] Error 1
Next I restored compute_51
to compute_61
and ran make
again, but it caused another error:
nvcc ..\..\src\librender\optix\optix_rt.cu \
-I ..\..\include -I ..\..\src\shapes\optix -I \opt\optix-7.0.0\include\ \
-O3 -gencode arch=compute_61,code=compute_61 --ptx
optix_rt.cu
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin/../include\cuda_runtime.h(1): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss.
............
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include\cuda_runtime_api.h(9349): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss.
../../include\mitsuba/render/optix/ray.cuh(4): fatal error C1083: Cannot open include file: 'optix.h': No such file or directory
make: *** [optix_rt.ptx] Error 2
Since I thought that \opt\optix-7.0.0\include\
should be the path to OptiX SDK, I replaced it to C:\ProgramData\NVIDIA Corporation\OptiX SDK 7.3.0\include
, but it still caused some errors:
nvcc ..\..\src\librender\optix\optix_rt.cu \
-I ..\..\include -I ..\..\src\shapes\optix -I "C:\ProgramData\NVIDIA Corporation\OptiX SDK 7.3.0\include" \
-O3 -gencode arch=compute_61,code=compute_61 --ptx
optix_rt.cu
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin/../include\cuda_runtime.h(1): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss.
............
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include\cuda_runtime_api.h(9349): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\cmath(259): error: calling a __host__ function("__copysignf") from a __device__ function("solve_quadratic") is not allowed
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\cmath(259): error: identifier "__copysignf" is undefined in device code
2 errors detected in the compilation of "C:/Users/yamamoto/AppData/Local/Temp/tmpxft_00003b90_00000000-10_optix_rt.cpp1.ii".
make: *** [optix_rt.ptx] Error 1
In a seperate folder could you maybe try to use nvcc
to compile a dummy CUDA kernel (without optix) and check what is the highest compute_XX
supported by your system?
I found that compute_62
is the highest, and compute_52
is the lowest additionally.
How could you get this error then?
Error: Invalid target architecture. Maximum feasible for current context: sm_52, found: sm_61
I succeeded to compile empty CUDA compiler with -gencode
option compute_52,code=compute_52
, compute_61,code=compute_61
, and compute_62,code=compute_62
, and I did not understand why this error happened......
Since I failed to regenerate optix_rt.ptx, it is possible that current mitsuba, which uses optix_rt.ptx before regenerating, supports sm_61 or later.
Summary
PTX link error while using mitsuba2 python interface.
System configuration
scalar_rgb
scalar_spectral
gpu_rgb
gpu_spectral
Description
I am trying to use mitsuba2 python interface with GPU variant. I have compiled the system in Anaconda Powershell using the following commands:
Then I executed
setpath.ps1
, imported mitsuba in python, and attempted to render a scene. While the rendering using the variantgpu_spectral
, it caused PTX link error:Using XML file and
mitsuba
command caused the same error.Any responses will be appreciated.