nvcc

main.obj : fatal error LNK1143: invalid or corrupt file: no symbol for COMDAT section 0x6

谁都会走 提交于 2019-12-24 09:14:06
问题 I am on a Windows 10 machine, I have 2 files, main.cpp and cuda.cu (I have built this project on Ubuntu successfully I am trying to get it to build on Windows). I compiled both of them to make object files of 64 bit architecture. I have MS Visual Studio 2010 currently installed and I know it is too old. I can install 2015 if you think that is causing this (but I don't think so). When I try to link the two files using the command nvcc main.obj cuda.obj I get this error:- main.obj : fatal error

CUDA Cooperative Groups : Linking error

余生颓废 提交于 2019-12-24 07:56:37
问题 After reading about Cooperative Groups in CUDA 9, I've been trying synchronize at a grid level. I'm using Visual Studio 2017, a GTX 1060 and CUDA 9.1. I altered my code as follows: __global__ void ExplicitKernel_American(/* ... */) { int i = threadIdx.x + blockDim.x * blockIdx.x; auto grid = cooperative_groups::this_grid(); if (i < sizeS) { //... for (int j = 1; j < sizeT; ++j) { // ... grid.sync(); // __syncthreads(); } } } And, as stated in the documentation, I call my kernel this way :

How to add definitions for cuda source code in cmake

ぐ巨炮叔叔 提交于 2019-12-24 00:48:01
问题 I am on Visual Studio 2013, Windows 10, CMake 3.5.1. Everything compiles properly with standard C++, for example: CMakeLists.txt project(Test) add_definitions(/D "WINDOWS_DLL_API=__declspec(dllexport)") add_definitions(/D "FOO=1") set(PROJECT_SRCS ${PROJECT_SOURCE_DIR}/src/Test.cpp) set(PROJECT_INCS ${PROJECT_SOURCE_DIR}/include/Test.h) include_directories(${PROJECT_SOURCE_DIR}/include) add_library(${PROJECT_NAME} SHARED ${PROJECT_SRCS} ${PROJECT_INCS}) Test.h class WINDOWS_DLL_API Test{

nvcc error: string_view.h: constexpr function return is non-constant

烈酒焚心 提交于 2019-12-23 19:54:39
问题 I'm trying to compile some TensorFlow native op with CUDA code. I'm using Python 3.6 and TensorFlow 1.11 here, and CUDA 8.0, on Ubuntu 16. More specifically: gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.10) GNU C++11 (Ubuntu 5.4.0-6ubuntu1~16.04.10) version 5.4.0 20160609 (x86_64-linux-gnu) compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3 Edit: I repeated the experiment with CUDA 9.0 and CUDA 9.1, and also various compiler backends,

VS2010 compiler and cuda error: linkage specification is incompatible with previous “hypot”

荒凉一梦 提交于 2019-12-23 17:39:30
问题 When I try to build my project on a 64 bit Windows 7 using VS 2010 in Debug 64 bit configuration I get this error along with two other errors. error: linkage specification is incompatible with previous "hypot" in math.h line 161 error: linkage specification is incompatible with previous "hypotf" in math.h line 161 error: function "abs(long long)" has already been defined in math_functions.h line 534 I do not get these errors in the 32 bit build. Also, the 64 bit build worked in VS2008. Is

Include a static cuda library into a c++ project

北慕城南 提交于 2019-12-23 06:58:39
问题 I have a templated static CUDA library which I want to include into a common c++ project. When I include the headers of the library the compiler crashes and says It cannot resolve the CUDA-specific symbols. Of course the g++ compiler cannot interpret these symbols. I know the problem, but I do not know how to fix this problem using the nsight IDE. I'm using nsight for both, the cuda/nvcc library and the c++/g++ project. Console output: make all Building file: ../src/MedPrak.cpp Invoking: GCC

how to compile Cuda source with Go language's cgo?

社会主义新天地 提交于 2019-12-22 10:39:10
问题 I wrote a simple program in cuda-c and it works on eclipse nsight. This is source code: #include <iostream> #include <stdio.h> __global__ void add( int a,int b, int *c){ *c = a + b; } int main(void){ int c; int *dev_c; cudaMalloc((void**)&dev_c, sizeof(int)); add <<<1,1>>>(2,7,dev_c); cudaMemcpy(&c, dev_c, sizeof(int),cudaMemcpyDeviceToHost); printf("\n2+7= %d\n",c); cudaFree(dev_c); return 0; } Now I'm trying to use this code with Go language with cgo!!! So I wrote this new code: package

How to hide NVCC's “function was declared but never referenced” warnings?

与世无争的帅哥 提交于 2019-12-22 09:50:48
问题 When compiling CUDA programs which use Google Test, nvcc will emit false-positive warnings: function <name> was declared but never referenced An MCVE: // test.cu #include <gtest/gtest.h> namespace { __global__ void a_kernel() { printf("Works"); } TEST(ExampleTest, ExampleTestCase) { a_kernel<<<1, 1>>>(); } } Compiling it gives: $ nvcc test.cu -lgtest -lgtest_main test.cu(9): warning: function "<unnamed>::ExampleTest_ExampleTestCase_Test::ExampleTest_ExampleTestCase_Test()" was declared but

"don't know what to do with' nvcc fatal error

左心房为你撑大大i 提交于 2019-12-22 06:47:10
问题 I use the command lines in Ubuntu's terminal. And I am trying to compile the three files presented in CUDA_Compiler_Driver_NVCC.pdf When I do use the command line given by the documentation on these 3 files, I do get the following errors: nvcc fatal : don't know what to do with'-dc' If I erase -dc in the command line, I do get the following error too: nvcc fatal : don't know what to do with'-arch=sm=20' Do anyone know how I could fix this issue ? Thanks a lot in advance for your help Gibo

CUDA/PTX 32-bit vs. 64-bit

扶醉桌前 提交于 2019-12-22 05:24:09
问题 CUDA compilers have options for producing 32-bit or 64-bit PTX. What is the difference between these? Is it like for x86, NVidia GPUs actually have 32-bit and 64-bit ISAs? Or is it related to host code only? 回答1: Pointers are certainly the most obvious difference. 64 bit machine model enables 64-bit pointers. 64 bit pointers enable a variety of things, such as address spaces larger than 4GB, and unified virtual addressing. Unified virtual addressing in turn enables other things, such as