summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README1
-rw-r--r--libcuda/cuda_runtime_api.cc34
-rw-r--r--src/cuda-sim/cuda-sim.cc1
-rw-r--r--src/cuda-sim/ptx_loader.cc5
4 files changed, 36 insertions, 5 deletions
diff --git a/README b/README
index 4426cdd..543177c 100644
--- a/README
+++ b/README
@@ -349,6 +349,7 @@ process.
** Debugging failing GPGPU-Sim Regressions **
+Credits: Tor M Aamodt
To debug failing GPGPU-Sim regression tests you need to run them locally. The fastest way to do this, assuming you are working with GPGPU-Sim versions more recent than the GPGPU-Sim dev branch circa March 28, 2018 (commit hash 2221d208a745a098a60b0d24c05007e92aaba092), is to install Docker. The instructions below were tested with Docker CE version 18.03 on Ubuntu and Mac OS. Docker will enable you to run the same set of regressions used by GPGPU-Sim when submitting a pull request to https://github.com/gpgpu-sim/gpgpu-sim_distribution and also allow you to log in and launch GPGPU-Sim in gdb so you can inspect failures.
diff --git a/libcuda/cuda_runtime_api.cc b/libcuda/cuda_runtime_api.cc
index c103244..3fd88dc 100644
--- a/libcuda/cuda_runtime_api.cc
+++ b/libcuda/cuda_runtime_api.cc
@@ -349,7 +349,15 @@ class _cuda_device_id *GPGPUSim_Init()
prop->maxGridSize[2] = 0x40000000;
prop->totalConstMem = 0x40000000;
prop->textureAlignment = 0;
- prop->sharedMemPerBlock = the_gpu->shared_mem_size();
+ /*
+ * TODO: Update the .config and xml files of all GPU config files with new value of sharedMemPerBlock.
+ * Previously, this was thought as sharedMemPerMultiprocessor and is being used in many places.
+ * Check whether all the instances of shared_mem_size(), gpgpu_shmem_size or sharedMemPerBlock are meant to use sharedMemPerBlock or sharedMemPerMultiprocessor.
+ */
+ prop->sharedMemPerBlock = 49152;
+#if (CUDART_VERSION > 5000)
+ prop->sharedMemPerMultiprocessor = the_gpu->shared_mem_size();
+#endif
prop->regsPerBlock = the_gpu->num_registers_per_core();
prop->warpSize = the_gpu->wrp_size();
prop->clockRate = the_gpu->shader_clock();
@@ -840,6 +848,15 @@ __host__ cudaError_t CUDARTAPI cudaDeviceGetAttribute(int *value, enum cudaDevic
if (device <= dev->num_devices() ) {
prop = dev->get_prop();
switch (attr) {
+ case 2:
+ *value= prop->maxThreadsDim[0];
+ break;
+ case 3:
+ *value= prop->maxThreadsDim[1];
+ break;
+ case 4:
+ *value= prop->maxThreadsDim[2];
+ break;
case 5:
*value= prop->maxGridSize[0];
break;
@@ -849,6 +866,12 @@ __host__ cudaError_t CUDARTAPI cudaDeviceGetAttribute(int *value, enum cudaDevic
case 7:
*value= prop->maxGridSize[2];
break;
+ case 8:
+ *value= prop->sharedMemPerBlock;
+ break;
+ case 9:
+ *value= prop->totalConstMem;
+ break;
case 10:
*value= prop->warpSize;
break;
@@ -861,11 +884,14 @@ __host__ cudaError_t CUDARTAPI cudaDeviceGetAttribute(int *value, enum cudaDevic
case 16:
*value= prop->multiProcessorCount ;
break;
+ case 34:
+ *value= 0;
+ break;
case 39:
*value= dev->get_gpgpu()->threads_per_core();
break;
case 75:
- *value= 8 ;
+ *value= 9 ;
break;
case 76:
*value= 3 ;
@@ -873,6 +899,9 @@ __host__ cudaError_t CUDARTAPI cudaDeviceGetAttribute(int *value, enum cudaDevic
case 78:
*value= 0 ; //TODO: as of now, we dont support stream priorities.
break;
+ case 81:
+ *value= prop->sharedMemPerMultiprocessor;
+ break;
default:
printf("ERROR: implement the attribute numbered %d \n",attr);
abort();
@@ -1882,6 +1911,7 @@ void cuobjdumpParseBinary(unsigned int handle){
if (capability > max_capability) max_capability = capability;
}
if (max_capability > 20) printf("WARNING: No guarantee that PTX will be parsed for SM version %u\n", max_capability);
+ max_capability=context->get_device()->get_gpgpu()->get_config().get_forced_max_capability();
cuobjdumpPTXSection* ptx = NULL;
const char* pre_load = getenv("CUOBJDUMP_SIM_FILE");
diff --git a/src/cuda-sim/cuda-sim.cc b/src/cuda-sim/cuda-sim.cc
index dce35ca..b1eaf01 100644
--- a/src/cuda-sim/cuda-sim.cc
+++ b/src/cuda-sim/cuda-sim.cc
@@ -2155,3 +2155,4 @@ void functionalCoreSim::warp_exit( unsigned warp_id )
}
}
}
+
diff --git a/src/cuda-sim/ptx_loader.cc b/src/cuda-sim/ptx_loader.cc
index 4ddc6bf..33a4260 100644
--- a/src/cuda-sim/ptx_loader.cc
+++ b/src/cuda-sim/ptx_loader.cc
@@ -423,6 +423,7 @@ void gpgpu_ptxinfo_load_from_string( const char *p_for_info, unsigned source_num
snprintf(commandline,1024,"$CUDA_INSTALL_PATH/bin/ptxas %s -v %s --output-file /dev/null 2> %s",
extra_flags, fname2, tempfile_ptxinfo);
printf("GPGPU-Sim PTX: generating ptxinfo using \"%s\"\n", commandline);
+ fflush(stdout);
result = system(commandline);
if( result != 0 ) {
printf("GPGPU-Sim PTX: ERROR ** while loading PTX (b) %d\n", result);
@@ -443,14 +444,12 @@ void gpgpu_ptxinfo_load_from_string( const char *p_for_info, unsigned source_num
}
}
- ptxinfo_in = fopen(final_tempfile_ptxinfo,"r");
if(no_of_ptx>0)
g_ptxinfo_filename = final_tempfile_ptxinfo;
else
g_ptxinfo_filename = tempfile_ptxinfo;
+ ptxinfo_in = fopen(g_ptxinfo_filename,"r");
- //The program might get stuck because the parser didnt receive a EOF.
- printf("NOTE: If the program is stuck, please press ctrl+d for Ubuntu/Mac and ctrl+z for Windows users \n");
ptxinfo_parse();
snprintf(commandline,1024,"rm -f *info");