Jump to content
  • Advertisement
Sign in to follow this  
JoeJ

Simple shader causes Nvidia driver to hang

This topic is 521 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

After completing vkCreateShadermodule() without errors,
NV driver never returns from calling vkCreateComputePipelines().
Works on AMD without issues.
 
#version 450

layout (local_size_x = 64) in;

layout (std430, binding = 0) buffer bS_V4 { vec4 _G_sample_V4[]; };
layout (std430, binding = 1) buffer bS_SI { uint _G_sample_indices[]; };
layout (std430, binding = 2) buffer bLL { uint _G_lists[]; };
layout (std430, binding = 3) buffer bDBG { uint _G_dbg[]; };

void main ()
{
	uint lID = gl_LocalInvocationID.x;

	uint listIndex = gl_WorkGroupID.x * 64 + lID;
	if (listIndex < 100)
	{
		_G_dbg[8] = _G_lists[786522]; // changing to smaller number like 78652 would work
	}
}
I checked the buffer has been allocated at this point with a size of 3146592 bytes ( / 4 = 786648).
Below is my buffer allocation code, but i have no idea if it's related to this at all, or if vkCreateComputePipelines() might do any kind of checks.

No validation errors - nothing :(

Any idea what could be wrong?


 
const VkBufferUsageFlags deviceUsage	= VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT;
const VkBufferUsageFlags hostUsage	= VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;

const VkFlags deviceMemoryProperties	= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT,
const VkFlags hostMemoryProperties	= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,

const VkSharingMode deviceSharingMode	= VK_SHARING_MODE_EXCLUSIVE,
const VkSharingMode hostSharingMode	= VK_SHARING_MODE_EXCLUSIVE


Buffer::Prepare (deviceBuffer, deviceDeviceMemory, 0, size, gpu.device, gpu.memoryProperties, deviceUsage, deviceMemoryProperties, deviceSharingMode);
Buffer::Prepare (hostBuffer, hostDeviceMemory, data, size, gpu.device, gpu.memoryProperties, hostUsage, hostMemoryProperties, hostSharingMode);

// 

void Buffer::Prepare (
			VkBuffer &buffer, VkDeviceMemory &deviceMemory, 
			const void *data, const VkDeviceSize size, 
			const VkDevice device, const VkPhysicalDeviceMemoryProperties deviceMemoryProperties,
			const VkBufferUsageFlags usage, // e.g. VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT or VK_BUFFER_USAGE_STORAGE_BUFFER_BIT
			const VkFlags memoryProperties = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
			const VkSharingMode sharingMode = VK_SHARING_MODE_EXCLUSIVE) 			 
		{
			VkBufferCreateInfo bufferCreateInfo = {};
				bufferCreateInfo.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
				bufferCreateInfo.usage = usage;
				bufferCreateInfo.size = size;
				bufferCreateInfo.sharingMode = sharingMode;
			VkResult U_ASSERT_ONLY err = vkCreateBuffer(device, &bufferCreateInfo, NULL, &buffer);
			assert(!err);

			VkMemoryRequirements memoryRequirements;
			vkGetBufferMemoryRequirements(device, buffer, &memoryRequirements);

			VkMemoryAllocateInfo memoryAllocateInfo;
				memoryAllocateInfo.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO;
				memoryAllocateInfo.pNext = NULL;
				memoryAllocateInfo.allocationSize = memoryRequirements.size;

			memoryAllocateInfo.memoryTypeIndex = MemoryTypeFromProperties(
				memoryRequirements.memoryTypeBits, 
				memoryProperties,
				deviceMemoryProperties);

			err = vkAllocateMemory(device, &memoryAllocateInfo, NULL, &(deviceMemory));
			assert(!err);

			if (data) Update (data, device, deviceMemory, size);

			err = vkBindBufferMemory(device, buffer, deviceMemory, 0);
			assert(!err);
		}


EDIT:

It does not hang, it just takes ages to compile. Started a new thread about it: https://www.gamedev.net/topic/686518-extreme-long-compile-times-and-bad-performance-on-nvidia/ Edited by JoeJ

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!