none
C++ AMP: D3D11: ERROR: ID3D11Device::CheckFeatureSupport: Unrecognized D3D11_FEATURE value 0x5.

    質問

  • I'm trying to run a simple C++ AMP program and I'm getting the following error in the output window:

    D3D11: ERROR: ID3D11Device::CheckFeatureSupport: Unrecognized D3D11_FEATURE value 0x5.

    This is on a Windows 7 machine with VS 11 Ultimate Beta and a NVIDIA GeForce GTX 460 with latest drivers (295.73). Here is the callstack when I enabled breaks in the DirectX control panel:

         vcamp110d.dll!_unlock(int locknum) Line 376    C
         vcamp110d.dll!_heap_alloc_dbg_impl(unsigned int nSize, int nBlockUse, const char * szFileName, int nLine, int * errno_tmp) Line 507    C++
         vcamp110d.dll!_heap_alloc_dbg_impl(unsigned int nSize, int nBlockUse, const char * szFileName, int nLine, int * errno_tmp) Line 504    C++
         vcamp110d.dll!_nh_malloc_dbg_impl(unsigned int nSize, int nhFlag, int nBlockUse, const char * szFileName, int nLine, int * errno_tmp) Line 239    C++
         vcamp110d.dll!_nh_malloc_dbg(unsigned int nSize, int nhFlag, int nBlockUse, const char * szFileName, int nLine) Line 302    C++
         vcamp110d.dll!malloc(unsigned int nSize) Line 56    C++
         0037ed40()    Unknown
         vcamp110d.dll!Concurrency::details::_Query_extended_double_instructions_support(ID3D11Device * _Device) Line 371    C++
         vcamp110d.dll!Concurrency::details::_D3D11_engine::_D3D11_engine(IDXGIAdapter * _Adapter, Concurrency::details::_D3D_device_type _Device_type, bool _Debug, bool _Debuggable) Line 435    C++
         vcamp110d.dll!Concurrency::details::_D3D_engine::_Create(IDXGIAdapter * _Adapter, Concurrency::details::_D3D_device_type _Device_type, bool _Debug) Line 258    C++
         vcamp110d.dll!Concurrency::details::_D3D_accelerator_impl::_Create_D3D_engine(bool _Debug) Line 205    C++
         vcamp110d.dll!Concurrency::details::_D3D_accelerator_impl::_Create_D3D_accelerator_view(Concurrency::queuing_mode _Mode) Line 224    C++
         vcamp110d.dll!Concurrency::details::_D3D_accelerator_impl::_D3D_accelerator_impl(IDXGIAdapter * _Adapter, const wchar_t * _Adapter_instance_id, Concurrency::details::_D3D_device_type _Device_type) Line 97    C++
         vcamp110d.dll!Concurrency::details::_D3D_accelerator_impl::_Create_D3D_accelerator_impl(Concurrency::details::_D3D_device_type _Device_type) Line 264    C++
         vcamp110d.dll!Concurrency::details::_DPC_runtime_factory::_DPC_runtime_factory() Line 433    C++
         vcamp110d.dll!Concurrency::details::_DPC_runtime_factory::_Init_global_runtime_factory(_RTL_RUN_ONCE * InitOnce, void * inParam, void * * contextPtr) Line 655    C++
         ntdll.dll!76fdbfd4()    Unknown
         kernel32.dll!7541d606()    Unknown
         vcamp110d.dll!Concurrency::details::_DPC_runtime_factory::_Get_factory() Line 667    C++
         vcamp110d.dll!Concurrency::details::_Get_num_devices() Line 63    C++
         amp_test.exe!Concurrency::accelerator::get_all() Line 793    C++
         amp_test.exe!wmain(int argc, wchar_t * * argv) Line 17    C++

    2012年3月12日 20:07

回答

  • Hi jjzanin

    The output window D3D11 warnings that you see in the output window are harmless. We are working to see if we can eliminate them for post-Beta builds of VS 11.

    You did not specify what exception you are seeing at runtime or what line is causing it. Please provide that info.

    Without that info, just looking at your code, what happens if you add the required line of code after the parallel_for_each and before the for loop where you access the c pointer through printf?
        c_view.synchronize();

    Cheers
    Daniel


    http://www.danielmoth.com/Blog/

    • 回答としてマーク jjzanin 2012年3月13日 16:46
    2012年3月12日 22:54
    所有者

すべての返信

  • From the call stack, it looks like you are trying to execute the code that needs Double Precision Support. I would recommend you to go through the below blog post which gives information about Double Precision Support in AMP.

    http://blogs.msdn.com/b/nativeconcurrency/archive/2012/02/07/double-precision-support-in-c-amp.aspx

    2012年3月12日 21:29
  • I'm not explicitly using doubles in my code:

    // amp_test.cpp : Defines the entry point for the console application.
    //
    
    #include <amp.h>
    
    #include "stdafx.h"
    
    static float sum(float a, float b) restrict(amp)
    {
    	return a + b;
    }
    
    int _tmain(int argc, _TCHAR* argv[])
    {
    	uint32_t const array_size = 1000;
    
    	// Allocate memory.
    	float* a = new float[ array_size ];
    	float* b = new float[ array_size ];
    	float* c = new float[ array_size ];
    
    	// Fill in the input data.
    	for (uint32_t i = 0; i < array_size; i++) {
    
    		a[i] = static_cast< float >(i);
    		b[i] = static_cast< float >(2 * i);
    	}
    
    	// Create array_views to the data.
    	Concurrency::array_view< float const, 1 > a_view(array_size, a);
    	Concurrency::array_view< float const, 1 > b_view(array_size, b);
    	Concurrency::array_view< float, 1 > c_view(array_size, c);
    	c_view.discard_data();
    
    	// Run the code on the GPU.
    	Concurrency::parallel_for_each(
    		c_view.get_extent(),
    		[=](Concurrency::index<1> i) restrict(amp)
    		{
    			c_view[i] = sum(a_view[i], b_view[i]);
    		}
    	);
    
    	for (uint32_t i = 0; i < array_size; i++) {
    
    		printf("%f\n", c[i]);
    	}
    
    	// What about the array_views still referencing this data?
    	delete [] a;
    	delete [] b;
    	delete [] c;
    
    	return 0;
    }

    2012年3月12日 21:51
  • Hi jjzanin

    The output window D3D11 warnings that you see in the output window are harmless. We are working to see if we can eliminate them for post-Beta builds of VS 11.

    You did not specify what exception you are seeing at runtime or what line is causing it. Please provide that info.

    Without that info, just looking at your code, what happens if you add the required line of code after the parallel_for_each and before the for loop where you access the c pointer through printf?
        c_view.synchronize();

    Cheers
    Daniel


    http://www.danielmoth.com/Blog/

    • 回答としてマーク jjzanin 2012年3月13日 16:46
    2012年3月12日 22:54
    所有者
  • Doh! That was the problem, synchronize works. I should have had c_view[i] in the printf. I turned on C++ exceptions in VS and got this one:

    "Failed to create a resource view on the device."

    >	vcamp110d.dll!_CxxThrowException(void * pExceptionObject, const _s__ThrowInfo * pThrowInfo) Line 141	C++
     	vcamp110d.dll!Concurrency::details::_D3D_accelerator_impl::_D3D_accelerator_impl(IDXGIAdapter * _Adapter, const wchar_t * _Adapter_instance_id, Concurrency::details::_D3D_device_type _Device_type) Line 105	C++
     	vcamp110d.dll!Concurrency::details::_D3D_accelerator_impl::_Create_D3D_accelerator_impl(Concurrency::details::_D3D_device_type _Device_type) Line 267	C++
     	vcamp110d.dll!Concurrency::details::_DPC_runtime_factory::_DPC_runtime_factory() Line 421	C++
     	vcamp110d.dll!Concurrency::details::_DPC_runtime_factory::_Init_global_runtime_factory(_RTL_RUN_ONCE * InitOnce, void * inParam, void * * contextPtr) Line 655	C++
     	ntdll.dll!7719bfd4()	Unknown
     	kernel32.dll!76bdd606()	Unknown
     	vcamp110d.dll!Concurrency::details::_DPC_runtime_factory::_Get_factory() Line 667	C++
     	vcamp110d.dll!Concurrency::accelerator::_Init(const wchar_t * _Path) Line 55	C++
     	amp_test.exe!Concurrency::accelerator::accelerator(const std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > & _Device_path) Line 766	C++
     	amp_test.exe!Concurrency::details::_Array_view_base<1,1>::_Array_view_base<1,1>(void * _Data, const Concurrency::extent<1> & _Array_extent) Line 1764	C++
     	amp_test.exe!Concurrency::array_view<float const ,1>::array_view<float const ,1>(int _E0, float * _Src) Line 3029	C++
     	amp_test.exe!wmain(int argc, wchar_t * * argv) Line 32	C++
    

    I put a try-catch block around the code and it wasn't catching anything so it must be handled.

    Thank you!

    Jeremiah

    2012年3月13日 16:46